diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-06-14 12:27:29 -0400 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-06-14 12:27:29 -0400 |
commit | f969ddb54eb251539de82c00e083482b1cc309f4 (patch) | |
tree | 48998862932283ac3fab31b50fdb4b029924f50b /src/yuzu/main.cpp | |
parent | 9f8fbce35b08961b2780e90ac029bc68b88e4c3d (diff) |
Add 'Load Folder' menu option
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 2e525b5be3..e2afe21314 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()) { |