summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/configuration/configure_system.cpp
diff options
context:
space:
mode:
authorB3n30 <bene_thomas@web.de>2017-05-06 02:55:51 +0200
committerbunnei <bunneidev@gmail.com>2017-05-06 02:55:51 +0200
commit8bee0161458a082491d611ba4353cda84881b067 (patch)
tree776f900e7797f81bef52324cbc3f0202fc7fe8b7 /src/citra_qt/configuration/configure_system.cpp
parentMerge pull request #2606 from wwylele/ir (diff)
downloadyuzu-8bee0161458a082491d611ba4353cda84881b067.tar
yuzu-8bee0161458a082491d611ba4353cda84881b067.tar.gz
yuzu-8bee0161458a082491d611ba4353cda84881b067.tar.bz2
yuzu-8bee0161458a082491d611ba4353cda84881b067.tar.lz
yuzu-8bee0161458a082491d611ba4353cda84881b067.tar.xz
yuzu-8bee0161458a082491d611ba4353cda84881b067.tar.zst
yuzu-8bee0161458a082491d611ba4353cda84881b067.zip
Diffstat (limited to 'src/citra_qt/configuration/configure_system.cpp')
-rw-r--r--src/citra_qt/configuration/configure_system.cpp30
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 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <QMessageBox>
#include "citra_qt/configuration/configure_system.h"
#include "citra_qt/ui_settings.h"
#include "core/core.h"
@@ -15,8 +16,11 @@ static const std::array<int, 12> days_in_month = {{
ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) {
ui->setupUi(this);
- connect(ui->combo_birthmonth, SIGNAL(currentIndexChanged(int)),
- SLOT(updateBirthdayComboBox(int)));
+ connect(ui->combo_birthmonth,
+ static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
+ &ConfigureSystem::updateBirthdayComboBox);
+ connect(ui->button_regenerate_console_id, &QPushButton::clicked, this,
+ &ConfigureSystem::refreshConsoleID);
this->setConfiguration();
}
@@ -71,6 +75,10 @@ void ConfigureSystem::ReadSystemSettings() {
// set sound output mode
sound_index = Service::CFG::GetSoundOutputMode();
ui->combo_sound->setCurrentIndex(sound_index);
+
+ // set the console id
+ u64 console_id = Service::CFG::GetConsoleUniqueId();
+ ui->label_console_id->setText("Console ID: 0x" + QString::number(console_id, 16).toUpper());
}
void ConfigureSystem::applyConfiguration() {
@@ -140,3 +148,21 @@ void ConfigureSystem::updateBirthdayComboBox(int birthmonth_index) {
// restore the day selection
ui->combo_birthday->setCurrentIndex(birthday_index);
}
+
+void ConfigureSystem::refreshConsoleID() {
+ QMessageBox::StandardButton reply;
+ QString warning_text = tr("This will replace your current virtual 3DS with a new one. "
+ "Your current virtual 3DS will not be recoverable. "
+ "This might have unexpected effects in games. This might fail, "
+ "if you use an outdated config savegame. Continue?");
+ reply = QMessageBox::critical(this, tr("Warning"), warning_text,
+ QMessageBox::No | QMessageBox::Yes);
+ if (reply == QMessageBox::No)
+ return;
+ u32 random_number;
+ u64 console_id;
+ Service::CFG::GenerateConsoleUniqueId(random_number, console_id);
+ Service::CFG::SetConsoleUniqueId(random_number, console_id);
+ Service::CFG::UpdateConfigNANDSavegame();
+ ui->label_console_id->setText("Console ID: 0x" + QString::number(console_id, 16).toUpper());
+}