diff options
Diffstat (limited to '')
-rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 99a5df241..56c762d64 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp @@ -12,12 +12,13 @@ #include "common/assert.h" #include "common/settings.h" #include "core/core.h" -#include "core/hle/service/time/time.h" +#include "core/hle/service/time/time_manager.h" #include "ui_configure_system.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_system.h" -ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) { +ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent) + : QWidget(parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} { ui->setupUi(this); connect(ui->button_regenerate_console_id, &QPushButton::clicked, this, &ConfigureSystem::RefreshConsoleID); @@ -59,13 +60,12 @@ void ConfigureSystem::RetranslateUI() { } void ConfigureSystem::SetConfiguration() { - enabled = !Core::System::GetInstance().IsPoweredOn(); + enabled = !system.IsPoweredOn(); const auto rng_seed = QStringLiteral("%1") .arg(Settings::values.rng_seed.GetValue().value_or(0), 8, 16, QLatin1Char{'0'}) .toUpper(); - const auto rtc_time = Settings::values.custom_rtc.value_or( - std::chrono::seconds(QDateTime::currentSecsSinceEpoch())); + const auto rtc_time = Settings::values.custom_rtc.value_or(QDateTime::currentSecsSinceEpoch()); ui->rng_seed_checkbox->setChecked(Settings::values.rng_seed.GetValue().has_value()); ui->rng_seed_edit->setEnabled(Settings::values.rng_seed.GetValue().has_value() && @@ -74,7 +74,7 @@ void ConfigureSystem::SetConfiguration() { ui->custom_rtc_checkbox->setChecked(Settings::values.custom_rtc.has_value()); ui->custom_rtc_edit->setEnabled(Settings::values.custom_rtc.has_value()); - ui->custom_rtc_edit->setDateTime(QDateTime::fromSecsSinceEpoch(rtc_time.count())); + ui->custom_rtc_edit->setDateTime(QDateTime::fromSecsSinceEpoch(rtc_time)); if (Settings::IsConfiguringGlobal()) { ui->combo_language->setCurrentIndex(Settings::values.language_index.GetValue()); @@ -103,16 +103,13 @@ void ConfigureSystem::SetConfiguration() { void ConfigureSystem::ReadSystemSettings() {} void ConfigureSystem::ApplyConfiguration() { - auto& system = Core::System::GetInstance(); - // Allow setting custom RTC even if system is powered on, // to allow in-game time to be fast forwarded if (Settings::IsConfiguringGlobal()) { if (ui->custom_rtc_checkbox->isChecked()) { - Settings::values.custom_rtc = - std::chrono::seconds(ui->custom_rtc_edit->dateTime().toSecsSinceEpoch()); + Settings::values.custom_rtc = ui->custom_rtc_edit->dateTime().toSecsSinceEpoch(); if (system.IsPoweredOn()) { - const s64 posix_time{Settings::values.custom_rtc->count() + + const s64 posix_time{*Settings::values.custom_rtc + Service::Time::TimeManager::GetExternalTimeZoneOffset()}; system.GetTimeManager().UpdateLocalSystemClockTime(posix_time); } @@ -162,8 +159,6 @@ void ConfigureSystem::ApplyConfiguration() { break; } } - - system.ApplySettings(); } void ConfigureSystem::RefreshConsoleID() { |