diff options
| author | 2016-01-24 18:34:05 +0100 | |
|---|---|---|
| committer | 2016-03-21 20:03:18 +0100 | |
| commit | 426c4a2a5b65ce04a767e4c514aafc182b8d5a56 (patch) | |
| tree | a15f1c22d06f0511aa6edd95815bed7ad0ca693e /src | |
| parent | Merge pull request #1559 from lioncash/vec (diff) | |
| download | yuzu-426c4a2a5b65ce04a767e4c514aafc182b8d5a56.tar.gz yuzu-426c4a2a5b65ce04a767e4c514aafc182b8d5a56.tar.xz yuzu-426c4a2a5b65ce04a767e4c514aafc182b8d5a56.zip | |
Add Configure widget
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra_qt/CMakeLists.txt | 15 | ||||
| -rw-r--r-- | src/citra_qt/configure.ui | 109 | ||||
| -rw-r--r-- | src/citra_qt/configure_debug.cpp | 33 | ||||
| -rw-r--r-- | src/citra_qt/configure_debug.h | 31 | ||||
| -rw-r--r-- | src/citra_qt/configure_debug.ui | 76 | ||||
| -rw-r--r-- | src/citra_qt/configure_dialog.cpp | 32 | ||||
| -rw-r--r-- | src/citra_qt/configure_dialog.h | 31 | ||||
| -rw-r--r-- | src/citra_qt/configure_general.cpp | 40 | ||||
| -rw-r--r-- | src/citra_qt/configure_general.h | 31 | ||||
| -rw-r--r-- | src/citra_qt/configure_general.ui | 96 | ||||
| -rw-r--r-- | src/citra_qt/hotkeys.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/hotkeys.h | 2 | ||||
| -rw-r--r-- | src/citra_qt/hotkeys.ui | 47 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 48 | ||||
| -rw-r--r-- | src/citra_qt/main.h | 4 | ||||
| -rw-r--r-- | src/citra_qt/main.ui | 51 | ||||
| -rw-r--r-- | src/citra_qt/ui_settings.cpp | 11 | ||||
| -rw-r--r-- | src/citra_qt/ui_settings.h | 16 |
18 files changed, 533 insertions, 142 deletions
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 9b3eb2cd6..6660d9879 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt | |||
| @@ -17,12 +17,16 @@ set(SRCS | |||
| 17 | debugger/profiler.cpp | 17 | debugger/profiler.cpp |
| 18 | debugger/ramview.cpp | 18 | debugger/ramview.cpp |
| 19 | debugger/registers.cpp | 19 | debugger/registers.cpp |
| 20 | game_list.cpp | ||
| 21 | util/spinbox.cpp | 20 | util/spinbox.cpp |
| 22 | util/util.cpp | 21 | util/util.cpp |
| 23 | bootmanager.cpp | 22 | bootmanager.cpp |
| 23 | configure_debug.cpp | ||
| 24 | configure_dialog.cpp | ||
| 25 | configure_general.cpp | ||
| 26 | game_list.cpp | ||
| 24 | hotkeys.cpp | 27 | hotkeys.cpp |
| 25 | main.cpp | 28 | main.cpp |
| 29 | ui_settings.cpp | ||
| 26 | citra-qt.rc | 30 | citra-qt.rc |
| 27 | Info.plist | 31 | Info.plist |
| 28 | ) | 32 | ) |
| @@ -44,12 +48,16 @@ set(HEADERS | |||
| 44 | debugger/profiler.h | 48 | debugger/profiler.h |
| 45 | debugger/ramview.h | 49 | debugger/ramview.h |
| 46 | debugger/registers.h | 50 | debugger/registers.h |
| 47 | game_list.h | ||
| 48 | util/spinbox.h | 51 | util/spinbox.h |
| 49 | util/util.h | 52 | util/util.h |
| 50 | bootmanager.h | 53 | bootmanager.h |
| 54 | configure_debug.h | ||
| 55 | configure_dialog.h | ||
| 56 | configure_general.h | ||
| 57 | game_list.h | ||
| 51 | hotkeys.h | 58 | hotkeys.h |
| 52 | main.h | 59 | main.h |
| 60 | ui_settings.h | ||
| 53 | version.h | 61 | version.h |
| 54 | ) | 62 | ) |
| 55 | 63 | ||
| @@ -59,6 +67,9 @@ set(UIS | |||
| 59 | debugger/disassembler.ui | 67 | debugger/disassembler.ui |
| 60 | debugger/profiler.ui | 68 | debugger/profiler.ui |
| 61 | debugger/registers.ui | 69 | debugger/registers.ui |
| 70 | configure.ui | ||
| 71 | configure_debug.ui | ||
| 72 | configure_general.ui | ||
| 62 | hotkeys.ui | 73 | hotkeys.ui |
| 63 | main.ui | 74 | main.ui |
| 64 | ) | 75 | ) |
diff --git a/src/citra_qt/configure.ui b/src/citra_qt/configure.ui new file mode 100644 index 000000000..e4ac9a7d8 --- /dev/null +++ b/src/citra_qt/configure.ui | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>ConfigureDialog</class> | ||
| 4 | <widget class="QDialog" name="ConfigureDialog"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>441</width> | ||
| 10 | <height>401</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="minimumSize"> | ||
| 14 | <size> | ||
| 15 | <width>370</width> | ||
| 16 | <height>219</height> | ||
| 17 | </size> | ||
| 18 | </property> | ||
| 19 | <property name="windowTitle"> | ||
| 20 | <string>Dialog</string> | ||
| 21 | </property> | ||
| 22 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
| 23 | <item> | ||
| 24 | <widget class="QTabWidget" name="tabWidget"> | ||
| 25 | <property name="minimumSize"> | ||
| 26 | <size> | ||
| 27 | <width>371</width> | ||
| 28 | <height>221</height> | ||
| 29 | </size> | ||
| 30 | </property> | ||
| 31 | <property name="currentIndex"> | ||
| 32 | <number>0</number> | ||
| 33 | </property> | ||
| 34 | <widget class="ConfigureGeneral" name="generalTab"> | ||
| 35 | <attribute name="title"> | ||
| 36 | <string>General</string> | ||
| 37 | </attribute> | ||
| 38 | </widget> | ||
| 39 | <widget class="QWidget" name="inputTab"> | ||
| 40 | <attribute name="title"> | ||
| 41 | <string>Input</string> | ||
| 42 | </attribute> | ||
| 43 | </widget> | ||
| 44 | <widget class="ConfigureDebug" name="debugTab"> | ||
| 45 | <attribute name="title"> | ||
| 46 | <string>Debug</string> | ||
| 47 | </attribute> | ||
| 48 | </widget> | ||
| 49 | </widget> | ||
| 50 | </item> | ||
| 51 | <item> | ||
| 52 | <widget class="QDialogButtonBox" name="buttonBox"> | ||
| 53 | <property name="standardButtons"> | ||
| 54 | <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
| 55 | </property> | ||
| 56 | </widget> | ||
| 57 | </item> | ||
| 58 | </layout> | ||
| 59 | </widget> | ||
| 60 | <customwidgets> | ||
| 61 | <customwidget> | ||
| 62 | <class>ConfigureGeneral</class> | ||
| 63 | <extends>QWidget</extends> | ||
| 64 | <header>configure_general.h</header> | ||
| 65 | <container>1</container> | ||
| 66 | </customwidget> | ||
| 67 | <customwidget> | ||
| 68 | <class>ConfigureDebug</class> | ||
| 69 | <extends>QWidget</extends> | ||
| 70 | <header>configure_debug.h</header> | ||
| 71 | <container>1</container> | ||
| 72 | </customwidget> | ||
| 73 | </customwidgets> | ||
| 74 | <resources/> | ||
| 75 | <connections> | ||
| 76 | <connection> | ||
| 77 | <sender>buttonBox</sender> | ||
| 78 | <signal>accepted()</signal> | ||
| 79 | <receiver>ConfigureDialog</receiver> | ||
| 80 | <slot>accept()</slot> | ||
| 81 | <hints> | ||
| 82 | <hint type="sourcelabel"> | ||
| 83 | <x>220</x> | ||
| 84 | <y>380</y> | ||
| 85 | </hint> | ||
| 86 | <hint type="destinationlabel"> | ||
| 87 | <x>220</x> | ||
| 88 | <y>200</y> | ||
| 89 | </hint> | ||
| 90 | </hints> | ||
| 91 | </connection> | ||
| 92 | <connection> | ||
| 93 | <sender>buttonBox</sender> | ||
| 94 | <signal>rejected()</signal> | ||
| 95 | <receiver>ConfigureDialog</receiver> | ||
| 96 | <slot>reject()</slot> | ||
| 97 | <hints> | ||
| 98 | <hint type="sourcelabel"> | ||
| 99 | <x>220</x> | ||
| 100 | <y>380</y> | ||
| 101 | </hint> | ||
| 102 | <hint type="destinationlabel"> | ||
| 103 | <x>220</x> | ||
| 104 | <y>200</y> | ||
| 105 | </hint> | ||
| 106 | </hints> | ||
| 107 | </connection> | ||
| 108 | </connections> | ||
| 109 | </ui> | ||
diff --git a/src/citra_qt/configure_debug.cpp b/src/citra_qt/configure_debug.cpp new file mode 100644 index 000000000..f8ff804b2 --- /dev/null +++ b/src/citra_qt/configure_debug.cpp | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/core.h" | ||
| 6 | #include "core/gdbstub/gdbstub.h" // TODO: can't include gdbstub without core.h | ||
| 7 | #include "core/settings.h" | ||
| 8 | |||
| 9 | #include "configure_debug.h" | ||
| 10 | #include "ui_configure_debug.h" | ||
| 11 | |||
| 12 | ConfigureDebug::ConfigureDebug(QWidget *parent) : | ||
| 13 | QWidget(parent), | ||
| 14 | ui(new Ui::ConfigureDebug) | ||
| 15 | { | ||
| 16 | ui->setupUi(this); | ||
| 17 | this->setConfiguration(); | ||
| 18 | } | ||
| 19 | |||
| 20 | ConfigureDebug::~ConfigureDebug() { | ||
| 21 | delete ui; | ||
| 22 | } | ||
| 23 | |||
| 24 | void ConfigureDebug::setConfiguration() { | ||
| 25 | ui->toogleGDBStub->setChecked(Settings::values.use_gdbstub); | ||
| 26 | ui->GDBPortSpinBox->setValue(Settings::values.gdbstub_port); | ||
| 27 | } | ||
| 28 | |||
| 29 | void ConfigureDebug::applyConfiguration() { | ||
| 30 | GDBStub::ToggleServer(ui->toogleGDBStub->isChecked()); | ||
| 31 | Settings::values.use_gdbstub = ui->toogleGDBStub->isChecked(); | ||
| 32 | Settings::values.gdbstub_port = ui->GDBPortSpinBox->value(); | ||
| 33 | } | ||
diff --git a/src/citra_qt/configure_debug.h b/src/citra_qt/configure_debug.h new file mode 100644 index 000000000..9b7080d92 --- /dev/null +++ b/src/citra_qt/configure_debug.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #ifndef CONFIGURE_DEBUG_H | ||
| 6 | #define CONFIGURE_DEBUG_H | ||
| 7 | |||
| 8 | #include <QWidget> | ||
| 9 | |||
| 10 | namespace Ui { | ||
| 11 | class ConfigureDebug; | ||
| 12 | } | ||
| 13 | |||
| 14 | class ConfigureDebug : public QWidget | ||
| 15 | { | ||
| 16 | Q_OBJECT | ||
| 17 | |||
| 18 | public: | ||
| 19 | explicit ConfigureDebug(QWidget *parent = 0); | ||
| 20 | ~ConfigureDebug(); | ||
| 21 | |||
| 22 | void applyConfiguration(); | ||
| 23 | |||
| 24 | private: | ||
| 25 | void setConfiguration(); | ||
| 26 | |||
| 27 | private: | ||
| 28 | Ui::ConfigureDebug *ui; | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif // CONFIGURE_DEBUG_H | ||
diff --git a/src/citra_qt/configure_debug.ui b/src/citra_qt/configure_debug.ui new file mode 100644 index 000000000..80acf6e31 --- /dev/null +++ b/src/citra_qt/configure_debug.ui | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>ConfigureDebug</class> | ||
| 4 | <widget class="QWidget" name="ConfigureDebug"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>400</width> | ||
| 10 | <height>300</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>Form</string> | ||
| 15 | </property> | ||
| 16 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
| 17 | <item> | ||
| 18 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
| 19 | <item> | ||
| 20 | <widget class="QGroupBox" name="groupBox"> | ||
| 21 | <property name="title"> | ||
| 22 | <string>GDB</string> | ||
| 23 | </property> | ||
| 24 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
| 25 | <item> | ||
| 26 | <layout class="QVBoxLayout" name="verticalLayout_2"> | ||
| 27 | <item> | ||
| 28 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | ||
| 29 | <item> | ||
| 30 | <widget class="QCheckBox" name="toogleGDBStub"> | ||
| 31 | <property name="text"> | ||
| 32 | <string>Enable GDB Stub</string> | ||
| 33 | </property> | ||
| 34 | </widget> | ||
| 35 | </item> | ||
| 36 | <item> | ||
| 37 | <spacer name="horizontalSpacer"> | ||
| 38 | <property name="orientation"> | ||
| 39 | <enum>Qt::Horizontal</enum> | ||
| 40 | </property> | ||
| 41 | <property name="sizeHint" stdset="0"> | ||
| 42 | <size> | ||
| 43 | <width>40</width> | ||
| 44 | <height>20</height> | ||
| 45 | </size> | ||
| 46 | </property> | ||
| 47 | </spacer> | ||
| 48 | </item> | ||
| 49 | <item> | ||
| 50 | <widget class="QLabel" name="label"> | ||
| 51 | <property name="text"> | ||
| 52 | <string>Port:</string> | ||
| 53 | </property> | ||
| 54 | </widget> | ||
| 55 | </item> | ||
| 56 | <item> | ||
| 57 | <widget class="QSpinBox" name="GDBPortSpinBox"> | ||
| 58 | <property name="maximum"> | ||
| 59 | <number>65536</number> | ||
| 60 | </property> | ||
| 61 | </widget> | ||
| 62 | </item> | ||
| 63 | </layout> | ||
| 64 | </item> | ||
| 65 | </layout> | ||
| 66 | </item> | ||
| 67 | </layout> | ||
| 68 | </widget> | ||
| 69 | </item> | ||
| 70 | </layout> | ||
| 71 | </item> | ||
| 72 | </layout> | ||
| 73 | </widget> | ||
| 74 | <resources/> | ||
| 75 | <connections/> | ||
| 76 | </ui> | ||
diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configure_dialog.cpp new file mode 100644 index 000000000..ae442adcd --- /dev/null +++ b/src/citra_qt/configure_dialog.cpp | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "configure_dialog.h" | ||
| 6 | #include "ui_configure.h" | ||
| 7 | |||
| 8 | #include "config.h" | ||
| 9 | |||
| 10 | #include "core/settings.h" | ||
| 11 | |||
| 12 | ConfigureDialog::ConfigureDialog(QWidget *parent) : | ||
| 13 | QDialog(parent), | ||
| 14 | ui(new Ui::ConfigureDialog) | ||
| 15 | { | ||
| 16 | ui->setupUi(this); | ||
| 17 | this->setConfiguration(); | ||
| 18 | } | ||
| 19 | |||
| 20 | ConfigureDialog::~ConfigureDialog() { | ||
| 21 | delete ui; | ||
| 22 | } | ||
| 23 | |||
| 24 | void ConfigureDialog::setConfiguration() { | ||
| 25 | } | ||
| 26 | |||
| 27 | void ConfigureDialog::applyConfiguration() { | ||
| 28 | Config config; | ||
| 29 | ui->generalTab->applyConfiguration(); | ||
| 30 | ui->debugTab->applyConfiguration(); | ||
| 31 | config.Save(); | ||
| 32 | } | ||
diff --git a/src/citra_qt/configure_dialog.h b/src/citra_qt/configure_dialog.h new file mode 100644 index 000000000..d66049340 --- /dev/null +++ b/src/citra_qt/configure_dialog.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #ifndef CONFIGURE_DIALOG_H | ||
| 6 | #define CONFIGURE_DIALOG_H | ||
| 7 | |||
| 8 | #include <QDialog> | ||
| 9 | |||
| 10 | namespace Ui { | ||
| 11 | class ConfigureDialog; | ||
| 12 | } | ||
| 13 | |||
| 14 | class ConfigureDialog : public QDialog | ||
| 15 | { | ||
| 16 | Q_OBJECT | ||
| 17 | |||
| 18 | public: | ||
| 19 | explicit ConfigureDialog(QWidget *parent = 0); | ||
| 20 | ~ConfigureDialog(); | ||
| 21 | |||
| 22 | void applyConfiguration(); | ||
| 23 | |||
| 24 | private: | ||
| 25 | void setConfiguration(); | ||
| 26 | |||
| 27 | private: | ||
| 28 | Ui::ConfigureDialog *ui; | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif // CONFIGURE_DIALOG_H | ||
diff --git a/src/citra_qt/configure_general.cpp b/src/citra_qt/configure_general.cpp new file mode 100644 index 000000000..71d992ebe --- /dev/null +++ b/src/citra_qt/configure_general.cpp | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "citra_qt/configure_general.h" | ||
| 6 | #include "citra_qt/ui_configure_general.h" | ||
| 7 | #include "citra_qt/ui_settings.h" | ||
| 8 | |||
| 9 | #include "core/settings.h" | ||
| 10 | |||
| 11 | #include "video_core/video_core.h" | ||
| 12 | |||
| 13 | ConfigureGeneral::ConfigureGeneral(QWidget *parent) : | ||
| 14 | QWidget(parent), | ||
| 15 | ui(new Ui::ConfigureGeneral) | ||
| 16 | { | ||
| 17 | ui->setupUi(this); | ||
| 18 | this->setConfiguration(); | ||
| 19 | } | ||
| 20 | |||
| 21 | ConfigureGeneral::~ConfigureGeneral() | ||
| 22 | { | ||
| 23 | delete ui; | ||
| 24 | } | ||
| 25 | |||
| 26 | void ConfigureGeneral::setConfiguration() { | ||
| 27 | ui->toogleCheckExit->setChecked(UISettings::values.check_closure); | ||
| 28 | ui->toogleHWRenderer->setChecked(Settings::values.use_hw_renderer); | ||
| 29 | ui->toogleShaderJIT->setChecked(Settings::values.use_shader_jit); | ||
| 30 | } | ||
| 31 | |||
| 32 | void ConfigureGeneral::applyConfiguration() { | ||
| 33 | UISettings::values.check_closure = ui->toogleCheckExit->isChecked(); | ||
| 34 | |||
| 35 | VideoCore::g_hw_renderer_enabled = | ||
| 36 | Settings::values.use_hw_renderer = ui->toogleHWRenderer->isChecked(); | ||
| 37 | |||
| 38 | VideoCore::g_shader_jit_enabled = | ||
| 39 | Settings::values.use_shader_jit = ui->toogleShaderJIT->isChecked(); | ||
| 40 | } | ||
diff --git a/src/citra_qt/configure_general.h b/src/citra_qt/configure_general.h new file mode 100644 index 000000000..0f3b69332 --- /dev/null +++ b/src/citra_qt/configure_general.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #ifndef CONFIGURE_GENERAL_H | ||
| 6 | #define CONFIGURE_GENERAL_H | ||
| 7 | |||
| 8 | #include <QWidget> | ||
| 9 | |||
| 10 | namespace Ui { | ||
| 11 | class ConfigureGeneral; | ||
| 12 | } | ||
| 13 | |||
| 14 | class ConfigureGeneral : public QWidget | ||
| 15 | { | ||
| 16 | Q_OBJECT | ||
| 17 | |||
| 18 | public: | ||
| 19 | explicit ConfigureGeneral(QWidget *parent = 0); | ||
| 20 | ~ConfigureGeneral(); | ||
| 21 | |||
| 22 | void applyConfiguration(); | ||
| 23 | |||
| 24 | private: | ||
| 25 | void setConfiguration(); | ||
| 26 | |||
| 27 | private: | ||
| 28 | Ui::ConfigureGeneral *ui; | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif // CONFIGURE_GENERAL_H | ||
diff --git a/src/citra_qt/configure_general.ui b/src/citra_qt/configure_general.ui new file mode 100644 index 000000000..f847d3c6c --- /dev/null +++ b/src/citra_qt/configure_general.ui | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>ConfigureGeneral</class> | ||
| 4 | <widget class="QWidget" name="ConfigureGeneral"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>284</width> | ||
| 10 | <height>377</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>Form</string> | ||
| 15 | </property> | ||
| 16 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
| 17 | <item> | ||
| 18 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
| 19 | <item> | ||
| 20 | <widget class="QGroupBox" name="groupBox"> | ||
| 21 | <property name="title"> | ||
| 22 | <string>General</string> | ||
| 23 | </property> | ||
| 24 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | ||
| 25 | <item> | ||
| 26 | <layout class="QVBoxLayout" name="verticalLayout_2"> | ||
| 27 | <item> | ||
| 28 | <widget class="QCheckBox" name="toogleCheckExit"> | ||
| 29 | <property name="text"> | ||
| 30 | <string>Confirm exit while emulation is running</string> | ||
| 31 | </property> | ||
| 32 | </widget> | ||
| 33 | </item> | ||
| 34 | </layout> | ||
| 35 | </item> | ||
| 36 | </layout> | ||
| 37 | </widget> | ||
| 38 | </item> | ||
| 39 | <item> | ||
| 40 | <widget class="QGroupBox" name="groupBox_2"> | ||
| 41 | <property name="title"> | ||
| 42 | <string>Performance</string> | ||
| 43 | </property> | ||
| 44 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
| 45 | <item> | ||
| 46 | <layout class="QVBoxLayout" name="verticalLayout_3"> | ||
| 47 | <item> | ||
| 48 | <widget class="QCheckBox" name="toogleHWRenderer"> | ||
| 49 | <property name="text"> | ||
| 50 | <string>Enable hardware renderer</string> | ||
| 51 | </property> | ||
| 52 | </widget> | ||
| 53 | </item> | ||
| 54 | <item> | ||
| 55 | <widget class="QCheckBox" name="toogleShaderJIT"> | ||
| 56 | <property name="text"> | ||
| 57 | <string>Enable Shader JIT</string> | ||
| 58 | </property> | ||
| 59 | </widget> | ||
| 60 | </item> | ||
| 61 | </layout> | ||
| 62 | </item> | ||
| 63 | </layout> | ||
| 64 | </widget> | ||
| 65 | </item> | ||
| 66 | <item> | ||
| 67 | <widget class="QGroupBox" name="groupBox_3"> | ||
| 68 | <property name="title"> | ||
| 69 | <string>Hotkeys</string> | ||
| 70 | </property> | ||
| 71 | <layout class="QHBoxLayout" name="horizontalLayout_4"> | ||
| 72 | <item> | ||
| 73 | <layout class="QVBoxLayout" name="verticalLayout_4"> | ||
| 74 | <item> | ||
| 75 | <widget class="GHotkeysDialog" name="widget" native="true"/> | ||
| 76 | </item> | ||
| 77 | </layout> | ||
| 78 | </item> | ||
| 79 | </layout> | ||
| 80 | </widget> | ||
| 81 | </item> | ||
| 82 | </layout> | ||
| 83 | </item> | ||
| 84 | </layout> | ||
| 85 | </widget> | ||
| 86 | <customwidgets> | ||
| 87 | <customwidget> | ||
| 88 | <class>GHotkeysDialog</class> | ||
| 89 | <extends>QWidget</extends> | ||
| 90 | <header>hotkeys.h</header> | ||
| 91 | <container>1</container> | ||
| 92 | </customwidget> | ||
| 93 | </customwidgets> | ||
| 94 | <resources/> | ||
| 95 | <connections/> | ||
| 96 | </ui> | ||
diff --git a/src/citra_qt/hotkeys.cpp b/src/citra_qt/hotkeys.cpp index ed6b12fc4..929ba6f0e 100644 --- a/src/citra_qt/hotkeys.cpp +++ b/src/citra_qt/hotkeys.cpp | |||
| @@ -94,7 +94,7 @@ QShortcut* GetHotkey(const QString& group, const QString& action, QWidget* widge | |||
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | 96 | ||
| 97 | GHotkeysDialog::GHotkeysDialog(QWidget* parent): QDialog(parent) | 97 | GHotkeysDialog::GHotkeysDialog(QWidget* parent): QWidget(parent) |
| 98 | { | 98 | { |
| 99 | ui.setupUi(this); | 99 | ui.setupUi(this); |
| 100 | 100 | ||
diff --git a/src/citra_qt/hotkeys.h b/src/citra_qt/hotkeys.h index 2fe635882..50e6cbc21 100644 --- a/src/citra_qt/hotkeys.h +++ b/src/citra_qt/hotkeys.h | |||
| @@ -42,7 +42,7 @@ void SaveHotkeys(QSettings& settings); | |||
| 42 | */ | 42 | */ |
| 43 | void LoadHotkeys(QSettings& settings); | 43 | void LoadHotkeys(QSettings& settings); |
| 44 | 44 | ||
| 45 | class GHotkeysDialog : public QDialog | 45 | class GHotkeysDialog : public QWidget |
| 46 | { | 46 | { |
| 47 | Q_OBJECT | 47 | Q_OBJECT |
| 48 | 48 | ||
diff --git a/src/citra_qt/hotkeys.ui b/src/citra_qt/hotkeys.ui index 38a9a14d1..050fe064e 100644 --- a/src/citra_qt/hotkeys.ui +++ b/src/citra_qt/hotkeys.ui | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <ui version="4.0"> | 2 | <ui version="4.0"> |
| 3 | <class>hotkeys</class> | 3 | <class>hotkeys</class> |
| 4 | <widget class="QDialog" name="hotkeys"> | 4 | <widget class="QWidget" name="hotkeys"> |
| 5 | <property name="geometry"> | 5 | <property name="geometry"> |
| 6 | <rect> | 6 | <rect> |
| 7 | <x>0</x> | 7 | <x>0</x> |
| @@ -39,51 +39,8 @@ | |||
| 39 | </column> | 39 | </column> |
| 40 | </widget> | 40 | </widget> |
| 41 | </item> | 41 | </item> |
| 42 | <item> | ||
| 43 | <widget class="QDialogButtonBox" name="buttonBox"> | ||
| 44 | <property name="orientation"> | ||
| 45 | <enum>Qt::Horizontal</enum> | ||
| 46 | </property> | ||
| 47 | <property name="standardButtons"> | ||
| 48 | <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set> | ||
| 49 | </property> | ||
| 50 | </widget> | ||
| 51 | </item> | ||
| 52 | </layout> | 42 | </layout> |
| 53 | </widget> | 43 | </widget> |
| 54 | <resources/> | 44 | <resources/> |
| 55 | <connections> | 45 | <connections/> |
| 56 | <connection> | ||
| 57 | <sender>buttonBox</sender> | ||
| 58 | <signal>accepted()</signal> | ||
| 59 | <receiver>hotkeys</receiver> | ||
| 60 | <slot>accept()</slot> | ||
| 61 | <hints> | ||
| 62 | <hint type="sourcelabel"> | ||
| 63 | <x>248</x> | ||
| 64 | <y>254</y> | ||
| 65 | </hint> | ||
| 66 | <hint type="destinationlabel"> | ||
| 67 | <x>157</x> | ||
| 68 | <y>274</y> | ||
| 69 | </hint> | ||
| 70 | </hints> | ||
| 71 | </connection> | ||
| 72 | <connection> | ||
| 73 | <sender>buttonBox</sender> | ||
| 74 | <signal>rejected()</signal> | ||
| 75 | <receiver>hotkeys</receiver> | ||
| 76 | <slot>reject()</slot> | ||
| 77 | <hints> | ||
| 78 | <hint type="sourcelabel"> | ||
| 79 | <x>316</x> | ||
| 80 | <y>260</y> | ||
| 81 | </hint> | ||
| 82 | <hint type="destinationlabel"> | ||
| 83 | <x>286</x> | ||
| 84 | <y>274</y> | ||
| 85 | </hint> | ||
| 86 | </hints> | ||
| 87 | </connection> | ||
| 88 | </connections> | ||
| 89 | </ui> | 46 | </ui> |
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 | ||
| 499 | void GMainWindow::OnOpenHotkeysDialog() { | ||
| 500 | GHotkeysDialog dialog(this); | ||
| 501 | dialog.exec(); | ||
| 502 | } | ||
| 503 | |||
| 504 | void 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 | |||
| 512 | void GMainWindow::SetGdbstubEnabled(bool enabled) { | ||
| 513 | GDBStub::ToggleServer(enabled); | ||
| 514 | } | ||
| 515 | |||
| 516 | void 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 | |||
| 524 | void GMainWindow::ToggleWindowMode() { | 489 | void 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 | ||
| 549 | void GMainWindow::OnConfigure() { | 514 | void 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 | ||
| 553 | bool GMainWindow::ConfirmClose() { | 523 | bool GMainWindow::ConfirmClose() { |
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 6e4e56689..7fe425b40 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h | |||
| @@ -104,12 +104,8 @@ private slots: | |||
| 104 | /// Called whenever a user selects the "File->Select Game List Root" menu item | 104 | /// Called whenever a user selects the "File->Select Game List Root" menu item |
| 105 | void OnMenuSelectGameListRoot(); | 105 | void OnMenuSelectGameListRoot(); |
| 106 | void OnMenuRecentFile(); | 106 | void OnMenuRecentFile(); |
| 107 | void OnOpenHotkeysDialog(); | ||
| 108 | void OnConfigure(); | 107 | void OnConfigure(); |
| 109 | void OnDisplayTitleBars(bool); | 108 | void OnDisplayTitleBars(bool); |
| 110 | void SetHardwareRendererEnabled(bool); | ||
| 111 | void SetGdbstubEnabled(bool); | ||
| 112 | void SetShaderJITEnabled(bool); | ||
| 113 | void ToggleWindowMode(); | 109 | void ToggleWindowMode(); |
| 114 | 110 | ||
| 115 | private: | 111 | private: |
diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.ui index 1e8a07cfb..441e0b81e 100644 --- a/src/citra_qt/main.ui +++ b/src/citra_qt/main.ui | |||
| @@ -45,7 +45,7 @@ | |||
| 45 | <x>0</x> | 45 | <x>0</x> |
| 46 | <y>0</y> | 46 | <y>0</y> |
| 47 | <width>1081</width> | 47 | <width>1081</width> |
| 48 | <height>22</height> | 48 | <height>19</height> |
| 49 | </rect> | 49 | </rect> |
| 50 | </property> | 50 | </property> |
| 51 | <widget class="QMenu" name="menu_File"> | 51 | <widget class="QMenu" name="menu_File"> |
| @@ -73,9 +73,6 @@ | |||
| 73 | <addaction name="action_Pause"/> | 73 | <addaction name="action_Pause"/> |
| 74 | <addaction name="action_Stop"/> | 74 | <addaction name="action_Stop"/> |
| 75 | <addaction name="separator"/> | 75 | <addaction name="separator"/> |
| 76 | <addaction name="action_Use_Hardware_Renderer"/> | ||
| 77 | <addaction name="action_Use_Shader_JIT"/> | ||
| 78 | <addaction name="action_Use_Gdbstub"/> | ||
| 79 | <addaction name="action_Configure"/> | 76 | <addaction name="action_Configure"/> |
| 80 | </widget> | 77 | </widget> |
| 81 | <widget class="QMenu" name="menu_View"> | 78 | <widget class="QMenu" name="menu_View"> |
| @@ -84,7 +81,6 @@ | |||
| 84 | </property> | 81 | </property> |
| 85 | <addaction name="action_Single_Window_Mode"/> | 82 | <addaction name="action_Single_Window_Mode"/> |
| 86 | <addaction name="actionDisplay_widget_title_bars"/> | 83 | <addaction name="actionDisplay_widget_title_bars"/> |
| 87 | <addaction name="action_Hotkeys"/> | ||
| 88 | </widget> | 84 | </widget> |
| 89 | <widget class="QMenu" name="menu_Help"> | 85 | <widget class="QMenu" name="menu_Help"> |
| 90 | <property name="title"> | 86 | <property name="title"> |
| @@ -150,35 +146,6 @@ | |||
| 150 | <string>Single Window Mode</string> | 146 | <string>Single Window Mode</string> |
| 151 | </property> | 147 | </property> |
| 152 | </action> | 148 | </action> |
| 153 | <action name="action_Hotkeys"> | ||
| 154 | <property name="text"> | ||
| 155 | <string>Configure &Hotkeys ...</string> | ||
| 156 | </property> | ||
| 157 | </action> | ||
| 158 | <action name="action_Use_Hardware_Renderer"> | ||
| 159 | <property name="checkable"> | ||
| 160 | <bool>true</bool> | ||
| 161 | </property> | ||
| 162 | <property name="text"> | ||
| 163 | <string>Use Hardware Renderer</string> | ||
| 164 | </property> | ||
| 165 | </action> | ||
| 166 | <action name="action_Use_Shader_JIT"> | ||
| 167 | <property name="checkable"> | ||
| 168 | <bool>true</bool> | ||
| 169 | </property> | ||
| 170 | <property name="text"> | ||
| 171 | <string>Use Shader JIT</string> | ||
| 172 | </property> | ||
| 173 | </action> | ||
| 174 | <action name="action_Use_Gdbstub"> | ||
| 175 | <property name="checkable"> | ||
| 176 | <bool>true</bool> | ||
| 177 | </property> | ||
| 178 | <property name="text"> | ||
| 179 | <string>Use Gdbstub</string> | ||
| 180 | </property> | ||
| 181 | </action> | ||
| 182 | <action name="action_Configure"> | 149 | <action name="action_Configure"> |
| 183 | <property name="text"> | 150 | <property name="text"> |
| 184 | <string>Configure ...</string> | 151 | <string>Configure ...</string> |
| @@ -220,22 +187,6 @@ | |||
| 220 | </hints> | 187 | </hints> |
| 221 | </connection> | 188 | </connection> |
| 222 | <connection> | 189 | <connection> |
| 223 | <sender>action_Configure</sender> | ||
| 224 | <signal>triggered()</signal> | ||
| 225 | <receiver>MainWindow</receiver> | ||
| 226 | <slot>OnConfigure()</slot> | ||
| 227 | <hints> | ||
| 228 | <hint type="sourcelabel"> | ||
| 229 | <x>-1</x> | ||
| 230 | <y>-1</y> | ||
| 231 | </hint> | ||
| 232 | <hint type="destinationlabel"> | ||
| 233 | <x>540</x> | ||
| 234 | <y>364</y> | ||
| 235 | </hint> | ||
| 236 | </hints> | ||
| 237 | </connection> | ||
| 238 | <connection> | ||
| 239 | <sender>actionDisplay_widget_title_bars</sender> | 190 | <sender>actionDisplay_widget_title_bars</sender> |
| 240 | <signal>triggered(bool)</signal> | 191 | <signal>triggered(bool)</signal> |
| 241 | <receiver>MainWindow</receiver> | 192 | <receiver>MainWindow</receiver> |
diff --git a/src/citra_qt/ui_settings.cpp b/src/citra_qt/ui_settings.cpp new file mode 100644 index 000000000..5f2215899 --- /dev/null +++ b/src/citra_qt/ui_settings.cpp | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "ui_settings.h" | ||
| 6 | |||
| 7 | namespace UISettings { | ||
| 8 | |||
| 9 | Values values = {}; | ||
| 10 | |||
| 11 | } | ||
diff --git a/src/citra_qt/ui_settings.h b/src/citra_qt/ui_settings.h new file mode 100644 index 000000000..f0afbf2d3 --- /dev/null +++ b/src/citra_qt/ui_settings.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #ifndef UISETTINGS_H | ||
| 6 | #define UISETTINGS_H | ||
| 7 | |||
| 8 | namespace UISettings { | ||
| 9 | |||
| 10 | struct Values { | ||
| 11 | bool check_closure; | ||
| 12 | } extern values; | ||
| 13 | |||
| 14 | } | ||
| 15 | |||
| 16 | #endif // UISETTINGS_H | ||