From 0d43de516cf804355685ce4c934063f9811e43f9 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Wed, 27 Apr 2016 08:35:46 +0100 Subject: [PATCH] onepad: Remove wx2.8 compatibility code --- plugins/onepad/Linux/GamepadConfiguration.cpp | 15 ++------ .../onepad/Linux/JoystickConfiguration.cpp | 15 ++------ plugins/onepad/Linux/dialog.cpp | 38 ++++++------------- 3 files changed, 19 insertions(+), 49 deletions(-) diff --git a/plugins/onepad/Linux/GamepadConfiguration.cpp b/plugins/onepad/Linux/GamepadConfiguration.cpp index 52573d744a..6cadcbee9f 100644 --- a/plugins/onepad/Linux/GamepadConfiguration.cpp +++ b/plugins/onepad/Linux/GamepadConfiguration.cpp @@ -128,17 +128,10 @@ GamepadConfiguration::GamepadConfiguration(int pad, wxWindow *parent) : wxFrame( ); // Connect the checkboxes to the OnCheckboxClicked Event - #if wxMAJOR_VERSION >= 3 - Connect( - wxEVT_CHECKBOX, - wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange) - ); - #else - Connect( - wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange) - ); - #endif + Connect( + wxEVT_CHECKBOX, + wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange) + ); repopulate(); } diff --git a/plugins/onepad/Linux/JoystickConfiguration.cpp b/plugins/onepad/Linux/JoystickConfiguration.cpp index 3c417a8a27..ab81d3ab20 100644 --- a/plugins/onepad/Linux/JoystickConfiguration.cpp +++ b/plugins/onepad/Linux/JoystickConfiguration.cpp @@ -113,17 +113,10 @@ JoystickConfiguration::JoystickConfiguration(int pad, bool left, wxWindow *paren ); // Connect the checkboxes to the OnCheckboxClicked Event - #if wxMAJOR_VERSION >= 3 - Connect( - wxEVT_CHECKBOX, - wxCommandEventHandler(JoystickConfiguration::OnCheckboxChange) - ); - #else - Connect( - wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(JoystickConfiguration::OnCheckboxChange) - ); - #endif + Connect( + wxEVT_CHECKBOX, + wxCommandEventHandler(JoystickConfiguration::OnCheckboxChange) + ); } /** diff --git a/plugins/onepad/Linux/dialog.cpp b/plugins/onepad/Linux/dialog.cpp index 46ab7628eb..e1e92212b1 100644 --- a/plugins/onepad/Linux/dialog.cpp +++ b/plugins/onepad/Linux/dialog.cpp @@ -632,15 +632,9 @@ void Dialog::config_key(int pad, int key) } } } - #if wxMAJOR_VERSION >= 3 - m_bt_gamepad[pad][key]->SetLabel( - KeyName(pad, key, m_simulatedKeys[pad][key]).c_str() - ); - #else - m_bt_gamepad[pad][key]->SetLabel( - wxString(KeyName(pad, key, m_simulatedKeys[pad][key]).c_str(), wxConvUTF8) - ); - #endif + m_bt_gamepad[pad][key]->SetLabel( + KeyName(pad, key, m_simulatedKeys[pad][key]).c_str() + ); } void Dialog::clear_key(int pad, int key) @@ -680,15 +674,9 @@ void Dialog::repopulate() { if (get_key(gamepad_id, key) != 0) { - #if wxMAJOR_VERSION >= 3 - m_bt_gamepad[gamepad_id][key]->SetLabel( - KeyName(gamepad_id, key).c_str() - ); - #else - m_bt_gamepad[gamepad_id][key]->SetLabel( - wxString(KeyName(gamepad_id, key).c_str(), wxConvUTF8) - ); - #endif + m_bt_gamepad[gamepad_id][key]->SetLabel( + KeyName(gamepad_id, key).c_str() + ); m_map_images[gamepad_id][get_key(gamepad_id, key)] = key; } @@ -701,15 +689,11 @@ void Dialog::repopulate() { int keysym = it->first; int key = it->second; - #if wxMAJOR_VERSION >= 3 - m_bt_gamepad[gamepad_id][key]->SetLabel( - KeyName(gamepad_id, key, keysym).c_str() - ); - #else - m_bt_gamepad[gamepad_id][key]->SetLabel( - wxString(KeyName(gamepad_id, key, keysym).c_str(), wxConvUTF8) - ); - #endif + + m_bt_gamepad[gamepad_id][key]->SetLabel( + KeyName(gamepad_id, key, keysym).c_str() + ); + m_simulatedKeys[gamepad_id][key] = keysym; m_map_images[gamepad_id][keysym] = key; }