Added ability to set username in settings
This commit is contained in:
@@ -112,6 +112,7 @@ static const std::array<const char*, NumAnalogs> mapping = {{
|
||||
struct Values {
|
||||
// System
|
||||
bool use_docked_mode;
|
||||
std::string username;
|
||||
|
||||
// Controls
|
||||
std::array<std::string, NativeButton::NumButtons> buttons;
|
||||
|
||||
@@ -98,6 +98,7 @@ void Config::ReadValues() {
|
||||
|
||||
qt_config->beginGroup("System");
|
||||
Settings::values.use_docked_mode = qt_config->value("use_docked_mode", false).toBool();
|
||||
Settings::values.username = qt_config->value("username", "yuzu").toString().toStdString();
|
||||
qt_config->endGroup();
|
||||
|
||||
qt_config->beginGroup("Miscellaneous");
|
||||
@@ -201,6 +202,7 @@ void Config::SaveValues() {
|
||||
|
||||
qt_config->beginGroup("System");
|
||||
qt_config->setValue("use_docked_mode", Settings::values.use_docked_mode);
|
||||
qt_config->setValue("username", QString::fromStdString(Settings::values.username));
|
||||
qt_config->endGroup();
|
||||
|
||||
qt_config->beginGroup("Miscellaneous");
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
|
||||
#include <QMessageBox>
|
||||
#include "core/core.h"
|
||||
#include "core/settings.h"
|
||||
#include "ui_configure_system.h"
|
||||
#include "yuzu/configuration/configure_system.h"
|
||||
#include "yuzu/ui_settings.h"
|
||||
#include "yuzu/main.h"
|
||||
|
||||
static const std::array<int, 12> days_in_month = {{
|
||||
31,
|
||||
@@ -38,6 +39,7 @@ ConfigureSystem::~ConfigureSystem() {}
|
||||
|
||||
void ConfigureSystem::setConfiguration() {
|
||||
enabled = !Core::System::GetInstance().IsPoweredOn();
|
||||
ui->edit_username->setText(QString::fromStdString(Settings::values.username));
|
||||
}
|
||||
|
||||
void ConfigureSystem::ReadSystemSettings() {}
|
||||
@@ -45,6 +47,8 @@ void ConfigureSystem::ReadSystemSettings() {}
|
||||
void ConfigureSystem::applyConfiguration() {
|
||||
if (!enabled)
|
||||
return;
|
||||
Settings::values.username = ui->edit_username->text().toStdString();
|
||||
Settings::Apply();
|
||||
}
|
||||
|
||||
void ConfigureSystem::updateBirthdayComboBox(int birthmonth_index) {
|
||||
|
||||
Reference in New Issue
Block a user