summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/MenuBar.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-01-05 15:36:36 +0100
committerGitHub <noreply@github.com>2021-01-05 15:36:36 +0100
commit840ecfb32f0ff7e625de7bb1fa98c6259efb4640 (patch)
treece4ec9b02547f796b7673336b31edcf67cb145c1 /Source/Core/DolphinQt/MenuBar.cpp
parente48377dfc69542e471f8b449aa0a4698607f5afa (diff)
parent2932b5f8cdaad063ccc869dfd7ce58891471b3a2 (diff)
Merge pull request #9409 from AdmiralCurtiss/wii-save-import-tmd
Make WiiSave::Import() behave closer to the Wii System Menu's SD Card save copying.
Diffstat (limited to 'Source/Core/DolphinQt/MenuBar.cpp')
-rw-r--r--Source/Core/DolphinQt/MenuBar.cpp42
1 files changed, 31 insertions, 11 deletions
diff --git a/Source/Core/DolphinQt/MenuBar.cpp b/Source/Core/DolphinQt/MenuBar.cpp
index 3869fcf8e5..b1f6d40169 100644
--- a/Source/Core/DolphinQt/MenuBar.cpp
+++ b/Source/Core/DolphinQt/MenuBar.cpp
@@ -1066,19 +1066,39 @@ void MenuBar::ImportWiiSave()
if (file.isEmpty())
return;
- bool cancelled = false;
auto can_overwrite = [&] {
- bool yes = ModalMessageBox::question(
- this, tr("Save Import"),
- tr("Save data for this title already exists in the NAND. Consider backing up "
- "the current data before overwriting.\nOverwrite now?")) == QMessageBox::Yes;
- cancelled = !yes;
- return yes;
+ return ModalMessageBox::question(
+ this, tr("Save Import"),
+ tr("Save data for this title already exists in the NAND. Consider backing up "
+ "the current data before overwriting.\nOverwrite now?")) == QMessageBox::Yes;
};
- if (WiiSave::Import(file.toStdString(), can_overwrite))
- ModalMessageBox::information(this, tr("Save Import"), tr("Successfully imported save files."));
- else if (!cancelled)
- ModalMessageBox::critical(this, tr("Save Import"), tr("Failed to import save files."));
+
+ const auto result = WiiSave::Import(file.toStdString(), can_overwrite);
+ switch (result)
+ {
+ case WiiSave::CopyResult::Success:
+ ModalMessageBox::information(this, tr("Save Import"), tr("Successfully imported save file."));
+ break;
+ case WiiSave::CopyResult::CorruptedSource:
+ ModalMessageBox::critical(this, tr("Save Import"),
+ tr("Failed to import save file. The given file appears to be "
+ "corrupted or is not a valid Wii save."));
+ break;
+ case WiiSave::CopyResult::TitleMissing:
+ ModalMessageBox::critical(
+ this, tr("Save Import"),
+ tr("Failed to import save file. Please launch the game once, then try again."));
+ break;
+ case WiiSave::CopyResult::Cancelled:
+ break;
+ default:
+ ModalMessageBox::critical(
+ this, tr("Save Import"),
+ tr("Failed to import save file. Your NAND may be corrupt, or something is preventing "
+ "access to files within it. Try repairing your NAND (Tools -> Manage NAND -> Check "
+ "NAND...), then import the save again."));
+ break;
+ }
}
void MenuBar::ExportWiiSaves()