mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Merge pull request #6988 from leoetlino/wii-save-refactor
WiiSave: Refactor the import/export code
This commit is contained in:
@ -958,9 +958,18 @@ void MenuBar::ImportWiiSave()
|
||||
if (file.isEmpty())
|
||||
return;
|
||||
|
||||
if (WiiSave::Import(file.toStdString()))
|
||||
bool cancelled = false;
|
||||
auto can_overwrite = [&] {
|
||||
bool yes = QMessageBox::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;
|
||||
};
|
||||
if (WiiSave::Import(file.toStdString(), can_overwrite))
|
||||
QMessageBox::information(this, tr("Save Import"), tr("Successfully imported save files."));
|
||||
else
|
||||
else if (!cancelled)
|
||||
QMessageBox::critical(this, tr("Save Import"), tr("Failed to import save files."));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user