aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mathieu Vaillancourt <vaillancourtm@gmail.com>2014-04-12 19:01:33 -0400
committerGravatar Mathieu Vaillancourt <vaillancourtm@gmail.com>2014-04-12 19:04:33 -0400
commit68a8594d041c416301feeb43bb9f1c41d681b795 (patch)
treebadb70e1b40d88ba4eb2ddbb001087d22bb1f7e8
parent0ecb0365e471c689866e7cbf4d775443e9ac11c7 (diff)
Init window size from VideoCore. Start changing the default window behavior...
-rw-r--r--src/citra_qt/bootmanager.cpp7
-rw-r--r--src/citra_qt/main.cpp22
-rw-r--r--src/citra_qt/main.hxx2
-rw-r--r--src/citra_qt/main.ui9
-rw-r--r--src/citra_qt/ui_main.h6
5 files changed, 17 insertions, 29 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index 75abcd8b..31958ac2 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -6,6 +6,7 @@
#include "core/core.h"
#include "core/loader.h"
+#include "video_core/video_core.h"
#include "version.h"
@@ -35,7 +36,8 @@ void EmuThread::run()
exec_cpu_step = false;
Core::SingleStep();
- emit CPUStepped();
+ if (!cpu_running)
+ emit CPUStepped();
}
}
}
@@ -103,9 +105,8 @@ GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this
// TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose
child = new GGLWidgetInternal(this);
-
QBoxLayout* layout = new QHBoxLayout(this);
- resize(640, 480); // TODO: Load size from config instead
+ resize(VideoCore::kScreenTopWidth, VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight);
layout->addWidget(child);
layout->setMargin(0);
setLayout(layout);
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index c022c28a..08fd03b2 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -6,6 +6,7 @@
#include "common/common.h"
#include "common/platform.h"
+#include "common/log_manager.h"
#if EMU_PLATFORM == PLATFORM_LINUX
#include <unistd.h>
#endif
@@ -31,7 +32,9 @@ GMainWindow::GMainWindow()
statusBar()->hide();
render_window = new GRenderWindow;
- render_window->hide();
+ //render_window->setStyleSheet("background-color:black;");
+ ui.horizontalLayout->addWidget(render_window);
+ //render_window->hide();
disasm = new GDisAsmView(this, render_window->GetEmuThread());
addDockWidget(Qt::BottomDockWidgetArea, disasm);
@@ -63,15 +66,15 @@ GMainWindow::GMainWindow()
restoreState(settings.value("state").toByteArray());
render_window->restoreGeometry(settings.value("geometryRenderWindow").toByteArray());
- ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", false).toBool());
- SetupEmuWindowMode();
+ //ui.action_Popout_Window_Mode->setChecked(settings.value("popupWindowMode", false).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_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(SetupEmuWindowMode()));
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
@@ -89,6 +92,7 @@ GMainWindow::GMainWindow()
show();
System::Init(render_window);
+ LogManager::Init();
}
GMainWindow::~GMainWindow()
@@ -124,9 +128,6 @@ void GMainWindow::BootGame(const char* filename)
arm_regs->OnCPUStepped();
render_window->GetEmuThread().start();
-
- SetupEmuWindowMode();
- render_window->show();
}
void GMainWindow::OnMenuLoadELF()
@@ -171,11 +172,11 @@ void GMainWindow::OnOpenHotkeysDialog()
}
-void GMainWindow::SetupEmuWindowMode()
+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
{
@@ -192,6 +193,7 @@ void GMainWindow::SetupEmuWindowMode()
render_window->DoneCurrent();
render_window->RestoreGeometry();
}
+ */
}
void GMainWindow::OnConfigure()
@@ -206,7 +208,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("singleWindowMode", ui.action_Single_Window_Mode->isChecked());
settings.setValue("firstStart", false);
SaveHotkeys(settings);
diff --git a/src/citra_qt/main.hxx b/src/citra_qt/main.hxx
index 34bd2c3a..40170569 100644
--- a/src/citra_qt/main.hxx
+++ b/src/citra_qt/main.hxx
@@ -37,8 +37,8 @@ private slots:
void OnStopGame();
void OnMenuLoadELF();
void OnOpenHotkeysDialog();
- void SetupEmuWindowMode();
void OnConfigure();
+ void ToggleWindowMode();
private:
Ui::MainWindow ui;
diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.ui
index bc895d89..d1362cdf 100644
--- a/src/citra_qt/main.ui
+++ b/src/citra_qt/main.ui
@@ -57,7 +57,6 @@
<property name="title">
<string>&amp;View</string>
</property>
- <addaction name="action_Single_Window_Mode"/>
<addaction name="action_Hotkeys"/>
</widget>
<widget class="QMenu" name="menu_Help">
@@ -108,14 +107,6 @@
<string>About Citra</string>
</property>
</action>
- <action name="action_Single_Window_Mode">
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="text">
- <string>Single Window Mode</string>
- </property>
- </action>
<action name="action_Hotkeys">
<property name="text">
<string>Configure &amp;Hotkeys ...</string>
diff --git a/src/citra_qt/ui_main.h b/src/citra_qt/ui_main.h
index d349a5c6..e098c45a 100644
--- a/src/citra_qt/ui_main.h
+++ b/src/citra_qt/ui_main.h
@@ -32,7 +32,6 @@ public:
QAction *action_Pause;
QAction *action_Stop;
QAction *action_About;
- QAction *action_Single_Window_Mode;
QAction *action_Hotkeys;
QAction *action_Configure;
QWidget *centralwidget;
@@ -68,9 +67,6 @@ public:
action_Stop->setEnabled(false);
action_About = new QAction(MainWindow);
action_About->setObjectName(QString::fromUtf8("action_About"));
- action_Single_Window_Mode = new QAction(MainWindow);
- action_Single_Window_Mode->setObjectName(QString::fromUtf8("action_Single_Window_Mode"));
- action_Single_Window_Mode->setCheckable(true);
action_Hotkeys = new QAction(MainWindow);
action_Hotkeys->setObjectName(QString::fromUtf8("action_Hotkeys"));
action_Configure = new QAction(MainWindow);
@@ -108,7 +104,6 @@ public:
menu_Emulation->addAction(action_Stop);
menu_Emulation->addSeparator();
menu_Emulation->addAction(action_Configure);
- menu_View->addAction(action_Single_Window_Mode);
menu_View->addAction(action_Hotkeys);
menu_Help->addAction(action_About);
@@ -128,7 +123,6 @@ public:
action_Pause->setText(QApplication::translate("MainWindow", "&Pause", 0, QApplication::UnicodeUTF8));
action_Stop->setText(QApplication::translate("MainWindow", "&Stop", 0, QApplication::UnicodeUTF8));
action_About->setText(QApplication::translate("MainWindow", "About Citra", 0, QApplication::UnicodeUTF8));
- action_Single_Window_Mode->setText(QApplication::translate("MainWindow", "Single Window Mode", 0, QApplication::UnicodeUTF8));
action_Hotkeys->setText(QApplication::translate("MainWindow", "Configure &Hotkeys ...", 0, QApplication::UnicodeUTF8));
action_Configure->setText(QApplication::translate("MainWindow", "Configure ...", 0, QApplication::UnicodeUTF8));
menu_File->setTitle(QApplication::translate("MainWindow", "&File", 0, QApplication::UnicodeUTF8));