diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2016-07-14 17:45:59 +0200 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2016-07-29 17:18:37 +0200 |
| commit | 93f5df419521171c11e16d6a8ff84b9d0d8fd6c0 (patch) | |
| tree | f0d915225a6221acc88716b6f7f8c62a1963fc7a /Source/Core/DolphinWX/InputConfigDiag.cpp | |
| parent | 0d783f0869eaef163a318ab4d79744f592ed1cc5 (diff) | |
ControllerInterface: Add RemoveDevice()
This adds RemoveDevice() to ControllerInterface, fixes ExpressionParser
and some other code to support device removals without crashing,
and adds an IsValid() method to Device, to prepare for hotplugging.
Diffstat (limited to 'Source/Core/DolphinWX/InputConfigDiag.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/InputConfigDiag.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/Core/DolphinWX/InputConfigDiag.cpp b/Source/Core/DolphinWX/InputConfigDiag.cpp index 2a5aa997e3..cad5d3496a 100644 --- a/Source/Core/DolphinWX/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/InputConfigDiag.cpp @@ -315,11 +315,12 @@ bool ControlDialog::Validate() { control_reference->expression = WxStrToStr(textctrl->GetValue()); + auto lock = ControllerEmu::GetStateLock(); g_controller_interface.UpdateReference(control_reference, m_parent->controller->default_device); UpdateGUI(); - return (control_reference->parse_error == EXPRESSION_PARSE_SUCCESS); + return control_reference->parse_error == EXPRESSION_PARSE_SUCCESS; } void GamepadPage::SetDevice(wxCommandEvent&) @@ -351,6 +352,7 @@ void ControlDialog::ClearControl(wxCommandEvent&) { control_reference->expression.clear(); + auto lock = ControllerEmu::GetStateLock(); g_controller_interface.UpdateReference(control_reference, m_parent->controller->default_device); UpdateGUI(); @@ -408,6 +410,7 @@ void ControlDialog::SetSelectedControl(wxCommandEvent&) textctrl->WriteText(expr); control_reference->expression = textctrl->GetValue(); + auto lock = ControllerEmu::GetStateLock(); g_controller_interface.UpdateReference(control_reference, m_parent->controller->default_device); UpdateGUI(); @@ -442,6 +445,7 @@ void ControlDialog::AppendControl(wxCommandEvent& event) textctrl->WriteText(expr); control_reference->expression = textctrl->GetValue(); + auto lock = ControllerEmu::GetStateLock(); g_controller_interface.UpdateReference(control_reference, m_parent->controller->default_device); UpdateGUI(); @@ -556,6 +560,7 @@ bool GamepadPage::DetectButton(ControlButton* button) wxString expr; GetExpressionForControl(expr, control_name); button->control_reference->expression = expr; + auto lock = ControllerEmu::GetStateLock(); g_controller_interface.UpdateReference(button->control_reference, controller->default_device); success = true; } |
