diff options
| author | 2018-09-01 14:49:18 -0400 | |
|---|---|---|
| committer | 2018-09-03 19:23:33 -0400 | |
| commit | 1ff3318458e15e68b5a5946c8d395d625692637a (patch) | |
| tree | eff76a9fe7e763ab3324b118af5ddd07f4f66eeb /src | |
| parent | settings: Save and load NAND/SD dirs from config (diff) | |
| download | yuzu-1ff3318458e15e68b5a5946c8d395d625692637a.tar.gz yuzu-1ff3318458e15e68b5a5946c8d395d625692637a.tar.xz yuzu-1ff3318458e15e68b5a5946c8d395d625692637a.zip | |
qt: Add UI options to change NAND/SD dirs
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 14 | ||||
| -rw-r--r-- | src/yuzu/main.h | 3 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 19 |
3 files changed, 36 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index cfc48a416..01a5d2552 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -372,6 +372,10 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 372 | &GMainWindow::OnMenuInstallToNAND); | 372 | &GMainWindow::OnMenuInstallToNAND); |
| 373 | connect(ui.action_Select_Game_List_Root, &QAction::triggered, this, | 373 | connect(ui.action_Select_Game_List_Root, &QAction::triggered, this, |
| 374 | &GMainWindow::OnMenuSelectGameListRoot); | 374 | &GMainWindow::OnMenuSelectGameListRoot); |
| 375 | connect(ui.action_Select_NAND_Directory, &QAction::triggered, this, | ||
| 376 | [this] { OnMenuSelectEmulatedDirectory(false); }); | ||
| 377 | connect(ui.action_Select_SDMC_Directory, &QAction::triggered, this, | ||
| 378 | [this] { OnMenuSelectEmulatedDirectory(true); }); | ||
| 375 | connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); | 379 | connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); |
| 376 | 380 | ||
| 377 | // Emulation | 381 | // Emulation |
| @@ -887,6 +891,16 @@ void GMainWindow::OnMenuSelectGameListRoot() { | |||
| 887 | } | 891 | } |
| 888 | } | 892 | } |
| 889 | 893 | ||
| 894 | void GMainWindow::OnMenuSelectEmulatedDirectory(bool is_sdmc) { | ||
| 895 | QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); | ||
| 896 | if (!dir_path.isEmpty()) { | ||
| 897 | FileUtil::GetUserPath(is_sdmc ? FileUtil::UserPath::SDMCDir : FileUtil::UserPath::NANDDir, | ||
| 898 | dir_path.toStdString()); | ||
| 899 | Service::FileSystem::CreateFactories(vfs); | ||
| 900 | game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); | ||
| 901 | } | ||
| 902 | } | ||
| 903 | |||
| 890 | void GMainWindow::OnMenuRecentFile() { | 904 | void GMainWindow::OnMenuRecentFile() { |
| 891 | QAction* action = qobject_cast<QAction*>(sender()); | 905 | QAction* action = qobject_cast<QAction*>(sender()); |
| 892 | assert(action); | 906 | assert(action); |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 3d6ebe329..b85149f8e 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -137,6 +137,9 @@ private slots: | |||
| 137 | void OnMenuInstallToNAND(); | 137 | void OnMenuInstallToNAND(); |
| 138 | /// Called whenever a user selects the "File->Select Game List Root" menu item | 138 | /// Called whenever a user selects the "File->Select Game List Root" menu item |
| 139 | void OnMenuSelectGameListRoot(); | 139 | void OnMenuSelectGameListRoot(); |
| 140 | /// Called whenever a user select the "File->Select -- Directory" where -- is NAND or SD Card | ||
| 141 | /// (false for nand, true for sdmc) | ||
| 142 | void OnMenuSelectEmulatedDirectory(bool is_sdmc); | ||
| 140 | void OnMenuRecentFile(); | 143 | void OnMenuRecentFile(); |
| 141 | void OnConfigure(); | 144 | void OnConfigure(); |
| 142 | void OnAbout(); | 145 | void OnAbout(); |
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index faa0c626a..3879d4813 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -65,6 +65,9 @@ | |||
| 65 | <addaction name="action_Select_Game_List_Root"/> | 65 | <addaction name="action_Select_Game_List_Root"/> |
| 66 | <addaction name="menu_recent_files"/> | 66 | <addaction name="menu_recent_files"/> |
| 67 | <addaction name="separator"/> | 67 | <addaction name="separator"/> |
| 68 | <addaction name="action_Select_NAND_Directory"/> | ||
| 69 | <addaction name="action_Select_SDMC_Directory"/> | ||
| 70 | <addaction name="separator"/> | ||
| 68 | <addaction name="action_Exit"/> | 71 | <addaction name="action_Exit"/> |
| 69 | </widget> | 72 | </widget> |
| 70 | <widget class="QMenu" name="menu_Emulation"> | 73 | <widget class="QMenu" name="menu_Emulation"> |
| @@ -204,6 +207,22 @@ | |||
| 204 | <string>Selects a folder to display in the game list</string> | 207 | <string>Selects a folder to display in the game list</string> |
| 205 | </property> | 208 | </property> |
| 206 | </action> | 209 | </action> |
| 210 | <action name="action_Select_NAND_Directory"> | ||
| 211 | <property name="text"> | ||
| 212 | <string>Select NAND Directory...</string> | ||
| 213 | </property> | ||
| 214 | <property name="toolTip"> | ||
| 215 | <string>Selects a folder to use as the root of the emulated NAND</string> | ||
| 216 | </property> | ||
| 217 | </action> | ||
| 218 | <action name="action_Select_SDMC_Directory"> | ||
| 219 | <property name="text"> | ||
| 220 | <string>Select SD Card Directory...</string> | ||
| 221 | </property> | ||
| 222 | <property name="toolTip"> | ||
| 223 | <string>Selects a folder to use as the root of the emulated SD card</string> | ||
| 224 | </property> | ||
| 225 | </action> | ||
| 207 | <action name="action_Fullscreen"> | 226 | <action name="action_Fullscreen"> |
| 208 | <property name="checkable"> | 227 | <property name="checkable"> |
| 209 | <bool>true</bool> | 228 | <bool>true</bool> |