Qt: Make more messages modal

This commit is contained in:
spycrab 2019-01-25 16:08:06 +01:00
parent 6962d5bc52
commit 787f2c6bd7
3 changed files with 27 additions and 8 deletions

View File

@ -175,6 +175,7 @@ void GeneralWidget::SaveSettings()
QMessageBox confirm_sw(this); QMessageBox confirm_sw(this);
confirm_sw.setIcon(QMessageBox::Warning); confirm_sw.setIcon(QMessageBox::Warning);
confirm_sw.setWindowModality(Qt::WindowModal);
confirm_sw.setStandardButtons(QMessageBox::Yes | QMessageBox::No); confirm_sw.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
confirm_sw.setWindowTitle(tr("Confirm backend change")); confirm_sw.setWindowTitle(tr("Confirm backend change"));
confirm_sw.setText(tr("Software rendering is an order of magnitude slower than using the " confirm_sw.setText(tr("Software rendering is an order of magnitude slower than using the "

View File

@ -424,12 +424,19 @@ void GameList::ExportWiiSave()
QString failed_str; QString failed_str;
for (const std::string& str : failed) for (const std::string& str : failed)
failed_str.append(QStringLiteral("\n")).append(QString::fromStdString(str)); failed_str.append(QStringLiteral("\n")).append(QString::fromStdString(str));
QMessageBox::critical(this, tr("Save Export"), QMessageBox msg(QMessageBox::Critical, tr("Save Export"),
tr("Failed to export the following save files:") + failed_str); tr("Failed to export the following save files:") + failed_str, QMessageBox::Ok,
this);
msg.setWindowModality(Qt::WindowModal);
msg.exec();
} }
else 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); QMessageBox wii_warning(this);
wii_warning.setIcon(QMessageBox::Warning); wii_warning.setIcon(QMessageBox::Warning);
wii_warning.setWindowModality(Qt::WindowModal);
wii_warning.setWindowTitle(tr("Confirm")); wii_warning.setWindowTitle(tr("Confirm"));
wii_warning.setText(tr("Are you sure?")); wii_warning.setText(tr("Are you sure?"));
wii_warning.setInformativeText(tr( wii_warning.setInformativeText(tr(
@ -530,6 +538,7 @@ void GameList::CompressISO(bool decompress)
{ {
QMessageBox confirm_replace(this); QMessageBox confirm_replace(this);
confirm_replace.setIcon(QMessageBox::Warning); confirm_replace.setIcon(QMessageBox::Warning);
confirm_replace.setWindowModality(Qt::WindowModal);
confirm_replace.setWindowTitle(tr("Confirm")); confirm_replace.setWindowTitle(tr("Confirm"));
confirm_replace.setText(tr("The file %1 already exists.\n" confirm_replace.setText(tr("The file %1 already exists.\n"
"Do you wish to replace it?") "Do you wish to replace it?")
@ -575,11 +584,13 @@ void GameList::CompressISO(bool decompress)
} }
} }
QMessageBox(QMessageBox::Information, tr("Success"), QMessageBox msg(QMessageBox::Information, tr("Success"),
decompress ? tr("Successfully decompressed %n image(s).", "", files.size()) : decompress ? tr("Successfully decompressed %n image(s).", "", files.size()) :
tr("Successfully compressed %n image(s).", "", files.size()), tr("Successfully compressed %n image(s).", "", files.size()),
QMessageBox::Ok, this) QMessageBox::Ok, this);
.exec();
msg.setWindowModality(Qt::WindowModal);
msg.exec();
} }
void GameList::InstallWAD() void GameList::InstallWAD()
@ -593,6 +604,7 @@ void GameList::InstallWAD()
const bool success = WiiUtils::InstallWAD(game->GetFilePath()); const bool success = WiiUtils::InstallWAD(game->GetFilePath());
result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical); result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical);
result_dialog.setWindowModality(Qt::WindowModal);
result_dialog.setWindowTitle(success ? tr("Success") : tr("Failure")); result_dialog.setWindowTitle(success ? tr("Success") : tr("Failure"));
result_dialog.setText(success ? tr("Successfully installed this title to the NAND.") : result_dialog.setText(success ? tr("Successfully installed this title to the NAND.") :
tr("Failed to install 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); QMessageBox warning_dialog(this);
warning_dialog.setIcon(QMessageBox::Information); warning_dialog.setIcon(QMessageBox::Information);
warning_dialog.setWindowModality(Qt::WindowModal);
warning_dialog.setWindowTitle(tr("Confirm")); warning_dialog.setWindowTitle(tr("Confirm"));
warning_dialog.setText(tr("Uninstalling the WAD will remove the currently installed version of " 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?")); "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()); const bool success = WiiUtils::UninstallTitle(game->GetTitleID());
result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical); result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical);
result_dialog.setWindowModality(Qt::WindowModal);
result_dialog.setWindowTitle(success ? tr("Success") : tr("Failure")); result_dialog.setWindowTitle(success ? tr("Success") : tr("Failure"));
result_dialog.setText(success ? tr("Successfully removed this title from the NAND.") : result_dialog.setText(success ? tr("Successfully removed this title from the NAND.") :
tr("Failed to remove 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); QMessageBox confirm_dialog(this);
confirm_dialog.setIcon(QMessageBox::Warning); confirm_dialog.setIcon(QMessageBox::Warning);
confirm_dialog.setWindowModality(Qt::WindowModal);
confirm_dialog.setWindowTitle(tr("Confirm")); 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.setText(tr("Are you sure you want to delete this file?"));
confirm_dialog.setInformativeText(tr("This cannot be undone!")); confirm_dialog.setInformativeText(tr("This cannot be undone!"));
confirm_dialog.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel); confirm_dialog.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
@ -687,6 +703,7 @@ void GameList::DeleteFile()
QMessageBox error_dialog(this); QMessageBox error_dialog(this);
error_dialog.setIcon(QMessageBox::Critical); error_dialog.setIcon(QMessageBox::Critical);
error_dialog.setWindowModality(Qt::WindowModal);
error_dialog.setWindowTitle(tr("Failure")); error_dialog.setWindowTitle(tr("Failure"));
error_dialog.setText(tr("Failed to delete the selected file.")); error_dialog.setText(tr("Failed to delete the selected file."));
error_dialog.setInformativeText(tr("Check whether you have the permissions required to " error_dialog.setInformativeText(tr("Check whether you have the permissions required to "

View File

@ -186,6 +186,7 @@ int main(int argc, char* argv[])
QMessageBox analytics_prompt(&win); QMessageBox analytics_prompt(&win);
analytics_prompt.setIcon(QMessageBox::Question); analytics_prompt.setIcon(QMessageBox::Question);
analytics_prompt.setWindowModality(Qt::WindowModal);
analytics_prompt.setStandardButtons(QMessageBox::Yes | QMessageBox::No); analytics_prompt.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
analytics_prompt.setWindowTitle(QObject::tr("Allow Usage Statistics Reporting")); analytics_prompt.setWindowTitle(QObject::tr("Allow Usage Statistics Reporting"));
analytics_prompt.setText( analytics_prompt.setText(