summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2019-03-03 16:36:58 +0100
committerspycrab <spycrab@users.noreply.github.com>2019-03-03 16:36:58 +0100
commit0d203cf0bb6e192bc786f5780f2b0468404c529b (patch)
treea09ec50432f3a33576b4e75c173c15b412731a30 /Source
parent326e2fb300174ebaa20d8eb09690f1daffb9d42a (diff)
Qt/GCMemcardManager: Make message boxes modal
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/GCMemcardManager.cpp41
1 files changed, 34 insertions, 7 deletions
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();