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

@ -83,9 +83,8 @@ void MappingButton::OnButtonTimeout()
void MappingButton::Clear()
{
m_parent->Update();
m_reference->SetExpression("");
Update();
m_parent->SaveSettings();
}
void MappingButton::Update()
@ -93,7 +92,6 @@ void MappingButton::Update()
const auto lock = ControllerEmu::EmulatedController::GetStateLock();
m_reference->UpdateReference(g_controller_interface, m_parent->GetParent()->GetDeviceQualifier());
setText(EscapeAmpersand(QString::fromStdString(m_reference->GetExpression())));
m_parent->SaveSettings();
}
void MappingButton::mouseReleaseEvent(QMouseEvent* event)