mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-06 03:40:12 +00:00
Make "Do you want to stop emulation?" application modal and disallow multiple instances at once
Fixes numerous issues with this dialog spawning multiple times and putting Dolphin in a weird state.
This commit is contained in:
parent
af92a88aa0
commit
85c2841643
@ -30,6 +30,7 @@
|
|||||||
#include <qpa/qplatformnativeinterface.h>
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "Common/ScopeGuard.h"
|
||||||
#include "Common/Version.h"
|
#include "Common/Version.h"
|
||||||
#include "Common/WindowSystemInfo.h"
|
#include "Common/WindowSystemInfo.h"
|
||||||
|
|
||||||
@ -785,6 +786,11 @@ bool MainWindow::RequestStop()
|
|||||||
|
|
||||||
if (SConfig::GetInstance().bConfirmStop)
|
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();
|
const Core::State state = Core::GetState();
|
||||||
|
|
||||||
// Only pause the game, if NetPlay is not running
|
// 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 "
|
m_stop_requested ? tr("A shutdown is already in progress. Unsaved data "
|
||||||
"may be lost if you stop the current emulation "
|
"may be lost if you stop the current emulation "
|
||||||
"before it completes. Force stop?") :
|
"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)
|
if (confirm != QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
|
@ -198,6 +198,7 @@ private:
|
|||||||
GameList* m_game_list;
|
GameList* m_game_list;
|
||||||
RenderWidget* m_render_widget = nullptr;
|
RenderWidget* m_render_widget = nullptr;
|
||||||
bool m_rendering_to_main;
|
bool m_rendering_to_main;
|
||||||
|
bool m_stop_confirm_showing = false;
|
||||||
bool m_stop_requested = false;
|
bool m_stop_requested = false;
|
||||||
bool m_exit_requested = false;
|
bool m_exit_requested = false;
|
||||||
bool m_fullscreen_requested = false;
|
bool m_fullscreen_requested = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user