VERY experimental Nintendo Switch 2 emulator
C++
configuration: Document odd widget cases
lat9nqcb4cdcbaebc8
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cppindex 7cc8affb74..9f9e4df8be 100644--- a/src/yuzu/configuration/configure_audio.cpp+++ b/src/yuzu/configuration/configure_audio.cpp@@ -49,6 +49,7 @@ void ConfigureAudio::Setup() {for (auto* setting : settings) {auto* widget = [&]() {if (setting->Id() == Settings::values.volume.Id()) {+ // volume needs to be a slider (default is line edit)return new ConfigurationShared::Widget(setting, translations, combobox_translations, this, runtime_lock, apply_funcs,ConfigurationShared::RequestType::Slider, true, 1.0f, nullptr,@@ -56,6 +57,7 @@ void ConfigureAudio::Setup() {} else if (setting->Id() == Settings::values.audio_output_device_id.Id() ||setting->Id() == Settings::values.audio_input_device_id.Id() ||setting->Id() == Settings::values.sink_id.Id()) {+ // These need to be unmanaged comboboxes, so we can populate them ourselvesreturn new ConfigurationShared::Widget(setting, translations, combobox_translations, this, runtime_lock, apply_funcs,ConfigurationShared::RequestType::ComboBox, false);@@ -79,6 +81,8 @@ void ConfigureAudio::Setup() {connect(sink_combo_box, qOverload<int>(&QComboBox::currentIndexChanged), this,&ConfigureAudio::UpdateAudioDevices);} else if (setting->Id() == Settings::values.audio_output_device_id.Id()) {+ // Keep track of output (and input) device comboboxes to populate them with system+ // devices, which are determined at run timeoutput_device_combo_box = widget->combobox;} else if (setting->Id() == Settings::values.audio_input_device_id.Id()) {input_device_combo_box = widget->combobox;diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cppindex 67b8110146..159837ebd4 100644--- a/src/yuzu/configuration/configure_cpu.cpp+++ b/src/yuzu/configuration/configure_cpu.cpp@@ -58,9 +58,11 @@ void ConfigureCpu::Setup() {}if (setting->Id() == Settings::values.cpu_accuracy.Id()) {+ // Keep track of cpu_accuracy combobox to display/hide the unsafe settingsaccuracy_layout->addWidget(widget);accuracy_combobox = widget->combobox;} else {+ // Presently, all other settings here are unsafe checkboxesunsafe_hold.insert({setting->GetLabel(), widget});}}diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cppindex 1e26267a0c..c053da0cde 100644--- a/src/yuzu/configuration/configure_graphics.cpp+++ b/src/yuzu/configuration/configure_graphics.cpp@@ -231,6 +231,7 @@ void ConfigureGraphics::Setup() {for (const auto setting : Settings::values.linkage.by_category[Settings::Category::Renderer]) {ConfigurationShared::Widget* widget = [&]() {+ // Set managed to false on these and set up the comboboxes ourselvesif (setting->Id() == Settings::values.vulkan_device.Id() ||setting->Id() == Settings::values.shader_backend.Id() ||setting->Id() == Settings::values.vsync_mode.Id()) {@@ -238,11 +239,13 @@ void ConfigureGraphics::Setup() {setting, translations, combobox_translations, this, runtime_lock, apply_funcs,ConfigurationShared::RequestType::ComboBox, false);} else if (setting->Id() == Settings::values.fsr_sharpening_slider.Id()) {+ // FSR needs a reversed sliderreturn new ConfigurationShared::Widget(setting, translations, combobox_translations, this, runtime_lock, apply_funcs,ConfigurationShared::RequestType::ReverseSlider, true, 0.5f, nullptr,tr("%1%", "FSR sharpening percentage (e.g. 50%)"));} else if (setting->Id() == Settings::values.speed_limit.Id()) {+ // speed_limit needs a checkbox to set use_speed_limit, as well as a spinboxreturn new ConfigurationShared::Widget(setting, translations, combobox_translations, this, runtime_lock, apply_funcs,ConfigurationShared::RequestType::SpinBox, true, 1.0f,@@ -269,18 +272,23 @@ void ConfigureGraphics::Setup() {[=](bool) { UpdateAPILayout(); });// Detach API's restore button and place it where we want+ // Lets us put it on the side, and it will automatically scale if there's a second+ // combobox (shader_backend, vulkan_device)widget->layout()->removeWidget(api_restore_global_button);api_layout->addWidget(api_restore_global_button);}} else if (setting->Id() == Settings::values.vulkan_device.Id()) {+ // Keep track of vulkan_device's combobox so we can populate ithold_api.push_front(widget);vulkan_device_combobox = widget->combobox;vulkan_device_widget = widget;} else if (setting->Id() == Settings::values.shader_backend.Id()) {+ // Keep track of shader_backend's combobox so we can populate ithold_api.push_front(widget);shader_backend_combobox = widget->combobox;shader_backend_widget = widget;} else if (setting->Id() == Settings::values.vsync_mode.Id()) {+ // Keep track of vsync_mode's combobox so we can populate itvsync_mode_combobox = widget->combobox;hold_graphics.emplace(setting->Id(), widget);} else {@@ -296,6 +304,8 @@ void ConfigureGraphics::Setup() {api_grid_layout->addWidget(widget);}+ // Background color is too specific to build into the new system, so we manage it here+ // (3 settings, all collected into a single widget with a QColor to manage on top)if (Settings::IsConfiguringGlobal()) {apply_funcs.push_front([this](bool powered_on) {Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red()));diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cppindex 8c932f10a4..843af230b0 100644--- a/src/yuzu/configuration/configure_graphics_advanced.cpp+++ b/src/yuzu/configuration/configure_graphics_advanced.cpp@@ -45,6 +45,7 @@ void ConfigureGraphicsAdvanced::SetConfiguration() {hold.emplace(setting->Id(), widget);+ // Keep track of enable_compute_pipelines so we can display it when neededif (setting->Id() == Settings::values.enable_compute_pipelines.Id()) {checkbox_enable_compute_pipelines = widget;}diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cppindex 4b0e0a6490..ffcbab6d91 100644--- a/src/yuzu/configuration/configure_system.cpp+++ b/src/yuzu/configuration/configure_system.cpp@@ -126,11 +126,15 @@ void ConfigureSystem::Setup() {[[maybe_unused]] std::string label = setting->GetLabel();ConfigurationShared::Widget* widget = [=]() {if (setting->Id() == Settings::values.custom_rtc.Id()) {+ // custom_rtc needs a DateTimeEdit (default is LineEdit), and a checkbox to manage+ // it and custom_rtc_enabledreturn new ConfigurationShared::Widget(setting, translations, combobox_translations, this, runtime_lock, apply_funcs,ConfigurationShared::RequestType::DateTimeEdit, true, 1.0f,&Settings::values.custom_rtc_enabled);} else if (setting->Id() == Settings::values.rng_seed.Id()) {+ // rng_seed needs a HexEdit (default is LineEdit), and a checkbox to manage+ // it and rng_seed_enabledreturn new ConfigurationShared::Widget(setting, translations, combobox_translations, this, runtime_lock, apply_funcs,ConfigurationShared::RequestType::HexEdit, true, 1.0f,@@ -147,17 +151,20 @@ void ConfigureSystem::Setup() {}if (setting->Id() == Settings::values.rng_seed.Id()) {+ // Keep track of rng_seed's widgets to reset it with the checkbox staterng_seed_checkbox = widget->checkbox;rng_seed_edit = widget->line_edit;rng_seed_edit->setEnabled(Settings::values.rng_seed_enabled.GetValue());} else if (setting->Id() == Settings::values.custom_rtc.Id()) {+ // Keep track of custom_rtc's widgets to reset it with the checkbox statecustom_rtc_checkbox = widget->checkbox;custom_rtc_edit = widget->date_time_edit;custom_rtc_edit->setEnabled(Settings::values.custom_rtc_enabled.GetValue());} else if (setting->Id() == Settings::values.region_index.Id()) {-+ // Keep track of the region_index (and langauge_index) combobox to validate the selected+ // settingscombo_region = widget->combobox;} else if (setting->Id() == Settings::values.language_index.Id()) {combo_language = widget->combobox;