WiiSave: Allow users to specify export directory

Export and ExportAll now open a directory picker (that defaults to the
previous default directory, i.e. the Dolphin user dir).

Also removes the need to return the path in the export functions since
the user knows which path they chose.
This commit is contained in:
Léo Lam
2018-05-13 15:34:30 +02:00
parent 87e5cd73dc
commit 80b3d7ccb8
6 changed files with 35 additions and 35 deletions

View File

@ -907,10 +907,15 @@ void MenuBar::ImportWiiSave()
void MenuBar::ExportWiiSaves()
{
const std::pair<size_t, std::string> result = WiiSave::ExportAll();
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) to %1", "", static_cast<int>(result.first))
.arg(QString::fromStdString(result.second)));
tr("Exported %n save(s)", "", static_cast<int>(count)));
}
void MenuBar::CheckNAND()