summaryrefslogtreecommitdiff
path: root/src/citra_qt/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt/main.cpp')
-rw-r--r--src/citra_qt/main.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index b12e6a02b..64e389f25 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -1,3 +1,7 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
1#include <thread> 5#include <thread>
2 6
3#include <QtGui> 7#include <QtGui>
@@ -107,7 +111,7 @@ GMainWindow::GMainWindow()
107 restoreState(settings.value("state").toByteArray()); 111 restoreState(settings.value("state").toByteArray());
108 render_window->restoreGeometry(settings.value("geometryRenderWindow").toByteArray()); 112 render_window->restoreGeometry(settings.value("geometryRenderWindow").toByteArray());
109 113
110 ui.action_Popout_Window_Mode->setChecked(settings.value("popoutWindowMode", true).toBool()); 114 ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool());
111 ToggleWindowMode(); 115 ToggleWindowMode();
112 116
113 // Setup connections 117 // Setup connections
@@ -116,7 +120,7 @@ GMainWindow::GMainWindow()
116 connect(ui.action_Start, SIGNAL(triggered()), this, SLOT(OnStartGame())); 120 connect(ui.action_Start, SIGNAL(triggered()), this, SLOT(OnStartGame()));
117 connect(ui.action_Pause, SIGNAL(triggered()), this, SLOT(OnPauseGame())); 121 connect(ui.action_Pause, SIGNAL(triggered()), this, SLOT(OnPauseGame()));
118 connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame())); 122 connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame()));
119 connect(ui.action_Popout_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode())); 123 connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode()));
120 connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog())); 124 connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog()));
121 125
122 // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues 126 // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues
@@ -175,13 +179,13 @@ void GMainWindow::BootGame(std::string filename)
175 179
176void GMainWindow::OnMenuLoadFile() 180void GMainWindow::OnMenuLoadFile()
177{ 181{
178 QString filename = QFileDialog::getOpenFileName(this, tr("Load file"), QString(), tr("3DS executable (*.3dsx *.elf *.axf *.bin *.cci *.cxi)")); 182 QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), QString(), tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.bin *.cci *.cxi)"));
179 if (filename.size()) 183 if (filename.size())
180 BootGame(filename.toLatin1().data()); 184 BootGame(filename.toLatin1().data());
181} 185}
182 186
183void GMainWindow::OnMenuLoadSymbolMap() { 187void GMainWindow::OnMenuLoadSymbolMap() {
184 QString filename = QFileDialog::getOpenFileName(this, tr("Load symbol map"), QString(), tr("Symbol map (*)")); 188 QString filename = QFileDialog::getOpenFileName(this, tr("Load Symbol Map"), QString(), tr("Symbol map (*)"));
185 if (filename.size()) 189 if (filename.size())
186 LoadSymbolMap(filename.toLatin1().data()); 190 LoadSymbolMap(filename.toLatin1().data());
187} 191}
@@ -223,8 +227,8 @@ void GMainWindow::OnOpenHotkeysDialog()
223 227
224void GMainWindow::ToggleWindowMode() 228void GMainWindow::ToggleWindowMode()
225{ 229{
226 bool enable = ui.action_Popout_Window_Mode->isChecked(); 230 bool enable = ui.action_Single_Window_Mode->isChecked();
227 if (enable && render_window->parent() != nullptr) 231 if (!enable && render_window->parent() != nullptr)
228 { 232 {
229 ui.horizontalLayout->removeWidget(render_window); 233 ui.horizontalLayout->removeWidget(render_window);
230 render_window->setParent(nullptr); 234 render_window->setParent(nullptr);
@@ -232,7 +236,7 @@ void GMainWindow::ToggleWindowMode()
232 render_window->RestoreGeometry(); 236 render_window->RestoreGeometry();
233 render_window->setFocusPolicy(Qt::NoFocus); 237 render_window->setFocusPolicy(Qt::NoFocus);
234 } 238 }
235 else if (!enable && render_window->parent() == nullptr) 239 else if (enable && render_window->parent() == nullptr)
236 { 240 {
237 render_window->BackupGeometry(); 241 render_window->BackupGeometry();
238 ui.horizontalLayout->addWidget(render_window); 242 ui.horizontalLayout->addWidget(render_window);
@@ -254,7 +258,7 @@ void GMainWindow::closeEvent(QCloseEvent* event)
254 settings.setValue("geometry", saveGeometry()); 258 settings.setValue("geometry", saveGeometry());
255 settings.setValue("state", saveState()); 259 settings.setValue("state", saveState());
256 settings.setValue("geometryRenderWindow", render_window->saveGeometry()); 260 settings.setValue("geometryRenderWindow", render_window->saveGeometry());
257 settings.setValue("popoutWindowMode", ui.action_Popout_Window_Mode->isChecked()); 261 settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked());
258 settings.setValue("firstStart", false); 262 settings.setValue("firstStart", false);
259 SaveHotkeys(settings); 263 SaveHotkeys(settings);
260 264