mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06:00
Merge pull request #6836 from leoetlino/wii-save-cleanup
WiiSave: (not so) Minor cleanup
This commit is contained in:
@ -20,7 +20,7 @@
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/DVD/DVDInterface.h"
|
||||
#include "Core/HW/WiiSaveCrypted.h"
|
||||
#include "Core/HW/WiiSave.h"
|
||||
#include "Core/WiiUtils.h"
|
||||
#include "DiscIO/Blob.h"
|
||||
#include "DiscIO/Enums.h"
|
||||
@ -258,14 +258,16 @@ void GameList::OpenProperties()
|
||||
|
||||
void GameList::ExportWiiSave()
|
||||
{
|
||||
QMessageBox result_dialog(this);
|
||||
const QString export_dir = QFileDialog::getExistingDirectory(
|
||||
this, tr("Select Export Directory"), QString::fromStdString(File::GetUserPath(D_USER_IDX)),
|
||||
QFileDialog::ShowDirsOnly);
|
||||
if (export_dir.isEmpty())
|
||||
return;
|
||||
|
||||
const bool success = CWiiSaveCrypted::ExportWiiSave(GetSelectedGame()->GetTitleID());
|
||||
|
||||
result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical);
|
||||
result_dialog.setText(success ? tr("Successfully exported save files") :
|
||||
tr("Failed to export save files!"));
|
||||
result_dialog.exec();
|
||||
if (WiiSave::Export(GetSelectedGame()->GetTitleID(), export_dir.toStdString()))
|
||||
QMessageBox::information(this, tr("Save Export"), tr("Successfully exported save files"));
|
||||
else
|
||||
QMessageBox::critical(this, tr("Save Export"), tr("Failed to export save files."));
|
||||
}
|
||||
|
||||
void GameList::OpenWiki()
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "Core/Core.h"
|
||||
#include "Core/Debugger/RSO.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
#include "Core/HW/WiiSaveCrypted.h"
|
||||
#include "Core/HW/WiiSave.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/IOS/ES/ES.h"
|
||||
@ -896,13 +896,26 @@ void MenuBar::ImportWiiSave()
|
||||
tr("Wii save files (*.bin);;"
|
||||
"All Files (*)"));
|
||||
|
||||
if (!file.isEmpty())
|
||||
CWiiSaveCrypted::ImportWiiSave(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()
|
||||
{
|
||||
CWiiSaveCrypted::ExportAllSaves();
|
||||
const QString export_dir = QFileDialog::getExistingDirectory(
|
||||
this, tr("Select Export Directory"), QString::fromStdString(File::GetUserPath(D_USER_IDX)),
|
||||
QFileDialog::ShowDirsOnly);
|
||||
if (export_dir.isEmpty())
|
||||
return;
|
||||
|
||||
const size_t count = WiiSave::ExportAll(export_dir.toStdString());
|
||||
QMessageBox::information(this, tr("Save Export"),
|
||||
tr("Exported %n save(s)", "", static_cast<int>(count)));
|
||||
}
|
||||
|
||||
void MenuBar::CheckNAND()
|
||||
|
Reference in New Issue
Block a user