diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-06-14 18:27:29 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-06-14 18:27:29 +0200 |
commit | f969ddb54eb251539de82c00e083482b1cc309f4 (patch) | |
tree | 48998862932283ac3fab31b50fdb4b029924f50b | |
parent | Add support for main files in file picker (diff) | |
download | yuzu-f969ddb54eb251539de82c00e083482b1cc309f4.tar yuzu-f969ddb54eb251539de82c00e083482b1cc309f4.tar.gz yuzu-f969ddb54eb251539de82c00e083482b1cc309f4.tar.bz2 yuzu-f969ddb54eb251539de82c00e083482b1cc309f4.tar.lz yuzu-f969ddb54eb251539de82c00e083482b1cc309f4.tar.xz yuzu-f969ddb54eb251539de82c00e083482b1cc309f4.tar.zst yuzu-f969ddb54eb251539de82c00e083482b1cc309f4.zip |
-rw-r--r-- | src/yuzu/main.cpp | 10 | ||||
-rw-r--r-- | src/yuzu/main.h | 1 | ||||
-rw-r--r-- | src/yuzu/main.ui | 6 |
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() { void GMainWindow::ConnectMenuEvents() { // File connect(ui.action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile); + connect(ui.action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder); connect(ui.action_Select_Game_List_Root, &QAction::triggered, this, &GMainWindow::OnMenuSelectGameListRoot); connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); @@ -564,6 +565,15 @@ void GMainWindow::OnMenuLoadFile() { } } +void GMainWindow::OnMenuLoadFolder() { + QDir dir = QFileDialog::getExistingDirectory(this, tr("Open Extracted ROM Directory")); + + QStringList matchingMain = dir.entryList(QStringList() << "main", QDir::Files); + if (matchingMain.size() == 1) { + BootGame(matchingMain[0]); + } +} + void GMainWindow::OnMenuSelectGameListRoot() { QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); 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: void OnGameListLoadFile(QString game_path); void OnGameListOpenSaveFolder(u64 program_id); void OnMenuLoadFile(); + void OnMenuLoadFolder(); /// Called whenever a user selects the "File->Select Game List Root" menu item void OnMenuSelectGameListRoot(); 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 @@ </property> </widget> <addaction name="action_Load_File"/> + <addaction name="action_Load_Folder"/> <addaction name="separator"/> <addaction name="action_Select_Game_List_Root"/> <addaction name="menu_recent_files"/> @@ -106,6 +107,11 @@ <string>Load File...</string> </property> </action> + <action name="action_Load_Folder"> + <property name="text"> + <string>Load Folder...</string> + </property> + </action> <action name="action_Load_Symbol_Map"> <property name="text"> <string>Load Symbol Map...</string> |