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:
Michael M
2017-11-03 13:28:45 -07:00
parent bb38b39952
commit 14f22ad829
4 changed files with 12 additions and 15 deletions

View File

@ -57,14 +57,15 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con
auto* control_ref = control->control_ref.get();
connect(button, &MappingButton::AdvancedPressed, [this, control_ref] {
connect(button, &MappingButton::AdvancedPressed, [this, button, control_ref] {
if (m_parent->GetDevice() == nullptr)
return;
IOWindow io(this, m_parent->GetController(), control_ref,
control_ref->IsInput() ? IOWindow::Type::Input : IOWindow::Type::Output);
io.exec();
Update();
SaveSettings();
button->Update();
});
m_buttons.push_back(button);
@ -111,8 +112,6 @@ void MappingWidget::Update()
for (auto* checkbox : m_bools)
checkbox->Update();
LoadSettings();
}
ControllerEmu::EmulatedController* MappingWidget::GetController() const