diff options
| author | 2023-06-15 16:45:42 -0400 | |
|---|---|---|
| committer | 2023-07-21 10:56:54 -0400 | |
| commit | a7ee9d999f612dcf5e9fcf68b410a3b49039d8ed (patch) | |
| tree | 5231b80e8ec0e0423a7478f988ea98bbf975a3bd /src | |
| parent | shared_widget: Some documentation, add shorter constructor (diff) | |
| download | yuzu-a7ee9d999f612dcf5e9fcf68b410a3b49039d8ed.tar.gz yuzu-a7ee9d999f612dcf5e9fcf68b410a3b49039d8ed.tar.xz yuzu-a7ee9d999f612dcf5e9fcf68b410a3b49039d8ed.zip | |
configuration: Use shorter constructor as needed
Reduces some confusion hopefully, since some parameters specified were not
specific to the setting in question.
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/configuration/configure_audio.cpp | 9 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 7 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index 98c6b6f44..c90316725 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp | |||
| @@ -54,14 +54,15 @@ void ConfigureAudio::Setup() { | |||
| 54 | auto* widget = [&]() { | 54 | auto* widget = [&]() { |
| 55 | if (setting->Id() == Settings::values.volume.Id()) { | 55 | if (setting->Id() == Settings::values.volume.Id()) { |
| 56 | // volume needs to be a slider (default is line edit) | 56 | // volume needs to be a slider (default is line edit) |
| 57 | return new ConfigurationShared::Widget( | 57 | return new ConfigurationShared::Widget(setting, translations, combobox_translations, |
| 58 | setting, translations, combobox_translations, this, runtime_lock, apply_funcs, | 58 | this, runtime_lock, apply_funcs, nullptr, |
| 59 | ConfigurationShared::RequestType::Slider, true, 1.0f, nullptr, | 59 | ConfigurationShared::RequestType::Slider, |
| 60 | tr("%1%", "Volume percentage (e.g. 50%)")); | 60 | tr("%1%", "Volume percentage (e.g. 50%)")); |
| 61 | } else if (setting->Id() == Settings::values.audio_output_device_id.Id() || | 61 | } else if (setting->Id() == Settings::values.audio_output_device_id.Id() || |
| 62 | setting->Id() == Settings::values.audio_input_device_id.Id() || | 62 | setting->Id() == Settings::values.audio_input_device_id.Id() || |
| 63 | setting->Id() == Settings::values.sink_id.Id()) { | 63 | setting->Id() == Settings::values.sink_id.Id()) { |
| 64 | // These need to be unmanaged comboboxes, so we can populate them ourselves | 64 | // These need to be unmanaged comboboxes, so we can populate them ourselves |
| 65 | // TODO (lat9nq): Let it manage sink_id | ||
| 65 | return new ConfigurationShared::Widget( | 66 | return new ConfigurationShared::Widget( |
| 66 | setting, translations, combobox_translations, this, runtime_lock, apply_funcs, | 67 | setting, translations, combobox_translations, this, runtime_lock, apply_funcs, |
| 67 | ConfigurationShared::RequestType::ComboBox, false); | 68 | ConfigurationShared::RequestType::ComboBox, false); |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 44d1603d0..cf1333cc8 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -253,8 +253,7 @@ void ConfigureGraphics::Setup() { | |||
| 253 | // speed_limit needs a checkbox to set use_speed_limit, as well as a spinbox | 253 | // speed_limit needs a checkbox to set use_speed_limit, as well as a spinbox |
| 254 | return new ConfigurationShared::Widget( | 254 | return new ConfigurationShared::Widget( |
| 255 | setting, translations, combobox_translations, this, runtime_lock, apply_funcs, | 255 | setting, translations, combobox_translations, this, runtime_lock, apply_funcs, |
| 256 | ConfigurationShared::RequestType::SpinBox, true, 1.0f, | 256 | &Settings::values.use_speed_limit, ConfigurationShared::RequestType::SpinBox, |
| 257 | &Settings::values.use_speed_limit, | ||
| 258 | tr("%", "Limit speed percentage (e.g. 50%)")); | 257 | tr("%", "Limit speed percentage (e.g. 50%)")); |
| 259 | } else { | 258 | } else { |
| 260 | return new ConfigurationShared::Widget(setting, translations, combobox_translations, | 259 | return new ConfigurationShared::Widget(setting, translations, combobox_translations, |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index b9d58b083..f78ed7c24 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -134,15 +134,14 @@ void ConfigureSystem::Setup() { | |||
| 134 | // it and custom_rtc_enabled | 134 | // it and custom_rtc_enabled |
| 135 | return new ConfigurationShared::Widget( | 135 | return new ConfigurationShared::Widget( |
| 136 | setting, translations, combobox_translations, this, runtime_lock, apply_funcs, | 136 | setting, translations, combobox_translations, this, runtime_lock, apply_funcs, |
| 137 | ConfigurationShared::RequestType::DateTimeEdit, true, 1.0f, | 137 | &Settings::values.custom_rtc_enabled, |
| 138 | &Settings::values.custom_rtc_enabled); | 138 | ConfigurationShared::RequestType::DateTimeEdit); |
| 139 | } else if (setting->Id() == Settings::values.rng_seed.Id()) { | 139 | } else if (setting->Id() == Settings::values.rng_seed.Id()) { |
| 140 | // rng_seed needs a HexEdit (default is LineEdit), and a checkbox to manage | 140 | // rng_seed needs a HexEdit (default is LineEdit), and a checkbox to manage |
| 141 | // it and rng_seed_enabled | 141 | // it and rng_seed_enabled |
| 142 | return new ConfigurationShared::Widget( | 142 | return new ConfigurationShared::Widget( |
| 143 | setting, translations, combobox_translations, this, runtime_lock, apply_funcs, | 143 | setting, translations, combobox_translations, this, runtime_lock, apply_funcs, |
| 144 | ConfigurationShared::RequestType::HexEdit, true, 1.0f, | 144 | &Settings::values.rng_seed_enabled, ConfigurationShared::RequestType::HexEdit); |
| 145 | &Settings::values.rng_seed_enabled); | ||
| 146 | } else { | 145 | } else { |
| 147 | return new ConfigurationShared::Widget(setting, translations, combobox_translations, | 146 | return new ConfigurationShared::Widget(setting, translations, combobox_translations, |
| 148 | this, runtime_lock, apply_funcs); | 147 | this, runtime_lock, apply_funcs); |