diff options
Diffstat (limited to '')
| -rw-r--r-- | src/citra_qt/config.cpp | 22 | ||||
| -rw-r--r-- | src/citra_qt/configure.ui | 4 | ||||
| -rw-r--r-- | src/citra_qt/configure_debug.cpp | 21 | ||||
| -rw-r--r-- | src/citra_qt/configure_debug.h | 10 | ||||
| -rw-r--r-- | src/citra_qt/configure_debug.ui | 108 | ||||
| -rw-r--r-- | src/citra_qt/configure_dialog.cpp | 7 | ||||
| -rw-r--r-- | src/citra_qt/configure_dialog.h | 10 | ||||
| -rw-r--r-- | src/citra_qt/configure_general.cpp | 23 | ||||
| -rw-r--r-- | src/citra_qt/configure_general.h | 10 | ||||
| -rw-r--r-- | src/citra_qt/configure_general.ui | 80 | ||||
| -rw-r--r-- | src/citra_qt/hotkeys.cpp | 7 | ||||
| -rw-r--r-- | src/citra_qt/hotkeys.h | 2 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 9 | ||||
| -rw-r--r-- | src/citra_qt/main.h | 1 | ||||
| -rw-r--r-- | src/citra_qt/ui_settings.h | 17 |
15 files changed, 211 insertions, 120 deletions
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 981d92a9c..ecf5c5a75 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp | |||
| @@ -82,24 +82,23 @@ void Config::ReadValues() { | |||
| 82 | qt_config->beginGroup("Paths"); | 82 | qt_config->beginGroup("Paths"); |
| 83 | UISettings::values.roms_path = qt_config->value("romsPath").toString(); | 83 | UISettings::values.roms_path = qt_config->value("romsPath").toString(); |
| 84 | UISettings::values.symbols_path = qt_config->value("symbolsPath").toString(); | 84 | UISettings::values.symbols_path = qt_config->value("symbolsPath").toString(); |
| 85 | UISettings::values.gamedir_path = qt_config->value("gameListRootDir", ".").toString(); | 85 | UISettings::values.gamedir = qt_config->value("gameListRootDir", ".").toString(); |
| 86 | UISettings::values.gamedir_deepscan = qt_config->value("gameListDeepScan", false).toBool(); | 86 | UISettings::values.gamedir_deepscan = qt_config->value("gameListDeepScan", false).toBool(); |
| 87 | UISettings::values.recent_files = qt_config->value("recentFiles").toStringList(); | 87 | UISettings::values.recent_files = qt_config->value("recentFiles").toStringList(); |
| 88 | qt_config->endGroup(); | 88 | qt_config->endGroup(); |
| 89 | 89 | ||
| 90 | qt_config->beginGroup("Shortcuts"); | 90 | qt_config->beginGroup("Shortcuts"); |
| 91 | QStringList groups = qt_config->childGroups(); | 91 | QStringList groups = qt_config->childGroups(); |
| 92 | for (auto group : groups) | 92 | for (auto group : groups) { |
| 93 | { | ||
| 94 | qt_config->beginGroup(group); | 93 | qt_config->beginGroup(group); |
| 95 | 94 | ||
| 96 | QStringList hotkeys = qt_config->childGroups(); | 95 | QStringList hotkeys = qt_config->childGroups(); |
| 97 | for (auto hotkey : hotkeys) | 96 | for (auto hotkey : hotkeys) { |
| 98 | { | ||
| 99 | qt_config->beginGroup(hotkey); | 97 | qt_config->beginGroup(hotkey); |
| 100 | UISettings::values.shortcuts.push_back(UISettings::Shortcut(group + "/" + hotkey, | 98 | UISettings::values.shortcuts.emplace_back( |
| 101 | UISettings::ContextedShortcut(qt_config->value("KeySeq").toString(), | 99 | UISettings::Shortcut(group + "/" + hotkey, |
| 102 | qt_config->value("Context").toInt()))); | 100 | UISettings::ContextualShortcut(qt_config->value("KeySeq").toString(), |
| 101 | qt_config->value("Context").toInt()))); | ||
| 103 | qt_config->endGroup(); | 102 | qt_config->endGroup(); |
| 104 | } | 103 | } |
| 105 | 104 | ||
| @@ -109,6 +108,7 @@ void Config::ReadValues() { | |||
| 109 | 108 | ||
| 110 | UISettings::values.single_window_mode = qt_config->value("singleWindowMode", true).toBool(); | 109 | UISettings::values.single_window_mode = qt_config->value("singleWindowMode", true).toBool(); |
| 111 | UISettings::values.display_titlebar = qt_config->value("displayTitleBars", true).toBool(); | 110 | UISettings::values.display_titlebar = qt_config->value("displayTitleBars", true).toBool(); |
| 111 | UISettings::values.confirm_before_closing = qt_config->value("confirmClose",true).toBool(); | ||
| 112 | UISettings::values.first_start = qt_config->value("firstStart", true).toBool(); | 112 | UISettings::values.first_start = qt_config->value("firstStart", true).toBool(); |
| 113 | 113 | ||
| 114 | qt_config->endGroup(); | 114 | qt_config->endGroup(); |
| @@ -167,14 +167,13 @@ void Config::SaveValues() { | |||
| 167 | qt_config->beginGroup("Paths"); | 167 | qt_config->beginGroup("Paths"); |
| 168 | qt_config->setValue("romsPath", UISettings::values.roms_path); | 168 | qt_config->setValue("romsPath", UISettings::values.roms_path); |
| 169 | qt_config->setValue("symbolsPath", UISettings::values.symbols_path); | 169 | qt_config->setValue("symbolsPath", UISettings::values.symbols_path); |
| 170 | qt_config->setValue("gameListRootDir", UISettings::values.gamedir_path); | 170 | qt_config->setValue("gameListRootDir", UISettings::values.gamedir); |
| 171 | qt_config->setValue("gameListDeepScan", UISettings::values.gamedir_deepscan); | 171 | qt_config->setValue("gameListDeepScan", UISettings::values.gamedir_deepscan); |
| 172 | qt_config->setValue("recentFiles", UISettings::values.recent_files); | 172 | qt_config->setValue("recentFiles", UISettings::values.recent_files); |
| 173 | qt_config->endGroup(); | 173 | qt_config->endGroup(); |
| 174 | 174 | ||
| 175 | qt_config->beginGroup("Shortcuts"); | 175 | qt_config->beginGroup("Shortcuts"); |
| 176 | for (auto shortcut : UISettings::values.shortcuts ) | 176 | for (auto shortcut : UISettings::values.shortcuts ) { |
| 177 | { | ||
| 178 | qt_config->setValue(shortcut.first + "/KeySeq", shortcut.second.first); | 177 | qt_config->setValue(shortcut.first + "/KeySeq", shortcut.second.first); |
| 179 | qt_config->setValue(shortcut.first + "/Context", shortcut.second.second); | 178 | qt_config->setValue(shortcut.first + "/Context", shortcut.second.second); |
| 180 | } | 179 | } |
| @@ -182,6 +181,7 @@ void Config::SaveValues() { | |||
| 182 | 181 | ||
| 183 | qt_config->setValue("singleWindowMode", UISettings::values.single_window_mode); | 182 | qt_config->setValue("singleWindowMode", UISettings::values.single_window_mode); |
| 184 | qt_config->setValue("displayTitleBars", UISettings::values.display_titlebar); | 183 | qt_config->setValue("displayTitleBars", UISettings::values.display_titlebar); |
| 184 | qt_config->setValue("confirmClose", UISettings::values.confirm_before_closing); | ||
| 185 | qt_config->setValue("firstStart", UISettings::values.first_start); | 185 | qt_config->setValue("firstStart", UISettings::values.first_start); |
| 186 | 186 | ||
| 187 | qt_config->endGroup(); | 187 | qt_config->endGroup(); |
diff --git a/src/citra_qt/configure.ui b/src/citra_qt/configure.ui index e4ac9a7d8..3c1f2ebba 100644 --- a/src/citra_qt/configure.ui +++ b/src/citra_qt/configure.ui | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | <x>0</x> | 7 | <x>0</x> |
| 8 | <y>0</y> | 8 | <y>0</y> |
| 9 | <width>441</width> | 9 | <width>441</width> |
| 10 | <height>401</height> | 10 | <height>501</height> |
| 11 | </rect> | 11 | </rect> |
| 12 | </property> | 12 | </property> |
| 13 | <property name="minimumSize"> | 13 | <property name="minimumSize"> |
| @@ -17,7 +17,7 @@ | |||
| 17 | </size> | 17 | </size> |
| 18 | </property> | 18 | </property> |
| 19 | <property name="windowTitle"> | 19 | <property name="windowTitle"> |
| 20 | <string>Dialog</string> | 20 | <string>Citra Configuration</string> |
| 21 | </property> | 21 | </property> |
| 22 | <layout class="QVBoxLayout" name="verticalLayout"> | 22 | <layout class="QVBoxLayout" name="verticalLayout"> |
| 23 | <item> | 23 | <item> |
diff --git a/src/citra_qt/configure_debug.cpp b/src/citra_qt/configure_debug.cpp index f8ff804b2..ba66d0833 100644 --- a/src/citra_qt/configure_debug.cpp +++ b/src/citra_qt/configure_debug.cpp | |||
| @@ -2,13 +2,12 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/core.h" | 5 | #include "citra_qt/configure_debug.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" | 6 | #include "ui_configure_debug.h" |
| 11 | 7 | ||
| 8 | #include "core/gdbstub/gdbstub.h" | ||
| 9 | #include "core/settings.h" | ||
| 10 | |||
| 12 | ConfigureDebug::ConfigureDebug(QWidget *parent) : | 11 | ConfigureDebug::ConfigureDebug(QWidget *parent) : |
| 13 | QWidget(parent), | 12 | QWidget(parent), |
| 14 | ui(new Ui::ConfigureDebug) | 13 | ui(new Ui::ConfigureDebug) |
| @@ -18,16 +17,16 @@ ConfigureDebug::ConfigureDebug(QWidget *parent) : | |||
| 18 | } | 17 | } |
| 19 | 18 | ||
| 20 | ConfigureDebug::~ConfigureDebug() { | 19 | ConfigureDebug::~ConfigureDebug() { |
| 21 | delete ui; | ||
| 22 | } | 20 | } |
| 23 | 21 | ||
| 24 | void ConfigureDebug::setConfiguration() { | 22 | void ConfigureDebug::setConfiguration() { |
| 25 | ui->toogleGDBStub->setChecked(Settings::values.use_gdbstub); | 23 | ui->toogle_gdbstub->setChecked(Settings::values.use_gdbstub); |
| 26 | ui->GDBPortSpinBox->setValue(Settings::values.gdbstub_port); | 24 | ui->gdbport_spinbox->setEnabled(Settings::values.use_gdbstub); |
| 25 | ui->gdbport_spinbox->setValue(Settings::values.gdbstub_port); | ||
| 27 | } | 26 | } |
| 28 | 27 | ||
| 29 | void ConfigureDebug::applyConfiguration() { | 28 | void ConfigureDebug::applyConfiguration() { |
| 30 | GDBStub::ToggleServer(ui->toogleGDBStub->isChecked()); | 29 | GDBStub::ToggleServer(ui->toogle_gdbstub->isChecked()); |
| 31 | Settings::values.use_gdbstub = ui->toogleGDBStub->isChecked(); | 30 | Settings::values.use_gdbstub = ui->toogle_gdbstub->isChecked(); |
| 32 | Settings::values.gdbstub_port = ui->GDBPortSpinBox->value(); | 31 | Settings::values.gdbstub_port = ui->gdbport_spinbox->value(); |
| 33 | } | 32 | } |
diff --git a/src/citra_qt/configure_debug.h b/src/citra_qt/configure_debug.h index 9b7080d92..ab58ebbdc 100644 --- a/src/citra_qt/configure_debug.h +++ b/src/citra_qt/configure_debug.h | |||
| @@ -2,9 +2,9 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #ifndef CONFIGURE_DEBUG_H | 5 | #pragma once |
| 6 | #define CONFIGURE_DEBUG_H | ||
| 7 | 6 | ||
| 7 | #include <memory> | ||
| 8 | #include <QWidget> | 8 | #include <QWidget> |
| 9 | 9 | ||
| 10 | namespace Ui { | 10 | namespace Ui { |
| @@ -16,7 +16,7 @@ class ConfigureDebug : public QWidget | |||
| 16 | Q_OBJECT | 16 | Q_OBJECT |
| 17 | 17 | ||
| 18 | public: | 18 | public: |
| 19 | explicit ConfigureDebug(QWidget *parent = 0); | 19 | explicit ConfigureDebug(QWidget *parent = nullptr); |
| 20 | ~ConfigureDebug(); | 20 | ~ConfigureDebug(); |
| 21 | 21 | ||
| 22 | void applyConfiguration(); | 22 | void applyConfiguration(); |
| @@ -25,7 +25,5 @@ private: | |||
| 25 | void setConfiguration(); | 25 | void setConfiguration(); |
| 26 | 26 | ||
| 27 | private: | 27 | private: |
| 28 | Ui::ConfigureDebug *ui; | 28 | std::unique_ptr<Ui::ConfigureDebug> ui; |
| 29 | }; | 29 | }; |
| 30 | |||
| 31 | #endif // CONFIGURE_DEBUG_H | ||
diff --git a/src/citra_qt/configure_debug.ui b/src/citra_qt/configure_debug.ui index 80acf6e31..3ba7f44da 100644 --- a/src/citra_qt/configure_debug.ui +++ b/src/citra_qt/configure_debug.ui | |||
| @@ -13,54 +13,50 @@ | |||
| 13 | <property name="windowTitle"> | 13 | <property name="windowTitle"> |
| 14 | <string>Form</string> | 14 | <string>Form</string> |
| 15 | </property> | 15 | </property> |
| 16 | <layout class="QHBoxLayout" name="horizontalLayout"> | 16 | <layout class="QVBoxLayout" name="verticalLayout"> |
| 17 | <item> | 17 | <item> |
| 18 | <layout class="QVBoxLayout" name="verticalLayout"> | 18 | <layout class="QVBoxLayout" name="verticalLayout_3"> |
| 19 | <item> | 19 | <item> |
| 20 | <widget class="QGroupBox" name="groupBox"> | 20 | <widget class="QGroupBox" name="groupBox"> |
| 21 | <property name="title"> | 21 | <property name="title"> |
| 22 | <string>GDB</string> | 22 | <string>GDB</string> |
| 23 | </property> | 23 | </property> |
| 24 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | 24 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
| 25 | <item> | 25 | <item> |
| 26 | <layout class="QVBoxLayout" name="verticalLayout_2"> | 26 | <layout class="QHBoxLayout" name="horizontalLayout_3"> |
| 27 | <item> | 27 | <item> |
| 28 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | 28 | <widget class="QCheckBox" name="toogle_gdbstub"> |
| 29 | <item> | 29 | <property name="text"> |
| 30 | <widget class="QCheckBox" name="toogleGDBStub"> | 30 | <string>Enable GDB Stub</string> |
| 31 | <property name="text"> | 31 | </property> |
| 32 | <string>Enable GDB Stub</string> | 32 | </widget> |
| 33 | </property> | 33 | </item> |
| 34 | </widget> | 34 | <item> |
| 35 | </item> | 35 | <spacer name="horizontalSpacer"> |
| 36 | <item> | 36 | <property name="orientation"> |
| 37 | <spacer name="horizontalSpacer"> | 37 | <enum>Qt::Horizontal</enum> |
| 38 | <property name="orientation"> | 38 | </property> |
| 39 | <enum>Qt::Horizontal</enum> | 39 | <property name="sizeHint" stdset="0"> |
| 40 | </property> | 40 | <size> |
| 41 | <property name="sizeHint" stdset="0"> | 41 | <width>40</width> |
| 42 | <size> | 42 | <height>20</height> |
| 43 | <width>40</width> | 43 | </size> |
| 44 | <height>20</height> | 44 | </property> |
| 45 | </size> | 45 | </spacer> |
| 46 | </property> | 46 | </item> |
| 47 | </spacer> | 47 | <item> |
| 48 | </item> | 48 | <widget class="QLabel" name="label"> |
| 49 | <item> | 49 | <property name="text"> |
| 50 | <widget class="QLabel" name="label"> | 50 | <string>Port:</string> |
| 51 | <property name="text"> | 51 | </property> |
| 52 | <string>Port:</string> | 52 | </widget> |
| 53 | </property> | 53 | </item> |
| 54 | </widget> | 54 | <item> |
| 55 | </item> | 55 | <widget class="QSpinBox" name="gdbport_spinbox"> |
| 56 | <item> | 56 | <property name="maximum"> |
| 57 | <widget class="QSpinBox" name="GDBPortSpinBox"> | 57 | <number>65536</number> |
| 58 | <property name="maximum"> | 58 | </property> |
| 59 | <number>65536</number> | 59 | </widget> |
| 60 | </property> | ||
| 61 | </widget> | ||
| 62 | </item> | ||
| 63 | </layout> | ||
| 64 | </item> | 60 | </item> |
| 65 | </layout> | 61 | </layout> |
| 66 | </item> | 62 | </item> |
| @@ -69,8 +65,38 @@ | |||
| 69 | </item> | 65 | </item> |
| 70 | </layout> | 66 | </layout> |
| 71 | </item> | 67 | </item> |
| 68 | <item> | ||
| 69 | <spacer name="verticalSpacer"> | ||
| 70 | <property name="orientation"> | ||
| 71 | <enum>Qt::Vertical</enum> | ||
| 72 | </property> | ||
| 73 | <property name="sizeHint" stdset="0"> | ||
| 74 | <size> | ||
| 75 | <width>20</width> | ||
| 76 | <height>40</height> | ||
| 77 | </size> | ||
| 78 | </property> | ||
| 79 | </spacer> | ||
| 80 | </item> | ||
| 72 | </layout> | 81 | </layout> |
| 73 | </widget> | 82 | </widget> |
| 74 | <resources/> | 83 | <resources/> |
| 75 | <connections/> | 84 | <connections> |
| 85 | <connection> | ||
| 86 | <sender>toogle_gdbstub</sender> | ||
| 87 | <signal>toggled(bool)</signal> | ||
| 88 | <receiver>gdbport_spinbox</receiver> | ||
| 89 | <slot>setEnabled(bool)</slot> | ||
| 90 | <hints> | ||
| 91 | <hint type="sourcelabel"> | ||
| 92 | <x>84</x> | ||
| 93 | <y>157</y> | ||
| 94 | </hint> | ||
| 95 | <hint type="destinationlabel"> | ||
| 96 | <x>342</x> | ||
| 97 | <y>158</y> | ||
| 98 | </hint> | ||
| 99 | </hints> | ||
| 100 | </connection> | ||
| 101 | </connections> | ||
| 76 | </ui> | 102 | </ui> |
diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configure_dialog.cpp index ae442adcd..87c26c715 100644 --- a/src/citra_qt/configure_dialog.cpp +++ b/src/citra_qt/configure_dialog.cpp | |||
| @@ -2,10 +2,10 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "configure_dialog.h" | 5 | #include "citra_qt/config.h" |
| 6 | #include "citra_qt/configure_dialog.h" | ||
| 6 | #include "ui_configure.h" | 7 | #include "ui_configure.h" |
| 7 | 8 | ||
| 8 | #include "config.h" | ||
| 9 | 9 | ||
| 10 | #include "core/settings.h" | 10 | #include "core/settings.h" |
| 11 | 11 | ||
| @@ -18,15 +18,12 @@ ConfigureDialog::ConfigureDialog(QWidget *parent) : | |||
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | ConfigureDialog::~ConfigureDialog() { | 20 | ConfigureDialog::~ConfigureDialog() { |
| 21 | delete ui; | ||
| 22 | } | 21 | } |
| 23 | 22 | ||
| 24 | void ConfigureDialog::setConfiguration() { | 23 | void ConfigureDialog::setConfiguration() { |
| 25 | } | 24 | } |
| 26 | 25 | ||
| 27 | void ConfigureDialog::applyConfiguration() { | 26 | void ConfigureDialog::applyConfiguration() { |
| 28 | Config config; | ||
| 29 | ui->generalTab->applyConfiguration(); | 27 | ui->generalTab->applyConfiguration(); |
| 30 | ui->debugTab->applyConfiguration(); | 28 | ui->debugTab->applyConfiguration(); |
| 31 | config.Save(); | ||
| 32 | } | 29 | } |
diff --git a/src/citra_qt/configure_dialog.h b/src/citra_qt/configure_dialog.h index d66049340..89020eeb4 100644 --- a/src/citra_qt/configure_dialog.h +++ b/src/citra_qt/configure_dialog.h | |||
| @@ -2,9 +2,9 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #ifndef CONFIGURE_DIALOG_H | 5 | #pragma once |
| 6 | #define CONFIGURE_DIALOG_H | ||
| 7 | 6 | ||
| 7 | #include <memory> | ||
| 8 | #include <QDialog> | 8 | #include <QDialog> |
| 9 | 9 | ||
| 10 | namespace Ui { | 10 | namespace Ui { |
| @@ -16,7 +16,7 @@ class ConfigureDialog : public QDialog | |||
| 16 | Q_OBJECT | 16 | Q_OBJECT |
| 17 | 17 | ||
| 18 | public: | 18 | public: |
| 19 | explicit ConfigureDialog(QWidget *parent = 0); | 19 | explicit ConfigureDialog(QWidget *parent = nullptr); |
| 20 | ~ConfigureDialog(); | 20 | ~ConfigureDialog(); |
| 21 | 21 | ||
| 22 | void applyConfiguration(); | 22 | void applyConfiguration(); |
| @@ -25,7 +25,5 @@ private: | |||
| 25 | void setConfiguration(); | 25 | void setConfiguration(); |
| 26 | 26 | ||
| 27 | private: | 27 | private: |
| 28 | Ui::ConfigureDialog *ui; | 28 | std::unique_ptr<Ui::ConfigureDialog> ui; |
| 29 | }; | 29 | }; |
| 30 | |||
| 31 | #endif // CONFIGURE_DIALOG_H | ||
diff --git a/src/citra_qt/configure_general.cpp b/src/citra_qt/configure_general.cpp index 71d992ebe..350bd794d 100644 --- a/src/citra_qt/configure_general.cpp +++ b/src/citra_qt/configure_general.cpp | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "citra_qt/configure_general.h" | 5 | #include "citra_qt/configure_general.h" |
| 6 | #include "citra_qt/ui_configure_general.h" | ||
| 7 | #include "citra_qt/ui_settings.h" | 6 | #include "citra_qt/ui_settings.h" |
| 7 | #include "ui_configure_general.h" | ||
| 8 | 8 | ||
| 9 | #include "core/settings.h" | 9 | #include "core/settings.h" |
| 10 | 10 | ||
| @@ -18,23 +18,26 @@ ConfigureGeneral::ConfigureGeneral(QWidget *parent) : | |||
| 18 | this->setConfiguration(); | 18 | this->setConfiguration(); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | ConfigureGeneral::~ConfigureGeneral() | 21 | ConfigureGeneral::~ConfigureGeneral() { |
| 22 | { | ||
| 23 | delete ui; | ||
| 24 | } | 22 | } |
| 25 | 23 | ||
| 26 | void ConfigureGeneral::setConfiguration() { | 24 | void ConfigureGeneral::setConfiguration() { |
| 27 | ui->toogleCheckExit->setChecked(UISettings::values.check_closure); | 25 | ui->toogle_deepscan->setChecked(UISettings::values.gamedir_deepscan); |
| 28 | ui->toogleHWRenderer->setChecked(Settings::values.use_hw_renderer); | 26 | ui->toogle_check_exit->setChecked(UISettings::values.confirm_before_closing); |
| 29 | ui->toogleShaderJIT->setChecked(Settings::values.use_shader_jit); | 27 | ui->region_combobox->setCurrentIndex(Settings::values.region_value); |
| 28 | ui->toogle_hw_renderer->setChecked(Settings::values.use_hw_renderer); | ||
| 29 | ui->toogle_shader_jit->setChecked(Settings::values.use_shader_jit); | ||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | void ConfigureGeneral::applyConfiguration() { | 32 | void ConfigureGeneral::applyConfiguration() { |
| 33 | UISettings::values.check_closure = ui->toogleCheckExit->isChecked(); | 33 | UISettings::values.gamedir_deepscan = ui->toogle_deepscan->isChecked(); |
| 34 | UISettings::values.confirm_before_closing = ui->toogle_check_exit->isChecked(); | ||
| 35 | |||
| 36 | Settings::values.region_value = ui->region_combobox->currentIndex(); | ||
| 34 | 37 | ||
| 35 | VideoCore::g_hw_renderer_enabled = | 38 | VideoCore::g_hw_renderer_enabled = |
| 36 | Settings::values.use_hw_renderer = ui->toogleHWRenderer->isChecked(); | 39 | Settings::values.use_hw_renderer = ui->toogle_hw_renderer->isChecked(); |
| 37 | 40 | ||
| 38 | VideoCore::g_shader_jit_enabled = | 41 | VideoCore::g_shader_jit_enabled = |
| 39 | Settings::values.use_shader_jit = ui->toogleShaderJIT->isChecked(); | 42 | Settings::values.use_shader_jit = ui->toogle_shader_jit->isChecked(); |
| 40 | } | 43 | } |
diff --git a/src/citra_qt/configure_general.h b/src/citra_qt/configure_general.h index 0f3b69332..a6c68e62d 100644 --- a/src/citra_qt/configure_general.h +++ b/src/citra_qt/configure_general.h | |||
| @@ -2,9 +2,9 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #ifndef CONFIGURE_GENERAL_H | 5 | #pragma once |
| 6 | #define CONFIGURE_GENERAL_H | ||
| 7 | 6 | ||
| 7 | #include <memory> | ||
| 8 | #include <QWidget> | 8 | #include <QWidget> |
| 9 | 9 | ||
| 10 | namespace Ui { | 10 | namespace Ui { |
| @@ -16,7 +16,7 @@ class ConfigureGeneral : public QWidget | |||
| 16 | Q_OBJECT | 16 | Q_OBJECT |
| 17 | 17 | ||
| 18 | public: | 18 | public: |
| 19 | explicit ConfigureGeneral(QWidget *parent = 0); | 19 | explicit ConfigureGeneral(QWidget *parent = nullptr); |
| 20 | ~ConfigureGeneral(); | 20 | ~ConfigureGeneral(); |
| 21 | 21 | ||
| 22 | void applyConfiguration(); | 22 | void applyConfiguration(); |
| @@ -25,7 +25,5 @@ private: | |||
| 25 | void setConfiguration(); | 25 | void setConfiguration(); |
| 26 | 26 | ||
| 27 | private: | 27 | private: |
| 28 | Ui::ConfigureGeneral *ui; | 28 | std::unique_ptr<Ui::ConfigureGeneral> ui; |
| 29 | }; | 29 | }; |
| 30 | |||
| 31 | #endif // CONFIGURE_GENERAL_H | ||
diff --git a/src/citra_qt/configure_general.ui b/src/citra_qt/configure_general.ui index f847d3c6c..47184c5c6 100644 --- a/src/citra_qt/configure_general.ui +++ b/src/citra_qt/configure_general.ui | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | <rect> | 6 | <rect> |
| 7 | <x>0</x> | 7 | <x>0</x> |
| 8 | <y>0</y> | 8 | <y>0</y> |
| 9 | <width>284</width> | 9 | <width>300</width> |
| 10 | <height>377</height> | 10 | <height>377</height> |
| 11 | </rect> | 11 | </rect> |
| 12 | </property> | 12 | </property> |
| @@ -25,7 +25,14 @@ | |||
| 25 | <item> | 25 | <item> |
| 26 | <layout class="QVBoxLayout" name="verticalLayout_2"> | 26 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
| 27 | <item> | 27 | <item> |
| 28 | <widget class="QCheckBox" name="toogleCheckExit"> | 28 | <widget class="QCheckBox" name="toogle_deepscan"> |
| 29 | <property name="text"> | ||
| 30 | <string>Recursive scan for game folder</string> | ||
| 31 | </property> | ||
| 32 | </widget> | ||
| 33 | </item> | ||
| 34 | <item> | ||
| 35 | <widget class="QCheckBox" name="toogle_check_exit"> | ||
| 29 | <property name="text"> | 36 | <property name="text"> |
| 30 | <string>Confirm exit while emulation is running</string> | 37 | <string>Confirm exit while emulation is running</string> |
| 31 | </property> | 38 | </property> |
| @@ -37,6 +44,69 @@ | |||
| 37 | </widget> | 44 | </widget> |
| 38 | </item> | 45 | </item> |
| 39 | <item> | 46 | <item> |
| 47 | <widget class="QGroupBox" name="groupBox_4"> | ||
| 48 | <property name="title"> | ||
| 49 | <string>Emulation</string> | ||
| 50 | </property> | ||
| 51 | <layout class="QHBoxLayout" name="horizontalLayout_5"> | ||
| 52 | <item> | ||
| 53 | <layout class="QVBoxLayout" name="verticalLayout_6"> | ||
| 54 | <item> | ||
| 55 | <layout class="QHBoxLayout" name="horizontalLayout_6"> | ||
| 56 | <item> | ||
| 57 | <widget class="QLabel" name="label"> | ||
| 58 | <property name="text"> | ||
| 59 | <string>Region:</string> | ||
| 60 | </property> | ||
| 61 | </widget> | ||
| 62 | </item> | ||
| 63 | <item> | ||
| 64 | <widget class="QComboBox" name="region_combobox"> | ||
| 65 | <item> | ||
| 66 | <property name="text"> | ||
| 67 | <string notr="true">JPN</string> | ||
| 68 | </property> | ||
| 69 | </item> | ||
| 70 | <item> | ||
| 71 | <property name="text"> | ||
| 72 | <string notr="true">USA</string> | ||
| 73 | </property> | ||
| 74 | </item> | ||
| 75 | <item> | ||
| 76 | <property name="text"> | ||
| 77 | <string notr="true">EUR</string> | ||
| 78 | </property> | ||
| 79 | </item> | ||
| 80 | <item> | ||
| 81 | <property name="text"> | ||
| 82 | <string notr="true">AUS</string> | ||
| 83 | </property> | ||
| 84 | </item> | ||
| 85 | <item> | ||
| 86 | <property name="text"> | ||
| 87 | <string notr="true">CHN</string> | ||
| 88 | </property> | ||
| 89 | </item> | ||
| 90 | <item> | ||
| 91 | <property name="text"> | ||
| 92 | <string notr="true">KOR</string> | ||
| 93 | </property> | ||
| 94 | </item> | ||
| 95 | <item> | ||
| 96 | <property name="text"> | ||
| 97 | <string notr="true">TWN</string> | ||
| 98 | </property> | ||
| 99 | </item> | ||
| 100 | </widget> | ||
| 101 | </item> | ||
| 102 | </layout> | ||
| 103 | </item> | ||
| 104 | </layout> | ||
| 105 | </item> | ||
| 106 | </layout> | ||
| 107 | </widget> | ||
| 108 | </item> | ||
| 109 | <item> | ||
| 40 | <widget class="QGroupBox" name="groupBox_2"> | 110 | <widget class="QGroupBox" name="groupBox_2"> |
| 41 | <property name="title"> | 111 | <property name="title"> |
| 42 | <string>Performance</string> | 112 | <string>Performance</string> |
| @@ -45,16 +115,16 @@ | |||
| 45 | <item> | 115 | <item> |
| 46 | <layout class="QVBoxLayout" name="verticalLayout_3"> | 116 | <layout class="QVBoxLayout" name="verticalLayout_3"> |
| 47 | <item> | 117 | <item> |
| 48 | <widget class="QCheckBox" name="toogleHWRenderer"> | 118 | <widget class="QCheckBox" name="toogle_hw_renderer"> |
| 49 | <property name="text"> | 119 | <property name="text"> |
| 50 | <string>Enable hardware renderer</string> | 120 | <string>Enable hardware renderer</string> |
| 51 | </property> | 121 | </property> |
| 52 | </widget> | 122 | </widget> |
| 53 | </item> | 123 | </item> |
| 54 | <item> | 124 | <item> |
| 55 | <widget class="QCheckBox" name="toogleShaderJIT"> | 125 | <widget class="QCheckBox" name="toogle_shader_jit"> |
| 56 | <property name="text"> | 126 | <property name="text"> |
| 57 | <string>Enable Shader JIT</string> | 127 | <string>Enable shader JIT</string> |
| 58 | </property> | 128 | </property> |
| 59 | </widget> | 129 | </widget> |
| 60 | </item> | 130 | </item> |
diff --git a/src/citra_qt/hotkeys.cpp b/src/citra_qt/hotkeys.cpp index 92525d53c..41f95c63d 100644 --- a/src/citra_qt/hotkeys.cpp +++ b/src/citra_qt/hotkeys.cpp | |||
| @@ -32,9 +32,10 @@ void SaveHotkeys() | |||
| 32 | { | 32 | { |
| 33 | for (auto hotkey : group.second) | 33 | for (auto hotkey : group.second) |
| 34 | { | 34 | { |
| 35 | UISettings::values.shortcuts.push_back(UISettings::Shortcut(group.first + "/" + hotkey.first, | 35 | UISettings::values.shortcuts.emplace_back( |
| 36 | UISettings::ContextedShortcut(hotkey.second.keyseq.toString(), | 36 | UISettings::Shortcut(group.first + "/" + hotkey.first, |
| 37 | hotkey.second.context))); | 37 | UISettings::ContextualShortcut(hotkey.second.keyseq.toString(), |
| 38 | hotkey.second.context))); | ||
| 38 | } | 39 | } |
| 39 | } | 40 | } |
| 40 | } | 41 | } |
diff --git a/src/citra_qt/hotkeys.h b/src/citra_qt/hotkeys.h index 79a685074..38aa5f012 100644 --- a/src/citra_qt/hotkeys.h +++ b/src/citra_qt/hotkeys.h | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | ||
| 6 | |||
| 5 | #include "ui_hotkeys.h" | 7 | #include "ui_hotkeys.h" |
| 6 | 8 | ||
| 7 | class QDialog; | 9 | class QDialog; |
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 26904c71d..a81c6db3f 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -194,7 +194,7 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) | |||
| 194 | 194 | ||
| 195 | show(); | 195 | show(); |
| 196 | 196 | ||
| 197 | game_list->PopulateAsync(UISettings::values.gamedir_path, UISettings::values.gamedir_deepscan); | 197 | game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); |
| 198 | 198 | ||
| 199 | QStringList args = QApplication::arguments(); | 199 | QStringList args = QApplication::arguments(); |
| 200 | if (args.length() >= 2) { | 200 | if (args.length() >= 2) { |
| @@ -416,7 +416,7 @@ void GMainWindow::OnMenuLoadSymbolMap() { | |||
| 416 | void GMainWindow::OnMenuSelectGameListRoot() { | 416 | void GMainWindow::OnMenuSelectGameListRoot() { |
| 417 | QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); | 417 | QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); |
| 418 | if (!dir_path.isEmpty()) { | 418 | if (!dir_path.isEmpty()) { |
| 419 | UISettings::values.gamedir_path = dir_path; | 419 | UISettings::values.gamedir = dir_path; |
| 420 | game_list->PopulateAsync(dir_path, UISettings::values.gamedir_deepscan); | 420 | game_list->PopulateAsync(dir_path, UISettings::values.gamedir_deepscan); |
| 421 | } | 421 | } |
| 422 | } | 422 | } |
| @@ -488,14 +488,15 @@ void GMainWindow::ToggleWindowMode() { | |||
| 488 | void GMainWindow::OnConfigure() { | 488 | void GMainWindow::OnConfigure() { |
| 489 | ConfigureDialog configureDialog(this); | 489 | ConfigureDialog configureDialog(this); |
| 490 | auto result = configureDialog.exec(); | 490 | auto result = configureDialog.exec(); |
| 491 | if ( result == QDialog::Accepted) | 491 | if (result == QDialog::Accepted) |
| 492 | { | 492 | { |
| 493 | configureDialog.applyConfiguration(); | 493 | configureDialog.applyConfiguration(); |
| 494 | config->Save(); | ||
| 494 | } | 495 | } |
| 495 | } | 496 | } |
| 496 | 497 | ||
| 497 | bool GMainWindow::ConfirmClose() { | 498 | bool GMainWindow::ConfirmClose() { |
| 498 | if (emu_thread == nullptr || !confirm_before_closing) | 499 | if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) |
| 499 | return true; | 500 | return true; |
| 500 | 501 | ||
| 501 | auto answer = QMessageBox::question(this, tr("Citra"), | 502 | auto answer = QMessageBox::question(this, tr("Citra"), |
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index bd620676b..477db5c5c 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h | |||
| @@ -130,7 +130,6 @@ private: | |||
| 130 | GPUCommandListWidget* graphicsCommandsWidget; | 130 | GPUCommandListWidget* graphicsCommandsWidget; |
| 131 | 131 | ||
| 132 | QAction* actions_recent_files[max_recent_files_item]; | 132 | QAction* actions_recent_files[max_recent_files_item]; |
| 133 | bool confirm_before_closing; | ||
| 134 | }; | 133 | }; |
| 135 | 134 | ||
| 136 | #endif // _CITRA_QT_MAIN_HXX_ | 135 | #endif // _CITRA_QT_MAIN_HXX_ |
diff --git a/src/citra_qt/ui_settings.h b/src/citra_qt/ui_settings.h index 729866d56..62db4a73e 100644 --- a/src/citra_qt/ui_settings.h +++ b/src/citra_qt/ui_settings.h | |||
| @@ -2,8 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #ifndef UISETTINGS_H | 5 | #pragma once |
| 6 | #define UISETTINGS_H | ||
| 7 | 6 | ||
| 8 | #include <QByteArray> | 7 | #include <QByteArray> |
| 9 | #include <QStringList> | 8 | #include <QStringList> |
| @@ -13,8 +12,8 @@ | |||
| 13 | 12 | ||
| 14 | namespace UISettings { | 13 | namespace UISettings { |
| 15 | 14 | ||
| 16 | typedef std::pair<QString, int> ContextedShortcut; | 15 | using ContextualShortcut = std::pair<QString, int> ; |
| 17 | typedef std::pair<QString, ContextedShortcut> Shortcut; | 16 | using Shortcut = std::pair<QString, ContextualShortcut>; |
| 18 | 17 | ||
| 19 | struct Values { | 18 | struct Values { |
| 20 | QByteArray geometry; | 19 | QByteArray geometry; |
| @@ -30,19 +29,19 @@ struct Values { | |||
| 30 | bool single_window_mode; | 29 | bool single_window_mode; |
| 31 | bool display_titlebar; | 30 | bool display_titlebar; |
| 32 | 31 | ||
| 33 | bool check_closure; | 32 | bool confirm_before_closing; |
| 34 | bool first_start; | 33 | bool first_start; |
| 35 | 34 | ||
| 36 | QString roms_path; | 35 | QString roms_path; |
| 37 | QString symbols_path; | 36 | QString symbols_path; |
| 38 | QString gamedir_path; | 37 | QString gamedir; |
| 39 | bool gamedir_deepscan; | 38 | bool gamedir_deepscan; |
| 40 | QStringList recent_files; | 39 | QStringList recent_files; |
| 41 | 40 | ||
| 42 | // Shortcut name <Shortcut, context> | 41 | // Shortcut name <Shortcut, context> |
| 43 | std::vector<Shortcut> shortcuts; | 42 | std::vector<Shortcut> shortcuts; |
| 44 | } extern values; | 43 | }; |
| 45 | 44 | ||
| 46 | } | 45 | extern Values values; |
| 47 | 46 | ||
| 48 | #endif // UISETTINGS_H | 47 | } |