diff options
Diffstat (limited to 'src/citra_qt/configuration/configure_system.cpp')
| -rw-r--r-- | src/citra_qt/configuration/configure_system.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
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 | } | ||