Skip to content

Commit

Permalink
Qt: Bugfixes regarding usage of ShowConfirmationBox
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Jan 30, 2020
1 parent 7958d2a commit 1176e6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions rpcs3/rpcs3qt/gs_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,21 @@ bool gs_frame::event(QEvent* ev)
toggle_fullscreen();
}

int result;
int result = QMessageBox::No;
atomic_t<bool> called = false;

Emu.CallAfter([this, &result]()
Emu.CallAfter([this, &result, &called]()
{
m_gui_settings->ShowConfirmationBox(tr("Exit Game?"),
tr("Do you really want to exit the game?\n\nAny unsaved progress will be lost!\n"),
gui::ib_confirm_exit, &result, nullptr);

called = true;
called.notify_one();
});

called.wait(false);

if (result != QMessageBox::Yes)
{
return true;
Expand Down
4 changes: 2 additions & 2 deletions rpcs3/rpcs3qt/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void main_window::Boot(const std::string& path, const std::string& title_id, boo
{
if (!Emu.IsStopped())
{
int result;
int result = QMessageBox::Yes;
guiSettings->ShowConfirmationBox(tr("Close Running Game?"),
tr("Booting another game will close the current game.\nDo you really want to boot another game?\n\nAny unsaved progress will be lost!\n"),
gui::ib_confirm_boot, &result, this);
Expand Down Expand Up @@ -1801,7 +1801,7 @@ void main_window::closeEvent(QCloseEvent* closeEvent)
{
if (!Emu.IsStopped() && guiSettings->GetValue(gui::ib_confirm_exit).toBool())
{
int result;
int result = QMessageBox::No;

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"),
Expand Down

0 comments on commit 1176e6c

Please sign in to comment.