From 467ef2afca4f7f368d8da8f45e59c2bfdfb51d76 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 2 Apr 2019 00:55:46 +0200 Subject: [PATCH] Qt: also spawn exit game dialog if rpcs3 is closed (e.g. by accident) --- rpcs3/rpcs3qt/main_window.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index db33445b40..b3a4627fff 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1725,7 +1725,20 @@ void main_window::mouseDoubleClickEvent(QMouseEvent *event) */ void main_window::closeEvent(QCloseEvent* closeEvent) { - Q_UNUSED(closeEvent); + if (!Emu.IsStopped() && guiSettings->GetValue(gui::ib_confirm_exit).toBool()) + { + int result; + + guiSettings->ShowConfirmationBox(tr("Exit RPCS3?"), + tr("A game is currently running. Do you really want to close RPCS3?\n\nAny unsaved progress will be lost!\n"), + gui::ib_confirm_exit, &result, nullptr); + + if (result != QMessageBox::Yes) + { + closeEvent->ignore(); + return; + } + } // Cleanly stop the emulator. Emu.Stop();