diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingWindow.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingWindow.cpp index df3f10bd34..46b4b1f302 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingWindow.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingWindow.cpp @@ -579,3 +579,8 @@ void MappingWindow::ShowExtensionMotionTabs(bool show) m_tab_widget->removeTab(4); } } + +void MappingWindow::ActivateExtensionTab() +{ + m_tab_widget->setCurrentIndex(3); +} diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingWindow.h b/Source/Core/DolphinQt/Config/Mapping/MappingWindow.h index f2c8717427..e51df977f3 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingWindow.h +++ b/Source/Core/DolphinQt/Config/Mapping/MappingWindow.h @@ -53,6 +53,7 @@ public: ControllerEmu::EmulatedController* GetController() const; bool IsMappingAllDevices() const; void ShowExtensionMotionTabs(bool show); + void ActivateExtensionTab(); signals: // Emitted when config has changed so widgets can update to reflect the change. diff --git a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp index 85512c8a2b..2ee1201e24 100644 --- a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.cpp @@ -59,7 +59,13 @@ void WiimoteEmuGeneral::CreateMainLayout() extension->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - static_cast(extension->layout())->insertRow(0, combo_hbox); + auto* const ext_layout = static_cast(extension->layout()); + ext_layout->insertRow(0, combo_hbox); + + m_configure_ext_button = new QPushButton(tr("Configure Extension")); + m_configure_ext_button->setDisabled(true); + m_configure_ext_button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + ext_layout->insertRow(1, m_configure_ext_button); layout->addWidget(extension, 0, 3); layout->addWidget(CreateGroupBox(tr("Rumble"), Wiimote::GetWiimoteGroup( @@ -81,6 +87,8 @@ void WiimoteEmuGeneral::Connect() connect(m_extension_combo, &QComboBox::activated, this, &WiimoteEmuGeneral::OnAttachmentSelected); connect(this, &MappingWidget::ConfigChanged, this, &WiimoteEmuGeneral::ConfigChanged); connect(this, &MappingWidget::Update, this, &WiimoteEmuGeneral::Update); + connect(m_configure_ext_button, &QPushButton::clicked, GetParent(), + &MappingWindow::ActivateExtensionTab); } void WiimoteEmuGeneral::OnAttachmentChanged(int extension) @@ -88,6 +96,8 @@ void WiimoteEmuGeneral::OnAttachmentChanged(int extension) GetParent()->ShowExtensionMotionTabs(extension == WiimoteEmu::ExtensionNumber::NUNCHUK); m_extension_widget->ChangeExtensionType(extension); + + m_configure_ext_button->setEnabled(extension != WiimoteEmu::ExtensionNumber::NONE); } void WiimoteEmuGeneral::OnAttachmentSelected(int extension) diff --git a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h index b3bd5d06e1..ec7bb2eef2 100644 --- a/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h +++ b/Source/Core/DolphinQt/Config/Mapping/WiimoteEmuGeneral.h @@ -34,6 +34,7 @@ private: // Extensions QComboBox* m_extension_combo; QLabel* m_extension_combo_dynamic_indicator; + QPushButton* m_configure_ext_button; WiimoteEmuExtension* m_extension_widget; };