summaryrefslogtreecommitdiff
path: root/src/citra_qt/main.cpp
diff options
context:
space:
mode:
authorGravatar LittleWhite2016-01-24 18:34:05 +0100
committerGravatar LittleWhite2016-03-21 20:03:18 +0100
commit426c4a2a5b65ce04a767e4c514aafc182b8d5a56 (patch)
treea15f1c22d06f0511aa6edd95815bed7ad0ca693e /src/citra_qt/main.cpp
parentMerge pull request #1559 from lioncash/vec (diff)
downloadyuzu-426c4a2a5b65ce04a767e4c514aafc182b8d5a56.tar.gz
yuzu-426c4a2a5b65ce04a767e4c514aafc182b8d5a56.tar.xz
yuzu-426c4a2a5b65ce04a767e4c514aafc182b8d5a56.zip
Add Configure widget
Diffstat (limited to 'src/citra_qt/main.cpp')
-rw-r--r--src/citra_qt/main.cpp48
1 files changed, 9 insertions, 39 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 32cceaf7e..573036a2a 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -13,6 +13,7 @@
13 13
14#include "citra_qt/bootmanager.h" 14#include "citra_qt/bootmanager.h"
15#include "citra_qt/config.h" 15#include "citra_qt/config.h"
16#include "citra_qt/configure_dialog.h"
16#include "citra_qt/game_list.h" 17#include "citra_qt/game_list.h"
17#include "citra_qt/hotkeys.h" 18#include "citra_qt/hotkeys.h"
18#include "citra_qt/main.h" 19#include "citra_qt/main.h"
@@ -145,17 +146,9 @@ GMainWindow::GMainWindow() : emu_thread(nullptr)
145 146
146 game_list->LoadInterfaceLayout(settings); 147 game_list->LoadInterfaceLayout(settings);
147 148
148 ui.action_Use_Gdbstub->setChecked(Settings::values.use_gdbstub); 149 GDBStub::ToggleServer(Settings::values.use_gdbstub);
149 SetGdbstubEnabled(ui.action_Use_Gdbstub->isChecked());
150
151 GDBStub::SetServerPort(static_cast<u32>(Settings::values.gdbstub_port)); 150 GDBStub::SetServerPort(static_cast<u32>(Settings::values.gdbstub_port));
152 151
153 ui.action_Use_Hardware_Renderer->setChecked(Settings::values.use_hw_renderer);
154 SetHardwareRendererEnabled(ui.action_Use_Hardware_Renderer->isChecked());
155
156 ui.action_Use_Shader_JIT->setChecked(Settings::values.use_shader_jit);
157 SetShaderJITEnabled(ui.action_Use_Shader_JIT->isChecked());
158
159 ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool()); 152 ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool());
160 ToggleWindowMode(); 153 ToggleWindowMode();
161 154
@@ -176,17 +169,14 @@ GMainWindow::GMainWindow() : emu_thread(nullptr)
176 169
177 // Setup connections 170 // Setup connections
178 connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString))); 171 connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)));
172 connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(OnConfigure()));
179 connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile())); 173 connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()));
180 connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap())); 174 connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap()));
181 connect(ui.action_Select_Game_List_Root, SIGNAL(triggered()), this, SLOT(OnMenuSelectGameListRoot())); 175 connect(ui.action_Select_Game_List_Root, SIGNAL(triggered()), this, SLOT(OnMenuSelectGameListRoot()));
182 connect(ui.action_Start, SIGNAL(triggered()), this, SLOT(OnStartGame())); 176 connect(ui.action_Start, SIGNAL(triggered()), this, SLOT(OnStartGame()));
183 connect(ui.action_Pause, SIGNAL(triggered()), this, SLOT(OnPauseGame())); 177 connect(ui.action_Pause, SIGNAL(triggered()), this, SLOT(OnPauseGame()));
184 connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame())); 178 connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame()));
185 connect(ui.action_Use_Hardware_Renderer, SIGNAL(triggered(bool)), this, SLOT(SetHardwareRendererEnabled(bool)));
186 connect(ui.action_Use_Shader_JIT, SIGNAL(triggered(bool)), this, SLOT(SetShaderJITEnabled(bool)));
187 connect(ui.action_Use_Gdbstub, SIGNAL(triggered(bool)), this, SLOT(SetGdbstubEnabled(bool)));
188 connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode())); 179 connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode()));
189 connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog()));
190 180
191 connect(this, SIGNAL(EmulationStarting(EmuThread*)), disasmWidget, SLOT(OnEmulationStarting(EmuThread*))); 181 connect(this, SIGNAL(EmulationStarting(EmuThread*)), disasmWidget, SLOT(OnEmulationStarting(EmuThread*)));
192 connect(this, SIGNAL(EmulationStopping()), disasmWidget, SLOT(OnEmulationStopping())); 182 connect(this, SIGNAL(EmulationStopping()), disasmWidget, SLOT(OnEmulationStopping()));
@@ -496,31 +486,6 @@ void GMainWindow::OnStopGame() {
496 ShutdownGame(); 486 ShutdownGame();
497} 487}
498 488
499void GMainWindow::OnOpenHotkeysDialog() {
500 GHotkeysDialog dialog(this);
501 dialog.exec();
502}
503
504void GMainWindow::SetHardwareRendererEnabled(bool enabled) {
505 VideoCore::g_hw_renderer_enabled = enabled;
506
507 Config config;
508 Settings::values.use_hw_renderer = enabled;
509 config.Save();
510}
511
512void GMainWindow::SetGdbstubEnabled(bool enabled) {
513 GDBStub::ToggleServer(enabled);
514}
515
516void GMainWindow::SetShaderJITEnabled(bool enabled) {
517 VideoCore::g_shader_jit_enabled = enabled;
518
519 Config config;
520 Settings::values.use_shader_jit = enabled;
521 config.Save();
522}
523
524void GMainWindow::ToggleWindowMode() { 489void GMainWindow::ToggleWindowMode() {
525 if (ui.action_Single_Window_Mode->isChecked()) { 490 if (ui.action_Single_Window_Mode->isChecked()) {
526 // Render in the main window... 491 // Render in the main window...
@@ -547,7 +512,12 @@ void GMainWindow::ToggleWindowMode() {
547} 512}
548 513
549void GMainWindow::OnConfigure() { 514void GMainWindow::OnConfigure() {
550 //GControllerConfigDialog* dialog = new GControllerConfigDialog(controller_ports, this); 515 ConfigureDialog configureDialog(this);
516 auto result = configureDialog.exec();
517 if ( result == QDialog::Accepted)
518 {
519 configureDialog.applyConfiguration();
520 }
551} 521}
552 522
553bool GMainWindow::ConfirmClose() { 523bool GMainWindow::ConfirmClose() {