mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 21:05:45 +00:00
configuration: Use a mapping of setting value to name
Makes comboboxes always correspond to the value of the setting they're modifying.
This commit is contained in:
parent
7a56b4a224
commit
b212eb4d6f
18 changed files with 354 additions and 228 deletions
|
@ -44,9 +44,10 @@ static bool IsValidLocale(u32 region_index, u32 language_index) {
|
|||
|
||||
ConfigureSystem::ConfigureSystem(
|
||||
Core::System& system_, std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group,
|
||||
ConfigurationShared::TranslationMap& translations_, QWidget* parent)
|
||||
const ConfigurationShared::TranslationMap& translations_,
|
||||
const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent)
|
||||
: Tab(group, parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_},
|
||||
translations{translations_} {
|
||||
translations{translations_}, combobox_translations{combobox_translations_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
Setup();
|
||||
|
@ -121,18 +122,17 @@ void ConfigureSystem::Setup() {
|
|||
ConfigurationShared::Widget* widget = [=]() {
|
||||
if (setting->Id() == Settings::values.custom_rtc.Id()) {
|
||||
return new ConfigurationShared::Widget(
|
||||
setting, translations, this, runtime_lock, apply_funcs,
|
||||
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()) {
|
||||
return new ConfigurationShared::Widget(
|
||||
setting, translations, this, runtime_lock, apply_funcs,
|
||||
setting, translations, combobox_translations, this, runtime_lock, apply_funcs,
|
||||
ConfigurationShared::RequestType::HexEdit, true, 1.0f,
|
||||
&Settings::values.rng_seed_enabled);
|
||||
} else {
|
||||
return new ConfigurationShared::Widget(setting, translations, this, runtime_lock,
|
||||
|
||||
apply_funcs);
|
||||
return new ConfigurationShared::Widget(setting, translations, combobox_translations,
|
||||
this, runtime_lock, apply_funcs);
|
||||
}
|
||||
}();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue