summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-06-14 12:27:29 -0400
committerGravatar Zach Hilman2018-06-14 12:27:29 -0400
commitf969ddb54eb251539de82c00e083482b1cc309f4 (patch)
tree48998862932283ac3fab31b50fdb4b029924f50b /src
parentAdd support for main files in file picker (diff)
downloadyuzu-f969ddb54eb251539de82c00e083482b1cc309f4.tar.gz
yuzu-f969ddb54eb251539de82c00e083482b1cc309f4.tar.xz
yuzu-f969ddb54eb251539de82c00e083482b1cc309f4.zip
Add 'Load Folder' menu option
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/main.cpp10
-rw-r--r--src/yuzu/main.h1
-rw-r--r--src/yuzu/main.ui6
3 files changed, 17 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 2e525b5be..e2afe2131 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -278,6 +278,7 @@ void GMainWindow::ConnectWidgetEvents() {
278void GMainWindow::ConnectMenuEvents() { 278void GMainWindow::ConnectMenuEvents() {
279 // File 279 // File
280 connect(ui.action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile); 280 connect(ui.action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile);
281 connect(ui.action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder);
281 connect(ui.action_Select_Game_List_Root, &QAction::triggered, this, 282 connect(ui.action_Select_Game_List_Root, &QAction::triggered, this,
282 &GMainWindow::OnMenuSelectGameListRoot); 283 &GMainWindow::OnMenuSelectGameListRoot);
283 connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); 284 connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close);
@@ -564,6 +565,15 @@ void GMainWindow::OnMenuLoadFile() {
564 } 565 }
565} 566}
566 567
568void GMainWindow::OnMenuLoadFolder() {
569 QDir dir = QFileDialog::getExistingDirectory(this, tr("Open Extracted ROM Directory"));
570
571 QStringList matchingMain = dir.entryList(QStringList() << "main", QDir::Files);
572 if (matchingMain.size() == 1) {
573 BootGame(matchingMain[0]);
574 }
575}
576
567void GMainWindow::OnMenuSelectGameListRoot() { 577void GMainWindow::OnMenuSelectGameListRoot() {
568 QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); 578 QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory"));
569 if (!dir_path.isEmpty()) { 579 if (!dir_path.isEmpty()) {
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 3e29d5fc4..074bba3f9 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -123,6 +123,7 @@ private slots:
123 void OnGameListLoadFile(QString game_path); 123 void OnGameListLoadFile(QString game_path);
124 void OnGameListOpenSaveFolder(u64 program_id); 124 void OnGameListOpenSaveFolder(u64 program_id);
125 void OnMenuLoadFile(); 125 void OnMenuLoadFile();
126 void OnMenuLoadFolder();
126 /// Called whenever a user selects the "File->Select Game List Root" menu item 127 /// Called whenever a user selects the "File->Select Game List Root" menu item
127 void OnMenuSelectGameListRoot(); 128 void OnMenuSelectGameListRoot();
128 void OnMenuRecentFile(); 129 void OnMenuRecentFile();
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui
index 0fcd93cc2..22c4cad08 100644
--- a/src/yuzu/main.ui
+++ b/src/yuzu/main.ui
@@ -58,6 +58,7 @@
58 </property> 58 </property>
59 </widget> 59 </widget>
60 <addaction name="action_Load_File"/> 60 <addaction name="action_Load_File"/>
61 <addaction name="action_Load_Folder"/>
61 <addaction name="separator"/> 62 <addaction name="separator"/>
62 <addaction name="action_Select_Game_List_Root"/> 63 <addaction name="action_Select_Game_List_Root"/>
63 <addaction name="menu_recent_files"/> 64 <addaction name="menu_recent_files"/>
@@ -106,6 +107,11 @@
106 <string>Load File...</string> 107 <string>Load File...</string>
107 </property> 108 </property>
108 </action> 109 </action>
110 <action name="action_Load_Folder">
111 <property name="text">
112 <string>Load Folder...</string>
113 </property>
114 </action>
109 <action name="action_Load_Symbol_Map"> 115 <action name="action_Load_Symbol_Map">
110 <property name="text"> 116 <property name="text">
111 <string>Load Symbol Map...</string> 117 <string>Load Symbol Map...</string>