From dcdb39026ce2bf7b2916456df31c0bba71b5ed53 Mon Sep 17 00:00:00 2001 From: KamFretoZ <14798312+kamfretoz@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:27:49 +0700 Subject: [PATCH] Qt: Use window modality for message boxes Backport from DuckStation: https://github.com/stenzek/duckstation/commit/86927ea3eb474f397ffdf7b42931259ac4bd2778 --- pcsx2-qt/AutoUpdaterDialog.cpp | 2 ++ pcsx2-qt/MainWindow.cpp | 7 +++++++ pcsx2-qt/Settings/SettingsWindow.cpp | 1 + pcsx2-qt/Translations.cpp | 1 + 4 files changed, 11 insertions(+) diff --git a/pcsx2-qt/AutoUpdaterDialog.cpp b/pcsx2-qt/AutoUpdaterDialog.cpp index c649b532c170e..9085a7262109c 100644 --- a/pcsx2-qt/AutoUpdaterDialog.cpp +++ b/pcsx2-qt/AutoUpdaterDialog.cpp @@ -455,6 +455,8 @@ void AutoUpdaterDialog::downloadUpdateClicked() { QMessageBox msgbox; msgbox.setIcon(QMessageBox::Critical); + msgbox.setWindowModality(Qt::ApplicationModal); + msgbox.setWindowIcon(QtHost::GetAppIcon()); msgbox.setWindowTitle(tr("Savestate Warning")); msgbox.setText(tr("
Installing this update will make your save states incompatible, be sure to save any progress to your memory cards before proceeding.
Do you wish to continue?
")); msgbox.addButton(QMessageBox::Yes); diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index 3f1b1cccf56cc..eddde433a7aed 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -659,6 +659,8 @@ void MainWindow::onShowAdvancedSettingsToggled(bool checked) { QCheckBox* cb = new QCheckBox(tr("Do not show again")); QMessageBox mb(this); + mb.setWindowIcon(QtHost::GetAppIcon()); + mb.setWindowModality(Qt::WindowModal); mb.setWindowTitle(tr("Show Advanced Settings")); mb.setText(tr("Changing advanced settings can have unpredictable effects on games, including graphical glitches, lock-ups, and " "even corrupted save files. " @@ -1182,6 +1184,8 @@ bool MainWindow::requestShutdown(bool allow_confirm, bool allow_save_to_state, b QMessageBox msgbox(lock.getDialogParent()); msgbox.setIcon(QMessageBox::Question); msgbox.setWindowTitle(tr("Confirm Shutdown")); + msgbox.setWindowModality(Qt::WindowModal); + msgbox.setWindowIcon(QtHost::GetAppIcon()); msgbox.setText(tr("Are you sure you want to shut down the virtual machine?")); QCheckBox* save_cb = new QCheckBox(tr("Save State For Resume"), &msgbox); @@ -1596,6 +1600,7 @@ void MainWindow::checkForUpdates(bool display_message, bool force_check) { QMessageBox mbox(this); mbox.setWindowTitle(tr("Updater Error")); + mbox.setWindowIcon(QtHost::GetAppIcon()); mbox.setTextFormat(Qt::RichText); QString message; @@ -2687,7 +2692,9 @@ std::optional