diff options
Diffstat (limited to 'src/citra_qt')
| -rw-r--r-- | src/citra_qt/configuration/configure_input.cpp | 8 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_system.cpp | 30 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_system.h | 1 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_system.ui | 23 |
4 files changed, 53 insertions, 9 deletions
diff --git a/src/citra_qt/configuration/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index daac9b63a..116a6330f 100644 --- a/src/citra_qt/configuration/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp | |||
| @@ -102,14 +102,8 @@ ConfigureInput::ConfigureInput(QWidget* parent) | |||
| 102 | 102 | ||
| 103 | this->loadConfiguration(); | 103 | this->loadConfiguration(); |
| 104 | 104 | ||
| 105 | // TODO(wwylele): enable these when the input emulation for them is implemented | 105 | // TODO(wwylele): enable this when we actually emulate it |
| 106 | ui->buttonZL->setEnabled(false); | ||
| 107 | ui->buttonZR->setEnabled(false); | ||
| 108 | ui->buttonHome->setEnabled(false); | 106 | ui->buttonHome->setEnabled(false); |
| 109 | ui->buttonCStickUp->setEnabled(false); | ||
| 110 | ui->buttonCStickDown->setEnabled(false); | ||
| 111 | ui->buttonCStickLeft->setEnabled(false); | ||
| 112 | ui->buttonCStickRight->setEnabled(false); | ||
| 113 | } | 107 | } |
| 114 | 108 | ||
| 115 | void ConfigureInput::applyConfiguration() { | 109 | void ConfigureInput::applyConfiguration() { |
diff --git a/src/citra_qt/configuration/configure_system.cpp b/src/citra_qt/configuration/configure_system.cpp index a3a9015a4..9b1e6711d 100644 --- a/src/citra_qt/configuration/configure_system.cpp +++ b/src/citra_qt/configuration/configure_system.cpp | |||
| @@ -2,6 +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 | #include <QMessageBox> | ||
| 5 | #include "citra_qt/configuration/configure_system.h" | 6 | #include "citra_qt/configuration/configure_system.h" |
| 6 | #include "citra_qt/ui_settings.h" | 7 | #include "citra_qt/ui_settings.h" |
| 7 | #include "core/core.h" | 8 | #include "core/core.h" |
| @@ -15,8 +16,11 @@ static const std::array<int, 12> days_in_month = {{ | |||
| 15 | 16 | ||
| 16 | ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) { | 17 | ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) { |
| 17 | ui->setupUi(this); | 18 | ui->setupUi(this); |
| 18 | connect(ui->combo_birthmonth, SIGNAL(currentIndexChanged(int)), | 19 | connect(ui->combo_birthmonth, |
| 19 | SLOT(updateBirthdayComboBox(int))); | 20 | static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, |
| 21 | &ConfigureSystem::updateBirthdayComboBox); | ||
| 22 | connect(ui->button_regenerate_console_id, &QPushButton::clicked, this, | ||
| 23 | &ConfigureSystem::refreshConsoleID); | ||
| 20 | 24 | ||
| 21 | this->setConfiguration(); | 25 | this->setConfiguration(); |
| 22 | } | 26 | } |
| @@ -71,6 +75,10 @@ void ConfigureSystem::ReadSystemSettings() { | |||
| 71 | // set sound output mode | 75 | // set sound output mode |
| 72 | sound_index = Service::CFG::GetSoundOutputMode(); | 76 | sound_index = Service::CFG::GetSoundOutputMode(); |
| 73 | ui->combo_sound->setCurrentIndex(sound_index); | 77 | ui->combo_sound->setCurrentIndex(sound_index); |
| 78 | |||
| 79 | // set the console id | ||
| 80 | u64 console_id = Service::CFG::GetConsoleUniqueId(); | ||
| 81 | ui->label_console_id->setText("Console ID: 0x" + QString::number(console_id, 16).toUpper()); | ||
| 74 | } | 82 | } |
| 75 | 83 | ||
| 76 | void ConfigureSystem::applyConfiguration() { | 84 | void ConfigureSystem::applyConfiguration() { |
| @@ -140,3 +148,21 @@ void ConfigureSystem::updateBirthdayComboBox(int birthmonth_index) { | |||
| 140 | // restore the day selection | 148 | // restore the day selection |
| 141 | ui->combo_birthday->setCurrentIndex(birthday_index); | 149 | ui->combo_birthday->setCurrentIndex(birthday_index); |
| 142 | } | 150 | } |
| 151 | |||
| 152 | void ConfigureSystem::refreshConsoleID() { | ||
| 153 | QMessageBox::StandardButton reply; | ||
| 154 | QString warning_text = tr("This will replace your current virtual 3DS with a new one. " | ||
| 155 | "Your current virtual 3DS will not be recoverable. " | ||
| 156 | "This might have unexpected effects in games. This might fail, " | ||
| 157 | "if you use an outdated config savegame. Continue?"); | ||
| 158 | reply = QMessageBox::critical(this, tr("Warning"), warning_text, | ||
| 159 | QMessageBox::No | QMessageBox::Yes); | ||
| 160 | if (reply == QMessageBox::No) | ||
| 161 | return; | ||
| 162 | u32 random_number; | ||
| 163 | u64 console_id; | ||
| 164 | Service::CFG::GenerateConsoleUniqueId(random_number, console_id); | ||
| 165 | Service::CFG::SetConsoleUniqueId(random_number, console_id); | ||
| 166 | Service::CFG::UpdateConfigNANDSavegame(); | ||
| 167 | ui->label_console_id->setText("Console ID: 0x" + QString::number(console_id, 16).toUpper()); | ||
| 168 | } | ||
diff --git a/src/citra_qt/configuration/configure_system.h b/src/citra_qt/configuration/configure_system.h index db0ead13c..f13de17d4 100644 --- a/src/citra_qt/configuration/configure_system.h +++ b/src/citra_qt/configuration/configure_system.h | |||
| @@ -23,6 +23,7 @@ public: | |||
| 23 | 23 | ||
| 24 | public slots: | 24 | public slots: |
| 25 | void updateBirthdayComboBox(int birthmonth_index); | 25 | void updateBirthdayComboBox(int birthmonth_index); |
| 26 | void refreshConsoleID(); | ||
| 26 | 27 | ||
| 27 | private: | 28 | private: |
| 28 | void ReadSystemSettings(); | 29 | void ReadSystemSettings(); |
diff --git a/src/citra_qt/configuration/configure_system.ui b/src/citra_qt/configuration/configure_system.ui index cc54fa37f..8caf49623 100644 --- a/src/citra_qt/configuration/configure_system.ui +++ b/src/citra_qt/configuration/configure_system.ui | |||
| @@ -220,6 +220,29 @@ | |||
| 220 | </item> | 220 | </item> |
| 221 | </widget> | 221 | </widget> |
| 222 | </item> | 222 | </item> |
| 223 | <item row="4" column="0"> | ||
| 224 | <widget class="QLabel" name="label_console_id"> | ||
| 225 | <property name="text"> | ||
| 226 | <string>Console ID:</string> | ||
| 227 | </property> | ||
| 228 | </widget> | ||
| 229 | </item> | ||
| 230 | <item row="4" column="1"> | ||
| 231 | <widget class="QPushButton" name="button_regenerate_console_id"> | ||
| 232 | <property name="sizePolicy"> | ||
| 233 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
| 234 | <horstretch>0</horstretch> | ||
| 235 | <verstretch>0</verstretch> | ||
| 236 | </sizepolicy> | ||
| 237 | </property> | ||
| 238 | <property name="layoutDirection"> | ||
| 239 | <enum>Qt::RightToLeft</enum> | ||
| 240 | </property> | ||
| 241 | <property name="text"> | ||
| 242 | <string>Regenerate</string> | ||
| 243 | </property> | ||
| 244 | </widget> | ||
| 245 | </item> | ||
| 223 | </layout> | 246 | </layout> |
| 224 | </widget> | 247 | </widget> |
| 225 | </item> | 248 | </item> |