From 7878dee32dddcdba1718e9f8564228ead1647b2d Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Fri, 7 Jun 2024 13:00:35 +0100 Subject: [PATCH] input-rec: Display message when we fail to create/open file --- pcsx2-qt/MainWindow.cpp | 12 ++++++++++++ .../Tools/InputRecording/InputRecordingViewer.cpp | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index 8966e79f00..cf769088cc 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -1748,6 +1748,12 @@ void MainWindow::onInputRecNewActionTriggered() m_ui.actionToolbarReset->setEnabled(!g_InputRecording.isTypeSavestate()); }); } + else + { + Host::ReportErrorAsync( + TRANSLATE_SV("MainWindow", "Input Recording Failed"), + fmt::format(TRANSLATE_FS("MainWindow", "Failed to create file: {}"), filePath)); + } }); } @@ -1801,6 +1807,12 @@ void MainWindow::onInputRecPlayActionTriggered() m_ui.actionToolbarReset->setEnabled(!g_InputRecording.isTypeSavestate()); }); } + else + { + Host::ReportErrorAsync( + TRANSLATE_SV("MainWindow", "Input Playback Failed"), + fmt::format(TRANSLATE_FS("MainWindow", "Failed to open file: {}"), filename)); + } }); } } diff --git a/pcsx2-qt/Tools/InputRecording/InputRecordingViewer.cpp b/pcsx2-qt/Tools/InputRecording/InputRecordingViewer.cpp index fbd4d3e877..95adc0ec3c 100644 --- a/pcsx2-qt/Tools/InputRecording/InputRecordingViewer.cpp +++ b/pcsx2-qt/Tools/InputRecording/InputRecordingViewer.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include // TODO - for now this uses a very naive implementation that fills the entire table @@ -96,7 +97,11 @@ void InputRecordingViewer::openFile() if (m_file_open) { loadTable(); - } // TODO else error + } + else + { + QMessageBox::critical(this, tr("Opening Recording Failed"), tr("Failed to open file: %1").arg(QString::fromUtf8(fileName.c_str()))); + } } }