diff options
| author | Tilka <tilkax@gmail.com> | 2018-10-14 02:22:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-14 02:22:54 +0100 |
| commit | e18fbb9bd35fc1df74670f5a37ca6b120d974513 (patch) | |
| tree | ca0f12173d59e4c07935118c4a9d87d7af033f78 /Source/Core | |
| parent | 9a1f2596267ab95dabccaaba80bbe4cbe96ec697 (diff) | |
| parent | f257630c0a41f6e6155c3ad7e3f2ec1b1357c6ef (diff) | |
Merge pull request #7449 from amaiorano/fix-extensions-combo-update-on-reset-defaults
Fix extensions combo update on reset defaults
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp | 13 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h | 3 |
2 files changed, 11 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp index 1b632a96d0..11a7533589 100644 --- a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp @@ -13,6 +13,7 @@ #include "Core/HW/Wiimote.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h" +#include "DolphinQt/Config/Mapping/MappingWindow.h" #include "DolphinQt/Config/Mapping/WiimoteEmuExtension.h" #include "InputCommon/ControllerEmu/ControlGroup/Extension.h" @@ -23,7 +24,7 @@ WiimoteEmuGeneral::WiimoteEmuGeneral(MappingWindow* window, WiimoteEmuExtension* : MappingWidget(window), m_extension_widget(extension) { CreateMainLayout(); - Connect(); + Connect(window); } void WiimoteEmuGeneral::CreateMainLayout() @@ -66,10 +67,11 @@ void WiimoteEmuGeneral::CreateMainLayout() setLayout(m_main_layout); } -void WiimoteEmuGeneral::Connect() +void WiimoteEmuGeneral::Connect(MappingWindow* window) { connect(m_extension_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &WiimoteEmuGeneral::OnAttachmentChanged); + connect(window, &MappingWindow::Update, this, &WiimoteEmuGeneral::Update); } void WiimoteEmuGeneral::OnAttachmentChanged(int extension) @@ -92,14 +94,17 @@ void WiimoteEmuGeneral::OnAttachmentChanged(int extension) SaveSettings(); } -void WiimoteEmuGeneral::LoadSettings() +void WiimoteEmuGeneral::Update() { auto* ce_extension = static_cast<ControllerEmu::Extension*>( Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Extension)); m_extension_combo->setCurrentIndex(ce_extension->switch_extension); - OnAttachmentChanged(ce_extension->switch_extension); +} +void WiimoteEmuGeneral::LoadSettings() +{ + Update(); Wiimote::LoadConfig(); } diff --git a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h index 19a7ab7d32..aa6dd3a5f5 100644 --- a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h +++ b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h @@ -22,8 +22,9 @@ private: void LoadSettings() override; void SaveSettings() override; void CreateMainLayout(); - void Connect(); + void Connect(MappingWindow* window); void OnAttachmentChanged(int index); + void Update(); // Main QHBoxLayout* m_main_layout; |
