From 787f2c6bd7f247c47130f94421d87758ed1e931b Mon Sep 17 00:00:00 2001 From: spycrab Date: Fri, 25 Jan 2019 16:08:06 +0100 Subject: [PATCH] Qt: Make more messages modal --- .../Config/Graphics/GeneralWidget.cpp | 1 + Source/Core/DolphinQt/GameList/GameList.cpp | 33 ++++++++++++++----- Source/Core/DolphinQt/Main.cpp | 1 + 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp index b8ba245256..47cd1949db 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp @@ -175,6 +175,7 @@ void GeneralWidget::SaveSettings() QMessageBox confirm_sw(this); confirm_sw.setIcon(QMessageBox::Warning); + confirm_sw.setWindowModality(Qt::WindowModal); confirm_sw.setStandardButtons(QMessageBox::Yes | QMessageBox::No); confirm_sw.setWindowTitle(tr("Confirm backend change")); confirm_sw.setText(tr("Software rendering is an order of magnitude slower than using the " diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp index 3b51cefb89..f7dac83353 100644 --- a/Source/Core/DolphinQt/GameList/GameList.cpp +++ b/Source/Core/DolphinQt/GameList/GameList.cpp @@ -424,12 +424,19 @@ void GameList::ExportWiiSave() QString failed_str; for (const std::string& str : failed) failed_str.append(QStringLiteral("\n")).append(QString::fromStdString(str)); - QMessageBox::critical(this, tr("Save Export"), - tr("Failed to export the following save files:") + failed_str); + QMessageBox msg(QMessageBox::Critical, tr("Save Export"), + tr("Failed to export the following save files:") + failed_str, QMessageBox::Ok, + this); + + msg.setWindowModality(Qt::WindowModal); + msg.exec(); } else { - QMessageBox::information(this, tr("Save Export"), tr("Successfully exported save files")); + QMessageBox msg(QMessageBox::Information, tr("Save Export"), + tr("Successfully exported save files"), QMessageBox::Ok, this); + msg.setWindowModality(Qt::WindowModal); + msg.exec(); } } @@ -470,6 +477,7 @@ void GameList::CompressISO(bool decompress) { QMessageBox wii_warning(this); wii_warning.setIcon(QMessageBox::Warning); + wii_warning.setWindowModality(Qt::WindowModal); wii_warning.setWindowTitle(tr("Confirm")); wii_warning.setText(tr("Are you sure?")); wii_warning.setInformativeText(tr( @@ -530,6 +538,7 @@ void GameList::CompressISO(bool decompress) { QMessageBox confirm_replace(this); confirm_replace.setIcon(QMessageBox::Warning); + confirm_replace.setWindowModality(Qt::WindowModal); confirm_replace.setWindowTitle(tr("Confirm")); confirm_replace.setText(tr("The file %1 already exists.\n" "Do you wish to replace it?") @@ -575,11 +584,13 @@ void GameList::CompressISO(bool decompress) } } - QMessageBox(QMessageBox::Information, tr("Success"), - decompress ? tr("Successfully decompressed %n image(s).", "", files.size()) : - tr("Successfully compressed %n image(s).", "", files.size()), - QMessageBox::Ok, this) - .exec(); + QMessageBox msg(QMessageBox::Information, tr("Success"), + decompress ? tr("Successfully decompressed %n image(s).", "", files.size()) : + tr("Successfully compressed %n image(s).", "", files.size()), + QMessageBox::Ok, this); + + msg.setWindowModality(Qt::WindowModal); + msg.exec(); } void GameList::InstallWAD() @@ -593,6 +604,7 @@ void GameList::InstallWAD() const bool success = WiiUtils::InstallWAD(game->GetFilePath()); result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical); + result_dialog.setWindowModality(Qt::WindowModal); result_dialog.setWindowTitle(success ? tr("Success") : tr("Failure")); result_dialog.setText(success ? tr("Successfully installed this title to the NAND.") : tr("Failed to install this title to the NAND.")); @@ -608,6 +620,7 @@ void GameList::UninstallWAD() QMessageBox warning_dialog(this); warning_dialog.setIcon(QMessageBox::Information); + warning_dialog.setWindowModality(Qt::WindowModal); warning_dialog.setWindowTitle(tr("Confirm")); warning_dialog.setText(tr("Uninstalling the WAD will remove the currently installed version of " "this title from the NAND without deleting its save data. Continue?")); @@ -621,6 +634,7 @@ void GameList::UninstallWAD() const bool success = WiiUtils::UninstallTitle(game->GetTitleID()); result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical); + result_dialog.setWindowModality(Qt::WindowModal); result_dialog.setWindowTitle(success ? tr("Success") : tr("Failure")); result_dialog.setText(success ? tr("Successfully removed this title from the NAND.") : tr("Failed to remove this title from the NAND.")); @@ -663,7 +677,9 @@ void GameList::DeleteFile() QMessageBox confirm_dialog(this); confirm_dialog.setIcon(QMessageBox::Warning); + confirm_dialog.setWindowModality(Qt::WindowModal); confirm_dialog.setWindowTitle(tr("Confirm")); + confirm_dialog.setWindowModality(Qt::WindowModal); confirm_dialog.setText(tr("Are you sure you want to delete this file?")); confirm_dialog.setInformativeText(tr("This cannot be undone!")); confirm_dialog.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel); @@ -687,6 +703,7 @@ void GameList::DeleteFile() QMessageBox error_dialog(this); error_dialog.setIcon(QMessageBox::Critical); + error_dialog.setWindowModality(Qt::WindowModal); error_dialog.setWindowTitle(tr("Failure")); error_dialog.setText(tr("Failed to delete the selected file.")); error_dialog.setInformativeText(tr("Check whether you have the permissions required to " diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp index 5ca745e874..96379c2476 100644 --- a/Source/Core/DolphinQt/Main.cpp +++ b/Source/Core/DolphinQt/Main.cpp @@ -186,6 +186,7 @@ int main(int argc, char* argv[]) QMessageBox analytics_prompt(&win); analytics_prompt.setIcon(QMessageBox::Question); + analytics_prompt.setWindowModality(Qt::WindowModal); analytics_prompt.setStandardButtons(QMessageBox::Yes | QMessageBox::No); analytics_prompt.setWindowTitle(QObject::tr("Allow Usage Statistics Reporting")); analytics_prompt.setText(