diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2019-10-28 16:39:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-28 16:39:10 +0100 |
| commit | 1f3d1a9b7fa2d4729ddadfc0fc923c7730a00a49 (patch) | |
| tree | 59c9aac33c104d3dc5b4039773b876cd6c389b4f /Source/Core/DolphinQt/Config/ControllersWindow.cpp | |
| parent | a825e7e09f8a39772b10c83db5322dc88e0f591f (diff) | |
| parent | da1f153b47a3f3f4eb9b976670bfddf68108bae9 (diff) | |
Merge pull request #8352 from rlnilsen/motion-controller-support-via-cemuhook-protocol
Support for motion controllers like the DualShock 4
Diffstat (limited to 'Source/Core/DolphinQt/Config/ControllersWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Config/ControllersWindow.cpp | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/Source/Core/DolphinQt/Config/ControllersWindow.cpp b/Source/Core/DolphinQt/Config/ControllersWindow.cpp index 304ae7364c..1df7b1d9a7 100644 --- a/Source/Core/DolphinQt/Config/ControllersWindow.cpp +++ b/Source/Core/DolphinQt/Config/ControllersWindow.cpp @@ -31,6 +31,7 @@ #include "Core/IOS/IOS.h" #include "Core/IOS/USB/Bluetooth/BTReal.h" +#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h" #include "DolphinQt/Config/Mapping/GCPadWiiUConfigDialog.h" #include "DolphinQt/Config/Mapping/MappingWindow.h" #include "DolphinQt/QtUtils/ModalMessageBox.h" @@ -67,7 +68,7 @@ ControllersWindow::ControllersWindow(QWidget* parent) : QDialog(parent) CreateGamecubeLayout(); CreateWiimoteLayout(); - CreateAdvancedLayout(); + CreateCommonLayout(); CreateMainLayout(); LoadSettings(); ConnectWidgets(); @@ -199,15 +200,18 @@ void ControllersWindow::CreateWiimoteLayout() m_wiimote_layout->addWidget(m_wiimote_speaker_data, m_wiimote_layout->rowCount(), 1, 1, -1); } -void ControllersWindow::CreateAdvancedLayout() +void ControllersWindow::CreateCommonLayout() { - m_advanced_box = new QGroupBox(tr("Advanced")); - m_advanced_layout = new QHBoxLayout(); - m_advanced_bg_input = new QCheckBox(tr("Background Input")); + // i18n: This is "common" as in "shared", not the opposite of "uncommon" + m_common_box = new QGroupBox(tr("Common")); + m_common_layout = new QVBoxLayout(); + m_common_bg_input = new QCheckBox(tr("Background Input")); + m_common_configure_controller_interface = new QPushButton(tr("Alternate Input Sources")); - m_advanced_layout->addWidget(m_advanced_bg_input); + m_common_layout->addWidget(m_common_bg_input); + m_common_layout->addWidget(m_common_configure_controller_interface); - m_advanced_box->setLayout(m_advanced_layout); + m_common_box->setLayout(m_common_layout); } void ControllersWindow::CreateMainLayout() @@ -217,7 +221,8 @@ void ControllersWindow::CreateMainLayout() layout->addWidget(m_gc_box); layout->addWidget(m_wiimote_box); - layout->addWidget(m_advanced_box); + layout->addWidget(m_common_box); + layout->addStretch(); layout->addWidget(m_button_box); WrapInScrollArea(this, layout); @@ -232,7 +237,9 @@ void ControllersWindow::ConnectWidgets() connect(m_wiimote_passthrough, &QRadioButton::toggled, this, &ControllersWindow::OnWiimoteModeChanged); - connect(m_advanced_bg_input, &QCheckBox::toggled, this, &ControllersWindow::SaveSettings); + connect(m_common_bg_input, &QCheckBox::toggled, this, &ControllersWindow::SaveSettings); + connect(m_common_configure_controller_interface, &QPushButton::clicked, this, + &ControllersWindow::OnControllerInterfaceConfigure); connect(m_wiimote_continuous_scanning, &QCheckBox::toggled, this, &ControllersWindow::SaveSettings); connect(m_wiimote_real_balance_board, &QCheckBox::toggled, this, @@ -462,6 +469,14 @@ void ControllersWindow::OnWiimoteConfigure() window->show(); } +void ControllersWindow::OnControllerInterfaceConfigure() +{ + ControllerInterfaceWindow* window = new ControllerInterfaceWindow(this); + window->setAttribute(Qt::WA_DeleteOnClose, true); + window->setWindowModality(Qt::WindowModality::WindowModal); + window->show(); +} + void ControllersWindow::LoadSettings() { for (size_t i = 0; i < m_wiimote_groups.size(); i++) @@ -480,7 +495,7 @@ void ControllersWindow::LoadSettings() m_wiimote_speaker_data->setChecked(SConfig::GetInstance().m_WiimoteEnableSpeaker); m_wiimote_continuous_scanning->setChecked(SConfig::GetInstance().m_WiimoteContinuousScanning); - m_advanced_bg_input->setChecked(SConfig::GetInstance().m_BackgroundInput); + m_common_bg_input->setChecked(SConfig::GetInstance().m_BackgroundInput); if (SConfig::GetInstance().m_bt_passthrough_enabled) m_wiimote_passthrough->setChecked(true); @@ -495,7 +510,7 @@ void ControllersWindow::SaveSettings() SConfig::GetInstance().m_WiimoteEnableSpeaker = m_wiimote_speaker_data->isChecked(); SConfig::GetInstance().m_WiimoteContinuousScanning = m_wiimote_continuous_scanning->isChecked(); SConfig::GetInstance().m_bt_passthrough_enabled = m_wiimote_passthrough->isChecked(); - SConfig::GetInstance().m_BackgroundInput = m_advanced_bg_input->isChecked(); + SConfig::GetInstance().m_BackgroundInput = m_common_bg_input->isChecked(); WiimoteReal::ChangeWiimoteSource(WIIMOTE_BALANCE_BOARD, m_wiimote_real_balance_board->isChecked() ? WIIMOTE_SRC_REAL : |
