mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 22:59:47 -06:00
Qt Mapping*: make logic around setting/loading settings more consistent
Changes: - signal for widget value changed: sets controller setting, saves settings - Update(): only updates widget from existing controller setting - Clear(): sets controller setting, saves settings, and calls Update()
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
MappingBool::MappingBool(MappingWidget* widget, ControllerEmu::BooleanSetting* setting)
|
||||
: QCheckBox(QString::fromStdString(setting->m_ui_name)), m_parent(widget), m_setting(setting)
|
||||
{
|
||||
setChecked(setting->GetValue());
|
||||
Update();
|
||||
Connect();
|
||||
}
|
||||
|
||||
@ -18,18 +18,18 @@ void MappingBool::Connect()
|
||||
{
|
||||
connect(this, &QCheckBox::stateChanged, this, [this](int value) {
|
||||
m_setting->SetValue(value);
|
||||
Update();
|
||||
m_parent->SaveSettings();
|
||||
});
|
||||
}
|
||||
|
||||
void MappingBool::Clear()
|
||||
{
|
||||
setChecked(false);
|
||||
m_setting->SetValue(false);
|
||||
m_parent->SaveSettings();
|
||||
Update();
|
||||
}
|
||||
|
||||
void MappingBool::Update()
|
||||
{
|
||||
setChecked(m_setting->GetValue());
|
||||
m_parent->SaveSettings();
|
||||
}
|
||||
|
Reference in New Issue
Block a user