diff options
| author | 2018-10-14 14:44:49 -0400 | |
|---|---|---|
| committer | 2018-10-14 14:44:49 -0400 | |
| commit | 3203193a673f65d093a6ace18a034e1add4d8828 (patch) | |
| tree | e6d6ea028ee8d07bc8e864d8b3732d17ea381d44 /src | |
| parent | Merge pull request #1488 from Hexagon12/astc-types (diff) | |
| parent | yuzu/main: Simplify OnMenuLoadFile() (diff) | |
| download | yuzu-3203193a673f65d093a6ace18a034e1add4d8828.tar.gz yuzu-3203193a673f65d093a6ace18a034e1add4d8828.tar.xz yuzu-3203193a673f65d093a6ace18a034e1add4d8828.zip | |
Merge pull request #1490 from lioncash/boot
yuzu/main: Simplify OnMenuLoadFile()
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index beb57ea5d..cc92ea5b8 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -908,22 +908,20 @@ void GMainWindow::OnGameListNavigateToGamedbEntry(u64 program_id, | |||
| 908 | } | 908 | } |
| 909 | 909 | ||
| 910 | void GMainWindow::OnMenuLoadFile() { | 910 | void GMainWindow::OnMenuLoadFile() { |
| 911 | QString extensions; | 911 | const QString extensions = |
| 912 | for (const auto& piece : game_list->supported_file_extensions) | 912 | QString("*.").append(GameList::supported_file_extensions.join(" *.")).append(" main"); |
| 913 | extensions += "*." + piece + " "; | 913 | const QString file_filter = tr("Switch Executable (%1);;All Files (*.*)", |
| 914 | "%1 is an identifier for the Switch executable file extensions.") | ||
| 915 | .arg(extensions); | ||
| 916 | const QString filename = QFileDialog::getOpenFileName( | ||
| 917 | this, tr("Load File"), UISettings::values.roms_path, file_filter); | ||
| 914 | 918 | ||
| 915 | extensions += "main "; | 919 | if (filename.isEmpty()) { |
| 916 | 920 | return; | |
| 917 | QString file_filter = tr("Switch Executable") + " (" + extensions + ")"; | ||
| 918 | file_filter += ";;" + tr("All Files (*.*)"); | ||
| 919 | |||
| 920 | QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), | ||
| 921 | UISettings::values.roms_path, file_filter); | ||
| 922 | if (!filename.isEmpty()) { | ||
| 923 | UISettings::values.roms_path = QFileInfo(filename).path(); | ||
| 924 | |||
| 925 | BootGame(filename); | ||
| 926 | } | 921 | } |
| 922 | |||
| 923 | UISettings::values.roms_path = QFileInfo(filename).path(); | ||
| 924 | BootGame(filename); | ||
| 927 | } | 925 | } |
| 928 | 926 | ||
| 929 | void GMainWindow::OnMenuLoadFolder() { | 927 | void GMainWindow::OnMenuLoadFolder() { |