summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/MainWindow.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2019-11-16 20:12:55 +0100
committerGitHub <noreply@github.com>2019-11-16 20:12:55 +0100
commitb2cc3af350bf590d7b55a2a82af8ab7967e8b45e (patch)
treed3a7a202ca306e5ba32f7efceacf968259adea03 /Source/Core/DolphinQt/MainWindow.cpp
parentb712cc106bb918a8a06324a681e0c4a35b3473a9 (diff)
parent85c284164339500929b9c42fcdac8e0dcc8b5ec3 (diff)
Merge pull request #8468 from CookiePLMonster/exit-dialog-fix
UI: Fixes for exit dialog
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
-rw-r--r--Source/Core/DolphinQt/MainWindow.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp
index bd1bbce1df..7216b00206 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -30,6 +30,7 @@
#include <qpa/qplatformnativeinterface.h>
#endif
+#include "Common/ScopeGuard.h"
#include "Common/Version.h"
#include "Common/WindowSystemInfo.h"
@@ -785,6 +786,11 @@ bool MainWindow::RequestStop()
if (SConfig::GetInstance().bConfirmStop)
{
+ if (std::exchange(m_stop_confirm_showing, true))
+ return true;
+
+ Common::ScopeGuard confirm_lock([this] { m_stop_confirm_showing = false; });
+
const Core::State state = Core::GetState();
// Only pause the game, if NetPlay is not running
@@ -798,7 +804,8 @@ bool MainWindow::RequestStop()
m_stop_requested ? tr("A shutdown is already in progress. Unsaved data "
"may be lost if you stop the current emulation "
"before it completes. Force stop?") :
- tr("Do you want to stop the current emulation?"));
+ tr("Do you want to stop the current emulation?"),
+ QMessageBox::Yes | QMessageBox::No, QMessageBox::NoButton, Qt::ApplicationModal);
if (confirm != QMessageBox::Yes)
{