Merge pull request #13297 from jordan-woyak/config-ext-btn

DolphinQt: Add a "Configure Extension" button under the extension selection combo box.
This commit is contained in:
JMC47 2025-01-27 21:17:41 -05:00 committed by GitHub
commit f92f174450
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 1 deletions

View File

@ -579,3 +579,8 @@ void MappingWindow::ShowExtensionMotionTabs(bool show)
m_tab_widget->removeTab(4);
}
}
void MappingWindow::ActivateExtensionTab()
{
m_tab_widget->setCurrentIndex(3);
}

View File

@ -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.

View File

@ -59,7 +59,13 @@ void WiimoteEmuGeneral::CreateMainLayout()
extension->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
static_cast<QFormLayout*>(extension->layout())->insertRow(0, combo_hbox);
auto* const ext_layout = static_cast<QFormLayout*>(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)

View File

@ -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;
};