mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 06:21:26 +12:00
Change EnhanceComboBox to optionally sort the settings list before adding it to the combo box
This commit is contained in:
parent
136fc8cfe3
commit
bad0415f05
3 changed files with 11 additions and 4 deletions
|
@ -244,7 +244,7 @@ void emu_settings::SaveSettings()
|
|||
config.close();
|
||||
}
|
||||
|
||||
void emu_settings::EnhanceComboBox(QComboBox* combobox, SettingsType type, bool is_ranged, bool use_max, int max)
|
||||
void emu_settings::EnhanceComboBox(QComboBox* combobox, SettingsType type, bool is_ranged, bool use_max, int max, bool sorted)
|
||||
{
|
||||
if (!combobox)
|
||||
{
|
||||
|
@ -265,7 +265,14 @@ void emu_settings::EnhanceComboBox(QComboBox* combobox, SettingsType type, bool
|
|||
}
|
||||
else
|
||||
{
|
||||
for (QString setting : GetSettingOptions(type))
|
||||
QStringList settings = GetSettingOptions(type);
|
||||
|
||||
if (sorted)
|
||||
{
|
||||
settings.sort();
|
||||
}
|
||||
|
||||
for (QString setting : settings)
|
||||
{
|
||||
combobox->addItem(tr(setting.toStdString().c_str()), QVariant(setting));
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ public:
|
|||
~emu_settings();
|
||||
|
||||
/** Connects a combo box with the target settings type*/
|
||||
void EnhanceComboBox(QComboBox* combobox, SettingsType type, bool is_ranged = false, bool use_max = false, int max = 0);
|
||||
void EnhanceComboBox(QComboBox* combobox, SettingsType type, bool is_ranged = false, bool use_max = false, int max = 0, bool sorted = false);
|
||||
|
||||
/** Connects a check box with the target settings type*/
|
||||
void EnhanceCheckBox(QCheckBox* checkbox, SettingsType type);
|
||||
|
|
|
@ -861,7 +861,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> guiSettings, std:
|
|||
|
||||
// Comboboxes
|
||||
|
||||
xemu_settings->EnhanceComboBox(ui->sysLangBox, emu_settings::Language);
|
||||
xemu_settings->EnhanceComboBox(ui->sysLangBox, emu_settings::Language, false, false, 0, true);
|
||||
SubscribeTooltip(ui->sysLangBox, json_sys["sysLangBox"].toString());
|
||||
|
||||
// Checkboxes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue