summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/MenuBar.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2018-05-13 13:18:19 +0200
committerLéo Lam <leo@innovatetechnologi.es>2018-05-13 17:42:55 +0200
commita93d816c283de6972e3994a7e89f3c423f6afef6 (patch)
tree233186a9a4f49695200e045471cbc44c472febd8 /Source/Core/DolphinQt2/MenuBar.cpp
parent41c4486c653049464794d7831d479e91c26dd6c2 (diff)
WiiSave: Move dialogs to UI code
This moves the result dialogs to DolphinQt2, since WiiSave should not really be responsible for interacting with the user as a simple Wii save importing/exporting class. This also fixes Wii save import/export showing result dialogs twice, once from WiiSave, and another time from DolphinQt2.
Diffstat (limited to 'Source/Core/DolphinQt2/MenuBar.cpp')
-rw-r--r--Source/Core/DolphinQt2/MenuBar.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt2/MenuBar.cpp b/Source/Core/DolphinQt2/MenuBar.cpp
index adadc6301a..61df3f967c 100644
--- a/Source/Core/DolphinQt2/MenuBar.cpp
+++ b/Source/Core/DolphinQt2/MenuBar.cpp
@@ -896,13 +896,21 @@ void MenuBar::ImportWiiSave()
tr("Wii save files (*.bin);;"
"All Files (*)"));
- if (!file.isEmpty())
- WiiSave::Import(file.toStdString());
+ if (file.isEmpty())
+ return;
+
+ if (WiiSave::Import(file.toStdString()))
+ QMessageBox::information(this, tr("Save Import"), tr("Successfully imported save files."));
+ else
+ QMessageBox::critical(this, tr("Save Import"), tr("Failed to import save files."));
}
void MenuBar::ExportWiiSaves()
{
- WiiSave::ExportAll();
+ const std::pair<size_t, std::string> result = WiiSave::ExportAll();
+ QMessageBox::information(this, tr("Save Export"),
+ tr("Exported %n save(s) to %1", "", static_cast<int>(result.first))
+ .arg(QString::fromStdString(result.second)));
}
void MenuBar::CheckNAND()