VERY experimental Nintendo Switch 2 emulator
C++
Add menu item for selecting the game list folder
archshift7b1025c819b8
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cppindex ff2d609962..c5e338c91f 100644--- a/src/citra_qt/main.cpp+++ b/src/citra_qt/main.cpp@@ -167,6 +167,7 @@ GMainWindow::GMainWindow() : emu_thread(nullptr)connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)));connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()));connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap()));+ connect(ui.action_Select_Game_List_Root, SIGNAL(triggered()), this, SLOT(OnMenuSelectGameListRoot()));connect(ui.action_Start, SIGNAL(triggered()), this, SLOT(OnStartGame()));connect(ui.action_Pause, SIGNAL(triggered()), this, SLOT(OnPauseGame()));connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame()));@@ -380,6 +381,16 @@ void GMainWindow::OnMenuLoadSymbolMap() {}}+void GMainWindow::OnMenuSelectGameListRoot() {+ QSettings settings;++ QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory"));+ if (!dir_path.isEmpty()) {+ settings.setValue("gameListRootDir", dir_path);+ game_list->PopulateAsync(dir_path, settings.value("gameListDeepScan").toBool());+ }+}+void GMainWindow::OnMenuRecentFile() {QAction* action = qobject_cast<QAction*>(sender());assert(action);diff --git a/src/citra_qt/main.h b/src/citra_qt/main.hindex 48a1032bd1..6d27ce6a97 100644--- a/src/citra_qt/main.h+++ b/src/citra_qt/main.h@@ -92,6 +92,8 @@ private slots:void OnGameListLoadFile(QString game_path);void OnMenuLoadFile();void OnMenuLoadSymbolMap();+ /// Called whenever a user selects the "File->Select Game List Root" menu item+ void OnMenuSelectGameListRoot();void OnMenuRecentFile();void OnOpenHotkeysDialog();void OnConfigure();diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.uiindex 1ba700a3a6..997597642b 100644--- a/src/citra_qt/main.ui+++ b/src/citra_qt/main.ui@@ -45,7 +45,7 @@<x>0</x><y>0</y><width>1081</width>- <height>21</height>+ <height>22</height></rect></property><widget class="QMenu" name="menu_File">@@ -60,6 +60,7 @@<addaction name="action_Load_File"/><addaction name="action_Load_Symbol_Map"/><addaction name="separator"/>+ <addaction name="action_Select_Game_List_Root"/><addaction name="menu_recent_files"/><addaction name="separator"/><addaction name="action_Exit"/>@@ -182,6 +183,14 @@<string>Display Dock Widget Headers</string></property></action>+ <action name="action_Select_Game_List_Root">+ <property name="text">+ <string>Select Game Directory...</string>+ </property>+ <property name="toolTip">+ <string>Selects a folder to display in the game list</string>+ </property>+ </action></widget><resources/><connections>