Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui/input: Move pairing dialog button and source #1424

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -97,8 +99,6 @@ add_library(CemuGui
MemorySearcherTool.h
PadViewFrame.cpp
PadViewFrame.h
PairingDialog.cpp
PairingDialog.h
TitleManager.cpp
TitleManager.h
EmulatedUSBDevices/EmulatedUSBDeviceFrame.cpp
Expand Down
9 changes: 9 additions & 0 deletions src/gui/input/InputSettings2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "gui/wxgui.h"
#include "gui/PairingDialog.h"
#include "PairingDialog.h"

#if BOOST_OS_WINDOWS
#include <bluetoothapis.h>
Expand Down
File renamed without changes.
12 changes: 0 additions & 12 deletions src/gui/input/panels/WiimoteInputPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[] =
{
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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();
}
Loading