WiiPane: Use ConfigControls where applicable

This commit is contained in:
Joshua Vandaële
2025-08-13 00:39:46 +02:00
parent b6766e1ca0
commit 02d84ddc78
7 changed files with 154 additions and 212 deletions

View File

@@ -25,6 +25,26 @@ void ConfigChoice::OnConfigChanged()
setCurrentIndex(ReadValue(m_setting));
}
ConfigChoiceU32::ConfigChoiceU32(const QStringList& options, const Config::Info<u32>& setting,
Config::Layer* layer)
: ConfigControl(setting.GetLocation(), layer), m_setting(setting)
{
addItems(options);
setCurrentIndex(ReadValue(setting));
connect(this, &QComboBox::currentIndexChanged, this, &ConfigChoiceU32::Update);
}
void ConfigChoiceU32::Update(int choice)
{
SaveValue(m_setting, (u32)choice);
}
void ConfigChoiceU32::OnConfigChanged()
{
setCurrentIndex(ReadValue(m_setting));
}
ConfigStringChoice::ConfigStringChoice(const std::vector<std::string>& options,
const Config::Info<std::string>& setting,
Config::Layer* layer)