aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPk11 <epicpkmn11@outlook.com>2022-11-07 09:03:00 -0600
committerGitHub <noreply@github.com>2022-11-07 16:03:00 +0100
commit31a0d7ecd29bc5d3c83713f92a650b11f7dec8c4 (patch)
tree8eef0b37b4c615bc54d9b2eeca0cd98b238b0aac
parentca19ea1ce8535428d7cc969302c61bfda735c353 (diff)
Allow import/export of .pub/.prv/.bnr saves (#1558)
-rw-r--r--src/frontend/qt_sdl/TitleManagerDialog.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/frontend/qt_sdl/TitleManagerDialog.cpp b/src/frontend/qt_sdl/TitleManagerDialog.cpp
index 8087ee6..7b54313 100644
--- a/src/frontend/qt_sdl/TitleManagerDialog.cpp
+++ b/src/frontend/qt_sdl/TitleManagerDialog.cpp
@@ -266,12 +266,22 @@ void TitleManagerDialog::onImportTitleData()
return;
}
+ QString extensions = "*.sav";
u32 wantedsize;
switch (type)
{
- case DSi_NAND::TitleData_PublicSav: wantedsize = cur->data(Qt::UserRole+1).toUInt(); break;
- case DSi_NAND::TitleData_PrivateSav: wantedsize = cur->data(Qt::UserRole+2).toUInt(); break;
- case DSi_NAND::TitleData_BannerSav: wantedsize = cur->data(Qt::UserRole+3).toUInt(); break;
+ case DSi_NAND::TitleData_PublicSav:
+ extensions += " *.pub";
+ wantedsize = cur->data(Qt::UserRole+1).toUInt();
+ break;
+ case DSi_NAND::TitleData_PrivateSav:
+ extensions += " *.prv";
+ wantedsize = cur->data(Qt::UserRole+2).toUInt();
+ break;
+ case DSi_NAND::TitleData_BannerSav:
+ extensions += " *.bnr";
+ wantedsize = cur->data(Qt::UserRole+3).toUInt();
+ break;
default:
printf("what??\n");
return;
@@ -280,7 +290,7 @@ void TitleManagerDialog::onImportTitleData()
QString file = QFileDialog::getOpenFileName(this,
"Select file to import...",
QString::fromStdString(EmuDirectory),
- "Title data files (*.sav);;Any file (*.*)");
+ "Title data files (" + extensions + ");;Any file (*.*)");
if (file.isEmpty()) return;
@@ -327,19 +337,23 @@ void TitleManagerDialog::onExportTitleData()
}
QString exportname;
+ QString extensions = "*.sav";
u32 wantedsize;
switch (type)
{
case DSi_NAND::TitleData_PublicSav:
exportname = "/public.sav";
+ extensions += " *.pub";
wantedsize = cur->data(Qt::UserRole+1).toUInt();
break;
case DSi_NAND::TitleData_PrivateSav:
exportname = "/private.sav";
+ extensions += " *.prv";
wantedsize = cur->data(Qt::UserRole+2).toUInt();
break;
case DSi_NAND::TitleData_BannerSav:
exportname = "/banner.sav";
+ extensions += " *.bnr";
wantedsize = cur->data(Qt::UserRole+3).toUInt();
break;
default:
@@ -350,7 +364,7 @@ void TitleManagerDialog::onExportTitleData()
QString file = QFileDialog::getSaveFileName(this,
"Select path to export to...",
QString::fromStdString(EmuDirectory) + exportname,
- "Title data files (*.sav);;Any file (*.*)");
+ "Title data files (" + extensions + ");;Any file (*.*)");
if (file.isEmpty()) return;