1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2025-01-31 20:41:45 +01:00

Qt: also spawn exit game dialog if rpcs3 is closed (e.g. by accident)

This commit is contained in:
Megamouse 2019-04-02 00:55:46 +02:00
parent cb5dd1353b
commit 467ef2afca

View File

@ -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();