From fe861098778c325264bf015488fd960d5f33c6d6 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 14 Aug 2020 14:02:37 -0400 Subject: configuration_shared: Simplify name lookup in highlighting functions We can query the given object name directly from the widget itself. This removes any potential for forgetting to change the name if the widget gets renamed and makes the API much simpler (just pass in the widget, and not worry about its name). --- src/yuzu/configuration/configure_system.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/yuzu/configuration/configure_system.cpp') diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 0c4daf147..9ad43ed8f 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp @@ -90,13 +90,13 @@ void ConfigureSystem::SetConfiguration() { &Settings::values.time_zone_index); ConfigurationShared::SetPerGameSetting(ui->combo_sound, &Settings::values.sound_index); - ConfigurationShared::SetHighlight(ui->label_language, "label_language", + ConfigurationShared::SetHighlight(ui->label_language, !Settings::values.language_index.UsingGlobal()); - ConfigurationShared::SetHighlight(ui->label_region, "label_region", + ConfigurationShared::SetHighlight(ui->label_region, !Settings::values.region_index.UsingGlobal()); - ConfigurationShared::SetHighlight(ui->label_timezone, "label_timezone", + ConfigurationShared::SetHighlight(ui->label_timezone, !Settings::values.time_zone_index.UsingGlobal()); - ConfigurationShared::SetHighlight(ui->label_sound, "label_sound", + ConfigurationShared::SetHighlight(ui->label_sound, !Settings::values.sound_index.UsingGlobal()); } } @@ -224,22 +224,20 @@ void ConfigureSystem::SetupPerGameUI() { } ConfigurationShared::SetColoredComboBox(ui->combo_language, ui->label_language, - "label_language", Settings::values.language_index.GetValue(true)); - ConfigurationShared::SetColoredComboBox(ui->combo_region, ui->label_region, "label_region", + ConfigurationShared::SetColoredComboBox(ui->combo_region, ui->label_region, Settings::values.region_index.GetValue(true)); ConfigurationShared::SetColoredComboBox(ui->combo_time_zone, ui->label_timezone, - "label_timezone", Settings::values.time_zone_index.GetValue(true)); - ConfigurationShared::SetColoredComboBox(ui->combo_sound, ui->label_sound, "label_sound", + ConfigurationShared::SetColoredComboBox(ui->combo_sound, ui->label_sound, Settings::values.sound_index.GetValue(true)); ConfigurationShared::SetColoredTristate( - ui->rng_seed_checkbox, "rng_seed_checkbox", Settings::values.rng_seed.UsingGlobal(), + ui->rng_seed_checkbox, Settings::values.rng_seed.UsingGlobal(), Settings::values.rng_seed.GetValue().has_value(), Settings::values.rng_seed.GetValue(true).has_value(), use_rng_seed); ConfigurationShared::SetColoredTristate( - ui->custom_rtc_checkbox, "custom_rtc_checkbox", Settings::values.custom_rtc.UsingGlobal(), + ui->custom_rtc_checkbox, Settings::values.custom_rtc.UsingGlobal(), Settings::values.custom_rtc.GetValue().has_value(), Settings::values.custom_rtc.GetValue(true).has_value(), use_custom_rtc); } -- cgit v1.2.3