mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-31 10:01:26 +02:00
DolphinQt: Add a "Configure Extension" button under the extension
selection combo box.
This commit is contained in:
parent
510a688a2a
commit
a33368b102
@ -579,3 +579,8 @@ void MappingWindow::ShowExtensionMotionTabs(bool show)
|
||||
m_tab_widget->removeTab(4);
|
||||
}
|
||||
}
|
||||
|
||||
void MappingWindow::ActivateExtensionTab()
|
||||
{
|
||||
m_tab_widget->setCurrentIndex(3);
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user