diff options
-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() { &GMainWindow::OnMenuInstallToNAND); connect(ui.action_Select_Game_List_Root, &QAction::triggered, this, &GMainWindow::OnMenuSelectGameListRoot); + connect(ui.action_Select_NAND_Directory, &QAction::triggered, this, + [this] { OnMenuSelectEmulatedDirectory(false); }); + connect(ui.action_Select_SDMC_Directory, &QAction::triggered, this, + [this] { OnMenuSelectEmulatedDirectory(true); }); connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); // Emulation @@ -887,6 +891,16 @@ void GMainWindow::OnMenuSelectGameListRoot() { } } +void GMainWindow::OnMenuSelectEmulatedDirectory(bool is_sdmc) { + QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); + if (!dir_path.isEmpty()) { + FileUtil::GetUserPath(is_sdmc ? FileUtil::UserPath::SDMCDir : FileUtil::UserPath::NANDDir, + dir_path.toStdString()); + Service::FileSystem::CreateFactories(vfs); + game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); + } +} + void GMainWindow::OnMenuRecentFile() { QAction* action = qobject_cast<QAction*>(sender()); 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: void OnMenuInstallToNAND(); /// Called whenever a user selects the "File->Select Game List Root" menu item void OnMenuSelectGameListRoot(); + /// Called whenever a user select the "File->Select -- Directory" where -- is NAND or SD Card + /// (false for nand, true for sdmc) + void OnMenuSelectEmulatedDirectory(bool is_sdmc); void OnMenuRecentFile(); void OnConfigure(); 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 @@ <addaction name="action_Select_Game_List_Root"/> <addaction name="menu_recent_files"/> <addaction name="separator"/> + <addaction name="action_Select_NAND_Directory"/> + <addaction name="action_Select_SDMC_Directory"/> + <addaction name="separator"/> <addaction name="action_Exit"/> </widget> <widget class="QMenu" name="menu_Emulation"> @@ -204,6 +207,22 @@ <string>Selects a folder to display in the game list</string> </property> </action> + <action name="action_Select_NAND_Directory"> + <property name="text"> + <string>Select NAND Directory...</string> + </property> + <property name="toolTip"> + <string>Selects a folder to use as the root of the emulated NAND</string> + </property> + </action> + <action name="action_Select_SDMC_Directory"> + <property name="text"> + <string>Select SD Card Directory...</string> + </property> + <property name="toolTip"> + <string>Selects a folder to use as the root of the emulated SD card</string> + </property> + </action> <action name="action_Fullscreen"> <property name="checkable"> <bool>true</bool> |