Move pairing dialog:

- Trigger button moved to main input settings
- Source code moved to `gui/input`
This commit is contained in:
capitalistspz 2024-11-22 10:38:47 +00:00
parent 409f12b13a
commit 471f9b65e2
5 changed files with 12 additions and 15 deletions

View File

@ -75,6 +75,8 @@ add_library(CemuGui
input/InputAPIAddWindow.h
input/InputSettings2.cpp
input/InputSettings2.h
input/PairingDialog.cpp
input/PairingDialog.h
input/panels/ClassicControllerInputPanel.cpp
input/panels/ClassicControllerInputPanel.h
input/panels/InputPanel.cpp
@ -97,8 +99,6 @@ add_library(CemuGui
MemorySearcherTool.h
PadViewFrame.cpp
PadViewFrame.h
PairingDialog.cpp
PairingDialog.h
TitleManager.cpp
TitleManager.h
EmulatedUSBDevices/EmulatedUSBDeviceFrame.cpp

View File

@ -20,6 +20,8 @@
#include "gui/input/InputAPIAddWindow.h"
#include "input/ControllerFactory.h"
#include "gui/input/PairingDialog.h"
#include "gui/input/panels/VPADInputPanel.h"
#include "gui/input/panels/ProControllerInputPanel.h"
@ -252,6 +254,13 @@ wxWindow* InputSettings2::initialize_page(size_t index)
page_data.m_controller_api_remove = remove_api;
}
auto* pairingDialog = new wxButton(page, wxID_ANY, _("Pair Wii/Wii U Controller"));
pairingDialog->Bind(wxEVT_BUTTON, [this](wxEvent&) {
PairingDialog pairing_dialog(this);
pairing_dialog.ShowModal();
});
sizer->Add(pairingDialog, wxGBPosition(5, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL, 5);
// controller
auto* controller_bttns = new wxBoxSizer(wxHORIZONTAL);
auto* settings = new wxButton(page, wxID_ANY, _("Settings"), wxDefaultPosition, wxDefaultSize, 0);

View File

@ -1,5 +1,5 @@
#include "gui/wxgui.h"
#include "gui/PairingDialog.h"
#include "PairingDialog.h"
#if BOOST_OS_WINDOWS
#include <bluetoothapis.h>

View File

@ -12,7 +12,6 @@
#include "input/emulated/WiimoteController.h"
#include "gui/helpers/wxHelpers.h"
#include "gui/components/wxInputDraw.h"
#include "gui/PairingDialog.h"
constexpr WiimoteController::ButtonId g_kFirstColumnItems[] =
{
@ -40,11 +39,6 @@ WiimoteInputPanel::WiimoteInputPanel(wxWindow* parent)
auto* main_sizer = new wxBoxSizer(wxVERTICAL);
auto* horiz_main_sizer = new wxBoxSizer(wxHORIZONTAL);
auto* pair_button = new wxButton(this, wxID_ANY, _("Pair a Wii or Wii U controller"));
pair_button->Bind(wxEVT_BUTTON, &WiimoteInputPanel::on_pair_button, this);
horiz_main_sizer->Add(pair_button);
horiz_main_sizer->AddSpacer(10);
auto* extensions_sizer = new wxBoxSizer(wxHORIZONTAL);
horiz_main_sizer->Add(extensions_sizer, wxSizerFlags(0).Align(wxALIGN_CENTER_VERTICAL));
@ -264,9 +258,3 @@ void WiimoteInputPanel::load_controller(const EmulatedControllerPtr& emulated_co
set_active_device_type(wiimote->get_device_type());
}
}
void WiimoteInputPanel::on_pair_button(wxCommandEvent& event)
{
PairingDialog pairing_dialog(this);
pairing_dialog.ShowModal();
}