summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-02-18 02:26:57 -0800
committerGravatar Yuri Kunde Schlesner2017-02-18 02:26:57 -0800
commit5b96915c6992fb5446f2cc1fba49e21152730f0b (patch)
tree52e7145f6f7419f9774dc34fc89be881c509df97 /src
parentQt: Re-organize setup of debugging widgets (diff)
downloadyuzu-5b96915c6992fb5446f2cc1fba49e21152730f0b.tar.gz
yuzu-5b96915c6992fb5446f2cc1fba49e21152730f0b.tar.xz
yuzu-5b96915c6992fb5446f2cc1fba49e21152730f0b.zip
Qt: Reorganize connection of menu events
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/main.cpp35
-rw-r--r--src/citra_qt/main.h1
2 files changed, 23 insertions, 13 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 96ec42214..05709fcb0 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -66,6 +66,7 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) {
66 SetDefaultUIGeometry(); 66 SetDefaultUIGeometry();
67 RestoreUIState(); 67 RestoreUIState();
68 68
69 ConnectMenuEvents();
69 ConnectWidgetEvents(); 70 ConnectWidgetEvents();
70 71
71 setWindowTitle(QString("Citra | %1-%2").arg(Common::g_scm_branch, Common::g_scm_desc)); 72 setWindowTitle(QString("Citra | %1-%2").arg(Common::g_scm_branch, Common::g_scm_desc));
@@ -231,26 +232,34 @@ void GMainWindow::RestoreUIState() {
231} 232}
232 233
233void GMainWindow::ConnectWidgetEvents() { 234void GMainWindow::ConnectWidgetEvents() {
234 connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)), 235 connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)));
235 Qt::DirectConnection);
236 connect(game_list, SIGNAL(OpenSaveFolderRequested(u64)), this, 236 connect(game_list, SIGNAL(OpenSaveFolderRequested(u64)), this,
237 SLOT(OnGameListOpenSaveFolder(u64)), Qt::DirectConnection); 237 SLOT(OnGameListOpenSaveFolder(u64)));
238 connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(OnConfigure()));
239 connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()),
240 Qt::DirectConnection);
241 connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap()));
242 connect(ui.action_Select_Game_List_Root, SIGNAL(triggered()), this,
243 SLOT(OnMenuSelectGameListRoot()));
244 connect(ui.action_Start, SIGNAL(triggered()), this, SLOT(OnStartGame()));
245 connect(ui.action_Pause, SIGNAL(triggered()), this, SLOT(OnPauseGame()));
246 connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame()));
247 connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode()));
248 238
249 connect(this, SIGNAL(EmulationStarting(EmuThread*)), render_window, 239 connect(this, SIGNAL(EmulationStarting(EmuThread*)), render_window,
250 SLOT(OnEmulationStarting(EmuThread*))); 240 SLOT(OnEmulationStarting(EmuThread*)));
251 connect(this, SIGNAL(EmulationStopping()), render_window, SLOT(OnEmulationStopping())); 241 connect(this, SIGNAL(EmulationStopping()), render_window, SLOT(OnEmulationStopping()));
252} 242}
253 243
244void GMainWindow::ConnectMenuEvents() {
245 // File
246 connect(ui.action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile);
247 connect(ui.action_Load_Symbol_Map, &QAction::triggered, this,
248 &GMainWindow::OnMenuLoadSymbolMap);
249 connect(ui.action_Select_Game_List_Root, &QAction::triggered, this,
250 &GMainWindow::OnMenuSelectGameListRoot);
251
252 // Emulation
253 connect(ui.action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame);
254 connect(ui.action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame);
255 connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame);
256 connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure);
257
258 // View
259 connect(ui.action_Single_Window_Mode, &QAction::triggered, this,
260 &GMainWindow::ToggleWindowMode);
261}
262
254void GMainWindow::OnDisplayTitleBars(bool show) { 263void GMainWindow::OnDisplayTitleBars(bool show) {
255 QList<QDockWidget*> widgets = findChildren<QDockWidget*>(); 264 QList<QDockWidget*> widgets = findChildren<QDockWidget*>();
256 265
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index e0d9a545b..87637b92b 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -72,6 +72,7 @@ private:
72 void RestoreUIState(); 72 void RestoreUIState();
73 73
74 void ConnectWidgetEvents(); 74 void ConnectWidgetEvents();
75 void ConnectMenuEvents();
75 76
76 bool LoadROM(const QString& filename); 77 bool LoadROM(const QString& filename);
77 void BootGame(const QString& filename); 78 void BootGame(const QString& filename);