From afd06675fa2b93c81f0f868443c03cc3ad8bee07 Mon Sep 17 00:00:00 2001 From: archshift Date: Mon, 31 Aug 2015 18:30:06 -0700 Subject: Don't show render window until a game is started --- src/citra_qt/main.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/citra_qt/main.cpp') diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 01841b33c..58de28c1d 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -266,6 +266,7 @@ void GMainWindow::BootGame(const std::string& filename) { callstackWidget->OnDebugModeEntered(); render_window->show(); + emulation_running = true; OnStartGame(); } @@ -294,6 +295,8 @@ void GMainWindow::ShutdownGame() { ui.action_Pause->setEnabled(false); ui.action_Stop->setEnabled(false); render_window->hide(); + + emulation_running = false; } void GMainWindow::StoreRecentFile(const QString& filename) @@ -423,17 +426,21 @@ void GMainWindow::ToggleWindowMode() { // Render in the main window... render_window->BackupGeometry(); ui.horizontalLayout->addWidget(render_window); - render_window->setVisible(true); render_window->setFocusPolicy(Qt::ClickFocus); - render_window->setFocus(); + if (emulation_running) { + render_window->setVisible(true); + render_window->setFocus(); + } } else { // Render in a separate window... ui.horizontalLayout->removeWidget(render_window); render_window->setParent(nullptr); - render_window->setVisible(true); - render_window->RestoreGeometry(); render_window->setFocusPolicy(Qt::NoFocus); + if (emulation_running) { + render_window->setVisible(true); + render_window->RestoreGeometry(); + } } } -- cgit v1.2.3 From 6e1bb58ee8ace739615e42cff02f07ee396edb6e Mon Sep 17 00:00:00 2001 From: archshift Date: Mon, 31 Aug 2015 21:35:33 -0700 Subject: Initial implementation of a game list --- src/citra_qt/main.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/citra_qt/main.cpp') diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 58de28c1d..ff2d60996 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -12,6 +12,7 @@ #include "citra_qt/bootmanager.h" #include "citra_qt/config.h" +#include "citra_qt/game_list.h" #include "citra_qt/hotkeys.h" #include "citra_qt/main.h" @@ -59,6 +60,9 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) render_window = new GRenderWindow(this, emu_thread.get()); render_window->hide(); + game_list = new GameList(); + ui.horizontalLayout->addWidget(game_list); + profilerWidget = new ProfilerWidget(this); addDockWidget(Qt::BottomDockWidgetArea, profilerWidget); profilerWidget->hide(); @@ -160,6 +164,7 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) UpdateRecentFiles(); // Setup connections + 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_Start, SIGNAL(triggered()), this, SLOT(OnStartGame())); @@ -193,6 +198,8 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) show(); + game_list->PopulateAsync(settings.value("gameListRootDir").toString(), settings.value("gameListDeepScan").toBool()); + QStringList args = QApplication::arguments(); if (args.length() >= 2) { BootGame(args[1].toStdString()); @@ -264,6 +271,9 @@ void GMainWindow::BootGame(const std::string& filename) { // Update the GUI registersWidget->OnDebugModeEntered(); callstackWidget->OnDebugModeEntered(); + if (ui.action_Single_Window_Mode->isChecked()) { + game_list->hide(); + } render_window->show(); emulation_running = true; @@ -295,6 +305,7 @@ void GMainWindow::ShutdownGame() { ui.action_Pause->setEnabled(false); ui.action_Stop->setEnabled(false); render_window->hide(); + game_list->show(); emulation_running = false; } @@ -340,12 +351,16 @@ void GMainWindow::UpdateRecentFiles() { } } +void GMainWindow::OnGameListLoadFile(QString game_path) { + BootGame(game_path.toLatin1().data()); +} + void GMainWindow::OnMenuLoadFile() { QSettings settings; QString rom_path = settings.value("romsPath", QString()).toString(); QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), rom_path, tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)")); - if (filename.size()) { + if (!filename.isEmpty()) { settings.setValue("romsPath", QFileInfo(filename).path()); StoreRecentFile(filename); @@ -358,7 +373,7 @@ void GMainWindow::OnMenuLoadSymbolMap() { QString symbol_path = settings.value("symbolsPath", QString()).toString(); QString filename = QFileDialog::getOpenFileName(this, tr("Load Symbol Map"), symbol_path, tr("Symbol map (*)")); - if (filename.size()) { + if (!filename.isEmpty()) { settings.setValue("symbolsPath", QFileInfo(filename).path()); LoadSymbolMap(filename.toLatin1().data()); @@ -440,6 +455,7 @@ void GMainWindow::ToggleWindowMode() { if (emulation_running) { render_window->setVisible(true); render_window->RestoreGeometry(); + game_list->show(); } } } -- cgit v1.2.3 From 797b91a449c549995ab4afe786275b02b3e1ab87 Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 6 Sep 2015 15:33:57 -0700 Subject: Add menu item for selecting the game list folder --- src/citra_qt/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/citra_qt/main.cpp') diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index ff2d60996..c5e338c91 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(sender()); assert(action); -- cgit v1.2.3 From 0fae76c741b84cfe6d31a9079b818866778dfa31 Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 6 Sep 2015 23:51:57 -0700 Subject: Game list: save and load column sizes, sort order, to QSettings --- src/citra_qt/main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/citra_qt/main.cpp') diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index c5e338c91..298649aaf 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -141,6 +141,8 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) microProfileDialog->setVisible(settings.value("microProfileDialogVisible").toBool()); settings.endGroup(); + game_list->LoadInterfaceLayout(settings); + ui.action_Use_Hardware_Renderer->setChecked(Settings::values.use_hw_renderer); SetHardwareRendererEnabled(ui.action_Use_Hardware_Renderer->isChecked()); @@ -490,6 +492,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) { settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked()); settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked()); settings.setValue("firstStart", false); + game_list->SaveInterfaceLayout(settings); SaveHotkeys(settings); // Shutdown session if the emu thread is active... -- cgit v1.2.3