summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/main.cpp
diff options
context:
space:
mode:
authorMathieu Vaillancourt <vaillancourtm@gmail.com>2014-04-22 05:15:17 +0200
committerMathieu Vaillancourt <vaillancourtm@gmail.com>2014-04-22 05:21:02 +0200
commit81f6062c85290dd2e63d0083e9f1c32a77d7783e (patch)
tree668e5f9934daa57219a685384f1fc24cf850575b /src/citra_qt/main.cpp
parentAdd a quick way to load Launcher.dat files (diff)
downloadyuzu-81f6062c85290dd2e63d0083e9f1c32a77d7783e.tar
yuzu-81f6062c85290dd2e63d0083e9f1c32a77d7783e.tar.gz
yuzu-81f6062c85290dd2e63d0083e9f1c32a77d7783e.tar.bz2
yuzu-81f6062c85290dd2e63d0083e9f1c32a77d7783e.tar.lz
yuzu-81f6062c85290dd2e63d0083e9f1c32a77d7783e.tar.xz
yuzu-81f6062c85290dd2e63d0083e9f1c32a77d7783e.tar.zst
yuzu-81f6062c85290dd2e63d0083e9f1c32a77d7783e.zip
Diffstat (limited to '')
-rw-r--r--src/citra_qt/main.cpp60
1 files changed, 26 insertions, 34 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index bb8336c45..f20d33485 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -32,9 +32,7 @@ GMainWindow::GMainWindow()
statusBar()->hide();
render_window = new GRenderWindow;
- //render_window->setStyleSheet("background-color:black;");
- ui.horizontalLayout->addWidget(render_window);
- //render_window->hide();
+ render_window->hide();
disasmWidget = new DisassemblerWidget(this, render_window->GetEmuThread());
addDockWidget(Qt::BottomDockWidgetArea, disasmWidget);
@@ -71,15 +69,15 @@ GMainWindow::GMainWindow()
restoreState(settings.value("state").toByteArray());
render_window->restoreGeometry(settings.value("geometryRenderWindow").toByteArray());
- //ui.action_Popout_Window_Mode->setChecked(settings.value("popupWindowMode", false).toBool());
- //ToggleWindowMode();
+ ui.action_Popout_Window_Mode->setChecked(settings.value("popoutWindowMode", true).toBool());
+ ToggleWindowMode();
// Setup connections
- connect(ui.action_load_elf, SIGNAL(triggered()), this, SLOT(OnMenuLoadELF()));
- 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()));
- //connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(SetupEmuWindowMode()));
+ connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()));
+ 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()));
+ connect(ui.action_Popout_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode()));
connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog()));
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues
@@ -88,15 +86,13 @@ GMainWindow::GMainWindow()
connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), callstackWidget, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection);
// Setup hotkeys
- RegisterHotkey("Main Window", "Load Image", QKeySequence::Open);
+ RegisterHotkey("Main Window", "Load File", QKeySequence::Open);
RegisterHotkey("Main Window", "Start Emulation");
LoadHotkeys(settings);
- connect(GetHotkey("Main Window", "Load Image", this), SIGNAL(activated()), this, SLOT(OnMenuLoadImage()));
+ connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this, SLOT(OnMenuLoadFile()));
connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this, SLOT(OnStartGame()));
- show();
-
LogManager::Init();
System::Init(render_window);
}
@@ -110,12 +106,9 @@ GMainWindow::~GMainWindow()
void GMainWindow::BootGame(const char* filename)
{
- render_window->DoneCurrent(); // make sure EmuThread can access GL context
- render_window->GetEmuThread().SetFilename(filename);
-
NOTICE_LOG(MASTER_LOG, "citra starting...\n");
- if (Core::Init(/*render_window*/)) {
+ if (Core::Init()) {
ERROR_LOG(MASTER_LOG, "core initialization failed, exiting...");
Core::Stop();
exit(1);
@@ -134,19 +127,22 @@ void GMainWindow::BootGame(const char* filename)
registersWidget->OnCPUStepped();
callstackWidget->OnCPUStepped();
+ render_window->DoneCurrent(); // make sure EmuThread can access GL context
+ render_window->GetEmuThread().SetFilename(filename);
render_window->GetEmuThread().start();
+
+ render_window->show();
}
-void GMainWindow::OnMenuLoadELF()
+void GMainWindow::OnMenuLoadFile()
{
- QString filename = QFileDialog::getOpenFileName(this, tr("Load ELF"), QString(), QString());
+ QString filename = QFileDialog::getOpenFileName(this, tr("Load file"), QString(), tr("3DS homebrew (*.elf *.dat)"));
if (filename.size())
BootGame(filename.toLatin1().data());
}
void GMainWindow::OnStartGame()
{
- render_window->show();
render_window->GetEmuThread().SetCpuRunning(true);
ui.action_Start->setEnabled(false);
@@ -181,26 +177,22 @@ void GMainWindow::OnOpenHotkeysDialog()
void GMainWindow::ToggleWindowMode()
{
- //if (!render_window->GetEmuThread().isRunning())
- // return;
- /*
- bool enable = ui.action_Single_Window_Mode->isChecked();
- if (enable && render_window->parent() == NULL) // switch to single window mode
+ bool enable = ui.action_Popout_Window_Mode->isChecked();
+ if (enable && render_window->parent() != NULL)
{
- render_window->BackupGeometry();
- ui.horizontalLayout->addWidget(render_window);
+ ui.horizontalLayout->removeWidget(render_window);
+ render_window->setParent(NULL);
render_window->setVisible(true);
render_window->DoneCurrent();
+ render_window->RestoreGeometry();
}
- else if (!enable && render_window->parent() != NULL) // switch to multiple windows mode
+ else if (!enable && render_window->parent() == NULL)
{
- ui.horizontalLayout->removeWidget(render_window);
- render_window->setParent(NULL);
+ render_window->BackupGeometry();
+ ui.horizontalLayout->addWidget(render_window);
render_window->setVisible(true);
render_window->DoneCurrent();
- render_window->RestoreGeometry();
}
- */
}
void GMainWindow::OnConfigure()
@@ -215,7 +207,7 @@ void GMainWindow::closeEvent(QCloseEvent* event)
settings.setValue("geometry", saveGeometry());
settings.setValue("state", saveState());
settings.setValue("geometryRenderWindow", render_window->saveGeometry());
- //settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked());
+ settings.setValue("popoutWindowMode", ui.action_Popout_Window_Mode->isChecked());
settings.setValue("firstStart", false);
SaveHotkeys(settings);