From c8f6c0f3c49b99b78bd58ec7e0bd42513327b33a Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 5 Nov 2023 00:53:57 +0100 Subject: [PATCH] Moved the CPU override warning dialog so it no longer hard freezes the emulator. --- src/qt/qt_main.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index 598025795..d025c9168 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -208,6 +208,20 @@ main(int argc, char *argv[]) return 0; } + /* Warn the user about unsupported configs */ + if (cpu_override) { + QMessageBox warningbox(QMessageBox::Icon::Warning, QObject::tr("You are loading an unsupported configuration"), + QObject::tr("CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid."), + QMessageBox::NoButton, main_window); + warningbox.addButton(QObject::tr("Continue"), QMessageBox::AcceptRole); + warningbox.addButton(QObject::tr("Exit"), QMessageBox::RejectRole); + warningbox.exec(); + if (warningbox.result() == QDialog::Accepted) { + confirm_exit_cmdl = 0; /* skip the confirmation prompt without touching the config */ + emit main_window->close(); + } + } + #ifdef DISCORD discord_load(); #endif @@ -279,20 +293,6 @@ main(int argc, char *argv[]) socket.connectToServer(qgetenv("86BOX_MANAGER_SOCKET")); } - /* Warn the user about unsupported configs */ - if (cpu_override) { - QMessageBox warningbox(QMessageBox::Icon::Warning, QObject::tr("You are loading an unsupported configuration"), - QObject::tr("CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid."), - QMessageBox::NoButton, main_window); - warningbox.addButton(QObject::tr("Continue"), QMessageBox::AcceptRole); - warningbox.addButton(QObject::tr("Exit"), QMessageBox::RejectRole); - warningbox.exec(); - if (warningbox.result() == QDialog::Accepted) { - confirm_exit_cmdl = 0; /* skip the confirmation prompt without touching the config */ - emit main_window->close(); - } - } - // pc_reset_hard_init(); /* Set the PAUSE mode depending on the renderer. */