citra-emu
/
citra-canary
Archived
1
0
Fork 0

Merge pull request #4338 from FearlessTobi/port-1490

Port yuzu-emu/yuzu#1490: "citra_qt/main: Simplify OnMenuLoadFile()"
This commit is contained in:
Weiyi Wang 2018-10-20 10:09:41 -04:00 committed by GitHub
commit eadd8b91b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 12 deletions

View File

@ -1017,20 +1017,20 @@ void GMainWindow::OnGameListShowList(bool show) {
};
void GMainWindow::OnMenuLoadFile() {
QString extensions;
for (const auto& piece : game_list->supported_file_extensions)
extensions += "*." + piece + " ";
const QString extensions =
QString("*.").append(GameList::supported_file_extensions.join(" *."));
const QString file_filter = tr("3DS Executable (%1);;All Files (*.*)",
"%1 is an identifier for the 3DS executable file extensions.")
.arg(extensions);
const QString filename = QFileDialog::getOpenFileName(
this, tr("Load File"), UISettings::values.roms_path, file_filter);
QString file_filter = tr("3DS Executable") + " (" + extensions + ")";
file_filter += ";;" + tr("All Files (*.*)");
QString filename = QFileDialog::getOpenFileName(this, tr("Load File"),
UISettings::values.roms_path, file_filter);
if (!filename.isEmpty()) {
UISettings::values.roms_path = QFileInfo(filename).path();
BootGame(filename);
if (filename.isEmpty()) {
return;
}
UISettings::values.roms_path = QFileInfo(filename).path();
BootGame(filename);
}
void GMainWindow::OnMenuInstallCIA() {