diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.cpp | 19 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 21 |
3 files changed, 31 insertions, 15 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 66dffc9bf..6cbbea1b2 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -1,8 +1,11 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <version> | ||
| 4 | #if __cpp_lib_chrono >= 201907L | 5 | #if __cpp_lib_chrono >= 201907L |
| 5 | #include <chrono> | 6 | #include <chrono> |
| 7 | #include <exception> | ||
| 8 | #include <stdexcept> | ||
| 6 | #endif | 9 | #endif |
| 7 | #include <string_view> | 10 | #include <string_view> |
| 8 | 11 | ||
| @@ -25,9 +28,19 @@ std::string GetTimeZoneString() { | |||
| 25 | if (time_zone_index == 0) { // Auto | 28 | if (time_zone_index == 0) { // Auto |
| 26 | #if __cpp_lib_chrono >= 201907L | 29 | #if __cpp_lib_chrono >= 201907L |
| 27 | const struct std::chrono::tzdb& time_zone_data = std::chrono::get_tzdb(); | 30 | const struct std::chrono::tzdb& time_zone_data = std::chrono::get_tzdb(); |
| 28 | const std::chrono::time_zone* current_zone = time_zone_data.current_zone(); | 31 | try { |
| 29 | std::string_view current_zone_name = current_zone->name(); | 32 | const std::chrono::time_zone* current_zone = time_zone_data.current_zone(); |
| 30 | location_name = current_zone_name; | 33 | std::string_view current_zone_name = current_zone->name(); |
| 34 | location_name = current_zone_name; | ||
| 35 | } catch (std::runtime_error& runtime_error) { | ||
| 36 | // VCRUNTIME will throw a runtime_error if the operating system's selected time zone | ||
| 37 | // cannot be found | ||
| 38 | location_name = Common::TimeZone::FindSystemTimeZone(); | ||
| 39 | LOG_WARNING(Common, | ||
| 40 | "Error occurred when trying to determine system time zone:\n{}\nFalling " | ||
| 41 | "back to hour offset \"{}\"", | ||
| 42 | runtime_error.what(), location_name); | ||
| 43 | } | ||
| 31 | #else | 44 | #else |
| 32 | location_name = Common::TimeZone::FindSystemTimeZone(); | 45 | location_name = Common::TimeZone::FindSystemTimeZone(); |
| 33 | #endif | 46 | #endif |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index d74e663d4..2f55159f5 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -41,7 +41,8 @@ void ConfigureGeneral::SetConfiguration() { | |||
| 41 | ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue()); | 41 | ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue()); |
| 42 | ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue()); | 42 | ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue()); |
| 43 | ui->toggle_controller_applet_disabled->setEnabled(runtime_lock); | 43 | ui->toggle_controller_applet_disabled->setEnabled(runtime_lock); |
| 44 | ui->toggle_controller_applet_disabled->setChecked(UISettings::values.controller_applet_disabled.GetValue()); | 44 | ui->toggle_controller_applet_disabled->setChecked( |
| 45 | UISettings::values.controller_applet_disabled.GetValue()); | ||
| 45 | 46 | ||
| 46 | ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue()); | 47 | ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue()); |
| 47 | ui->speed_limit->setValue(Settings::values.speed_limit.GetValue()); | 48 | ui->speed_limit->setValue(Settings::values.speed_limit.GetValue()); |
| @@ -84,7 +85,8 @@ void ConfigureGeneral::ApplyConfiguration() { | |||
| 84 | UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked(); | 85 | UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked(); |
| 85 | UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked(); | 86 | UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked(); |
| 86 | UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked(); | 87 | UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked(); |
| 87 | UISettings::values.controller_applet_disabled = ui->toggle_controller_applet_disabled->isChecked(); | 88 | UISettings::values.controller_applet_disabled = |
| 89 | ui->toggle_controller_applet_disabled->isChecked(); | ||
| 88 | 90 | ||
| 89 | // Guard if during game and set to game-specific value | 91 | // Guard if during game and set to game-specific value |
| 90 | if (Settings::values.use_speed_limit.UsingGlobal()) { | 92 | if (Settings::values.use_speed_limit.UsingGlobal()) { |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 24e59f646..e8418b302 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1707,16 +1707,17 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p | |||
| 1707 | system->SetFilesystem(vfs); | 1707 | system->SetFilesystem(vfs); |
| 1708 | 1708 | ||
| 1709 | system->SetAppletFrontendSet({ | 1709 | system->SetAppletFrontendSet({ |
| 1710 | std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings | 1710 | std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings |
| 1711 | (UISettings::values.controller_applet_disabled.GetValue() == true) ? nullptr : | 1711 | (UISettings::values.controller_applet_disabled.GetValue() == true) |
| 1712 | std::make_unique<QtControllerSelector>(*this), // Controller Selector | 1712 | ? nullptr |
| 1713 | std::make_unique<QtErrorDisplay>(*this), // Error Display | 1713 | : std::make_unique<QtControllerSelector>(*this), // Controller Selector |
| 1714 | nullptr, // Mii Editor | 1714 | std::make_unique<QtErrorDisplay>(*this), // Error Display |
| 1715 | nullptr, // Parental Controls | 1715 | nullptr, // Mii Editor |
| 1716 | nullptr, // Photo Viewer | 1716 | nullptr, // Parental Controls |
| 1717 | std::make_unique<QtProfileSelector>(*this), // Profile Selector | 1717 | nullptr, // Photo Viewer |
| 1718 | std::make_unique<QtSoftwareKeyboard>(*this), // Software Keyboard | 1718 | std::make_unique<QtProfileSelector>(*this), // Profile Selector |
| 1719 | std::make_unique<QtWebBrowser>(*this), // Web Browser | 1719 | std::make_unique<QtSoftwareKeyboard>(*this), // Software Keyboard |
| 1720 | std::make_unique<QtWebBrowser>(*this), // Web Browser | ||
| 1720 | }); | 1721 | }); |
| 1721 | 1722 | ||
| 1722 | const Core::SystemResultStatus result{ | 1723 | const Core::SystemResultStatus result{ |