diff --git a/Source/Core/DolphinQt/Config/ControllersWindow.cpp b/Source/Core/DolphinQt/Config/ControllersWindow.cpp index 8570b6ff18..fbedd80b03 100644 --- a/Source/Core/DolphinQt/Config/ControllersWindow.cpp +++ b/Source/Core/DolphinQt/Config/ControllersWindow.cpp @@ -330,6 +330,7 @@ void ControllersWindow::OnBluetoothPassthroughResetPressed() { QMessageBox error(this); error.setIcon(QMessageBox::Warning); + error.setWindowModality(Qt::WindowModal); error.setWindowTitle(tr("Warning")); error.setText(tr("Saved Wii Remote pairings can only be reset when a Wii game is running.")); error.exec(); @@ -351,6 +352,7 @@ void ControllersWindow::OnBluetoothPassthroughSyncPressed() { QMessageBox error(this); error.setIcon(QMessageBox::Warning); + error.setWindowModality(Qt::WindowModal); error.setWindowTitle(tr("Warning")); error.setText(tr("A sync can only be triggered when a Wii game is running.")); error.exec(); diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingWindow.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingWindow.cpp index c1a5a034ee..549122d0db 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingWindow.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingWindow.cpp @@ -161,6 +161,7 @@ void MappingWindow::OnDeleteProfilePressed() { QMessageBox error(this); error.setIcon(QMessageBox::Critical); + error.setWindowModality(Qt::WindowModal); error.setWindowTitle(tr("Error")); error.setText(tr("The profile '%1' does not exist").arg(profile_name)); error.exec(); @@ -170,6 +171,7 @@ void MappingWindow::OnDeleteProfilePressed() QMessageBox confirm(this); confirm.setIcon(QMessageBox::Warning); + confirm.setWindowModality(Qt::WindowModal); confirm.setWindowTitle(tr("Confirm")); confirm.setText(tr("Are you sure that you want to delete '%1'?").arg(profile_name)); confirm.setInformativeText(tr("This cannot be undone!")); @@ -186,6 +188,7 @@ void MappingWindow::OnDeleteProfilePressed() QMessageBox result(this); result.setIcon(QMessageBox::Information); + result.setWindowModality(Qt::WindowModal); result.setWindowTitle(tr("Success")); result.setText(tr("Successfully deleted '%1'.").arg(profile_name)); } diff --git a/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp b/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp index dec1c34be4..9f4d8e281c 100644 --- a/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp +++ b/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp @@ -204,7 +204,12 @@ void FIFOPlayerWindow::SaveRecording() bool result = file->Save(path.toStdString()); if (!result) - QMessageBox::critical(this, tr("Error"), tr("Failed to save FIFO log.")); + { + QMessageBox msg(QMessageBox::Critical, tr("Error"), tr("Failed to save FIFO log."), + QMessageBox::Ok, this); + msg.setWindowModality(Qt::WindowModal); + msg.exec(); + } } void FIFOPlayerWindow::StartRecording() diff --git a/Source/Core/DolphinQt/GCMemcardManager.cpp b/Source/Core/DolphinQt/GCMemcardManager.cpp index a74a5dc01e..a130e4c333 100644 --- a/Source/Core/DolphinQt/GCMemcardManager.cpp +++ b/Source/Core/DolphinQt/GCMemcardManager.cpp @@ -306,7 +306,10 @@ void GCMemcardManager::ExportFiles(bool prompt) QString text = count == 1 ? tr("Successfully exported the save file.") : tr("Successfully exported the %1 save files.").arg(count); - QMessageBox::information(this, tr("Success"), text); + QMessageBox msg(QMessageBox::Information, tr("Success"), text, QMessageBox::Ok, this); + msg.setWindowModality(Qt::WindowModal); + + msg.exec(); } void GCMemcardManager::ExportAllFiles() @@ -330,7 +333,10 @@ void GCMemcardManager::ImportFile() if (result != SUCCESS) { - QMessageBox::critical(this, tr("Import failed"), tr("Failed to import \"%1\".").arg(path)); + QMessageBox msg(QMessageBox::Critical, tr("Import failed"), + tr("Failed to import \"%1\".").arg(path), QMessageBox::Ok, this); + msg.setWindowModality(Qt::WindowModal); + msg.exec(); return; } @@ -355,7 +361,12 @@ void GCMemcardManager::CopyFiles() const auto result = m_slot_memcard[!m_active_slot]->CopyFrom(*memcard, file_index); if (result != SUCCESS) - QMessageBox::warning(this, tr("Copy failed"), tr("Failed to copy file")); + { + QMessageBox msg(QMessageBox::Warning, tr("Copy failed"), tr("Failed to copy file"), + QMessageBox::Ok, this); + msg.setWindowModality(Qt::WindowModal); + msg.exec(); + } } for (int i = 0; i < SLOT_COUNT; i++) @@ -379,8 +390,12 @@ void GCMemcardManager::DeleteFiles() { QString text = count == 1 ? tr("Do you want to delete the selected save file?") : tr("Do you want to delete the %1 selected save files?").arg(count); - auto response = - QMessageBox::warning(this, tr("Question"), text, QMessageBox::Yes | QMessageBox::Abort); + + QMessageBox msg(QMessageBox::Warning, tr("Question"), text, + QMessageBox::Yes | QMessageBox::Abort, this); + msg.setWindowModality(Qt::WindowModal); + + auto response = msg.exec(); if (response == QMessageBox::Abort) return; @@ -396,13 +411,25 @@ void GCMemcardManager::DeleteFiles() for (int file_index : file_indices) { if (memcard->RemoveFile(file_index) != SUCCESS) - QMessageBox::warning(this, tr("Remove failed"), tr("Failed to remove file")); + { + QMessageBox msg(QMessageBox::Warning, tr("Remove failed"), tr("Failed to remove file"), + QMessageBox::Ok, this); + msg.setWindowModality(Qt::WindowModal); + msg.exec(); + } } if (!memcard->Save()) + { PanicAlertT("File write failed"); + } else - QMessageBox::information(this, tr("Success"), tr("Successfully deleted files.")); + { + QMessageBox msg(QMessageBox::Information, tr("Success"), tr("Successfully deleted files."), + QMessageBox::Ok, this); + msg.setWindowModality(Qt::WindowModal); + msg.exec(); + } UpdateSlotTable(m_active_slot); UpdateActions(); diff --git a/Source/Core/DolphinQt/Settings/GeneralPane.cpp b/Source/Core/DolphinQt/Settings/GeneralPane.cpp index 78ec034fb3..f2af4c84c5 100644 --- a/Source/Core/DolphinQt/Settings/GeneralPane.cpp +++ b/Source/Core/DolphinQt/Settings/GeneralPane.cpp @@ -324,6 +324,7 @@ void GeneralPane::GenerateNewIdentity() DolphinAnalytics::Instance()->ReloadConfig(); QMessageBox message_box(this); message_box.setIcon(QMessageBox::Information); + message_box.setWindowModality(Qt::WindowModal); message_box.setWindowTitle(tr("Identity Generation")); message_box.setText(tr("New identity generated.")); message_box.exec(); diff --git a/Source/Core/DolphinQt/Settings/InterfacePane.cpp b/Source/Core/DolphinQt/Settings/InterfacePane.cpp index ad808e9f08..747f185bbe 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.cpp +++ b/Source/Core/DolphinQt/Settings/InterfacePane.cpp @@ -269,9 +269,12 @@ void InterfacePane::OnSaveConfig() if (new_language != SConfig::GetInstance().m_InterfaceLanguage) { SConfig::GetInstance().m_InterfaceLanguage = new_language; - QMessageBox::information( - this, tr("Restart Required"), - tr("You must restart Dolphin in order for the change to take effect.")); + QMessageBox msg(QMessageBox::Information, tr("Restart Required"), + tr("You must restart Dolphin in order for the change to take effect."), + QMessageBox::Ok, this); + + msg.setWindowModality(Qt::WindowModal); + msg.exec(); } const bool use_covers = m_checkbox_use_covers->isChecked(); diff --git a/Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp b/Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp index 5f055fec69..05811bc34b 100644 --- a/Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp +++ b/Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp @@ -131,6 +131,7 @@ void USBDeviceAddToWhitelistDialog::AddUSBDeviceToWhitelist() // i18n: Here, VID means Vendor ID (for a USB device). QMessageBox vid_warning_box(this); vid_warning_box.setIcon(QMessageBox::Warning); + vid_warning_box.setWindowModality(Qt::WindowModal); vid_warning_box.setWindowTitle(tr("USB Whitelist Error")); // i18n: Here, VID means Vendor ID (for a USB device). vid_warning_box.setText(tr("The entered VID is invalid.")); @@ -143,6 +144,7 @@ void USBDeviceAddToWhitelistDialog::AddUSBDeviceToWhitelist() // i18n: Here, PID means Product ID (for a USB device). QMessageBox pid_warning_box(this); pid_warning_box.setIcon(QMessageBox::Warning); + pid_warning_box.setWindowModality(Qt::WindowModal); pid_warning_box.setWindowTitle(tr("USB Whitelist Error")); // i18n: Here, PID means Product ID (for a USB device). pid_warning_box.setText(tr("The entered PID is invalid.")); @@ -156,8 +158,12 @@ void USBDeviceAddToWhitelistDialog::AddUSBDeviceToWhitelist() if (SConfig::GetInstance().IsUSBDeviceWhitelisted({vid, pid})) { - QErrorMessage* error = new QErrorMessage(); - error->showMessage(tr("This USB device is already whitelisted.")); + QMessageBox error_box(this); + error_box.setIcon(QMessageBox::Warning); + error_box.setWindowModality(Qt::WindowModal); + error_box.setWindowTitle(tr("USB Whitelist Error")); + error_box.setText(tr("This USB device is already whitelisted.")); + error_box.exec(); return; } SConfig::GetInstance().m_usb_passthrough_devices.emplace(vid, pid);