InputConfigDialog pass the device_cbox to the wiimote extension dialogs

This fixes a crash when trying to open the advanced input config dialog on the wiimote extensions.  The device_cbox wasn't initialised and it should have been with the wiimote one.
This commit is contained in:
aldelaro5 2017-01-27 00:05:09 -05:00
parent 540bf4618c
commit 334e33d4fa
11 changed files with 46 additions and 15 deletions

View File

@ -8,11 +8,15 @@
#include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h"
ClassicInputConfigDialog::ClassicInputConfigDialog(wxWindow* const parent, InputConfig& config, ClassicInputConfigDialog::ClassicInputConfigDialog(wxWindow* const parent, InputConfig& config,
const wxString& name, const int port_num) const wxString& name,
wxComboBox* device_cbox_parent,
const int port_num)
: InputConfigDialog(parent, config, name, port_num) : InputConfigDialog(parent, config, name, port_num)
{ {
const int space5 = FromDIP(5); const int space5 = FromDIP(5);
device_cbox = device_cbox_parent;
auto* const group_box_buttons = new ControlGroupBox( auto* const group_box_buttons = new ControlGroupBox(
Wiimote::GetClassicGroup(port_num, WiimoteEmu::ClassicGroup::Buttons), this, this); Wiimote::GetClassicGroup(port_num, WiimoteEmu::ClassicGroup::Buttons), this, this);
auto* const group_box_dpad = new ControlGroupBox( auto* const group_box_dpad = new ControlGroupBox(

View File

@ -6,9 +6,11 @@
#include "DolphinWX/Input/InputConfigDiag.h" #include "DolphinWX/Input/InputConfigDiag.h"
class wxComboBox;
class ClassicInputConfigDialog final : public InputConfigDialog class ClassicInputConfigDialog final : public InputConfigDialog
{ {
public: public:
ClassicInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name, ClassicInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name,
int port_num = 0); wxComboBox* device_cbox_parent, int port_num = 0);
}; };

View File

@ -8,11 +8,14 @@
#include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h"
DrumsInputConfigDialog::DrumsInputConfigDialog(wxWindow* const parent, InputConfig& config, DrumsInputConfigDialog::DrumsInputConfigDialog(wxWindow* const parent, InputConfig& config,
const wxString& name, const int port_num) const wxString& name, wxComboBox* device_cbox_parent,
const int port_num)
: InputConfigDialog(parent, config, name, port_num) : InputConfigDialog(parent, config, name, port_num)
{ {
const int space5 = FromDIP(5); const int space5 = FromDIP(5);
device_cbox = device_cbox_parent;
auto* const group_box_buttons = new ControlGroupBox( auto* const group_box_buttons = new ControlGroupBox(
Wiimote::GetDrumsGroup(port_num, WiimoteEmu::DrumsGroup::Buttons), this, this); Wiimote::GetDrumsGroup(port_num, WiimoteEmu::DrumsGroup::Buttons), this, this);
auto* const group_box_pads = new ControlGroupBox( auto* const group_box_pads = new ControlGroupBox(

View File

@ -6,9 +6,11 @@
#include "DolphinWX/Input/InputConfigDiag.h" #include "DolphinWX/Input/InputConfigDiag.h"
class wxComboBox;
class DrumsInputConfigDialog final : public InputConfigDialog class DrumsInputConfigDialog final : public InputConfigDialog
{ {
public: public:
DrumsInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name, DrumsInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name,
int port_num = 0); wxComboBox* device_cbox_parent, int port_num = 0);
}; };

View File

@ -8,11 +8,14 @@
#include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h"
GuitarInputConfigDialog::GuitarInputConfigDialog(wxWindow* const parent, InputConfig& config, GuitarInputConfigDialog::GuitarInputConfigDialog(wxWindow* const parent, InputConfig& config,
const wxString& name, const int port_num) const wxString& name,
wxComboBox* device_cbox_parent, const int port_num)
: InputConfigDialog(parent, config, name, port_num) : InputConfigDialog(parent, config, name, port_num)
{ {
const int space5 = FromDIP(5); const int space5 = FromDIP(5);
device_cbox = device_cbox_parent;
auto* const group_box_buttons = new ControlGroupBox( auto* const group_box_buttons = new ControlGroupBox(
Wiimote::GetGuitarGroup(port_num, WiimoteEmu::GuitarGroup::Buttons), this, this); Wiimote::GetGuitarGroup(port_num, WiimoteEmu::GuitarGroup::Buttons), this, this);
auto* const group_left_strum = new ControlGroupBox( auto* const group_left_strum = new ControlGroupBox(

View File

@ -6,9 +6,11 @@
#include "DolphinWX/Input/InputConfigDiag.h" #include "DolphinWX/Input/InputConfigDiag.h"
class wxComboBox;
class GuitarInputConfigDialog final : public InputConfigDialog class GuitarInputConfigDialog final : public InputConfigDialog
{ {
public: public:
GuitarInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name, GuitarInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name,
int port_num = 0); wxComboBox* device_cbox_parent, int port_num = 0);
}; };

View File

@ -71,31 +71,34 @@ void InputConfigDialog::ConfigExtension(wxCommandEvent& event)
{ {
case WiimoteEmu::EXT_NUNCHUK: case WiimoteEmu::EXT_NUNCHUK:
{ {
NunchukInputConfigDialog dlg(this, m_config, _("Nunchuk Configuration"), m_port_num); NunchukInputConfigDialog dlg(this, m_config, _("Nunchuk Configuration"), device_cbox,
m_port_num);
dlg.ShowModal(); dlg.ShowModal();
} }
break; break;
case WiimoteEmu::EXT_CLASSIC: case WiimoteEmu::EXT_CLASSIC:
{ {
ClassicInputConfigDialog dlg(this, m_config, _("Classic Controller Configuration"), m_port_num); ClassicInputConfigDialog dlg(this, m_config, _("Classic Controller Configuration"), device_cbox,
m_port_num);
dlg.ShowModal(); dlg.ShowModal();
} }
break; break;
case WiimoteEmu::EXT_GUITAR: case WiimoteEmu::EXT_GUITAR:
{ {
GuitarInputConfigDialog dlg(this, m_config, _("Guitar Configuration"), m_port_num); GuitarInputConfigDialog dlg(this, m_config, _("Guitar Configuration"), device_cbox, m_port_num);
dlg.ShowModal(); dlg.ShowModal();
} }
break; break;
case WiimoteEmu::EXT_DRUMS: case WiimoteEmu::EXT_DRUMS:
{ {
DrumsInputConfigDialog dlg(this, m_config, _("Drums Configuration"), m_port_num); DrumsInputConfigDialog dlg(this, m_config, _("Drums Configuration"), device_cbox, m_port_num);
dlg.ShowModal(); dlg.ShowModal();
} }
break; break;
case WiimoteEmu::EXT_TURNTABLE: case WiimoteEmu::EXT_TURNTABLE:
{ {
TurntableInputConfigDialog dlg(this, m_config, _("Turntable Configuration"), m_port_num); TurntableInputConfigDialog dlg(this, m_config, _("Turntable Configuration"), device_cbox,
m_port_num);
dlg.ShowModal(); dlg.ShowModal();
} }
break; break;

View File

@ -8,11 +8,15 @@
#include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h"
NunchukInputConfigDialog::NunchukInputConfigDialog(wxWindow* const parent, InputConfig& config, NunchukInputConfigDialog::NunchukInputConfigDialog(wxWindow* const parent, InputConfig& config,
const wxString& name, const int port_num) const wxString& name,
wxComboBox* device_cbox_parent,
const int port_num)
: InputConfigDialog(parent, config, name, port_num) : InputConfigDialog(parent, config, name, port_num)
{ {
const int space5 = FromDIP(5); const int space5 = FromDIP(5);
device_cbox = device_cbox_parent;
auto* const group_box_buttons = new ControlGroupBox( auto* const group_box_buttons = new ControlGroupBox(
Wiimote::GetNunchukGroup(port_num, WiimoteEmu::NunchukGroup::Buttons), this, this); Wiimote::GetNunchukGroup(port_num, WiimoteEmu::NunchukGroup::Buttons), this, this);
auto* const group_box_shake = new ControlGroupBox( auto* const group_box_shake = new ControlGroupBox(

View File

@ -6,9 +6,11 @@
#include "DolphinWX/Input/InputConfigDiag.h" #include "DolphinWX/Input/InputConfigDiag.h"
class wxComboBox;
class NunchukInputConfigDialog final : public InputConfigDialog class NunchukInputConfigDialog final : public InputConfigDialog
{ {
public: public:
NunchukInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name, NunchukInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name,
int port_num = 0); wxComboBox* device_cbox_parent, int port_num = 0);
}; };

View File

@ -8,11 +8,15 @@
#include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h"
TurntableInputConfigDialog::TurntableInputConfigDialog(wxWindow* const parent, InputConfig& config, TurntableInputConfigDialog::TurntableInputConfigDialog(wxWindow* const parent, InputConfig& config,
const wxString& name, const int port_num) const wxString& name,
wxComboBox* device_cbox_parent,
const int port_num)
: InputConfigDialog(parent, config, name, port_num) : InputConfigDialog(parent, config, name, port_num)
{ {
const int space5 = FromDIP(5); const int space5 = FromDIP(5);
device_cbox = device_cbox_parent;
auto* const group_box_stick = new ControlGroupBox( auto* const group_box_stick = new ControlGroupBox(
Wiimote::GetTurntableGroup(port_num, WiimoteEmu::TurntableGroup::Stick), this, this); Wiimote::GetTurntableGroup(port_num, WiimoteEmu::TurntableGroup::Stick), this, this);
auto* const group_box_effect_dial = new ControlGroupBox( auto* const group_box_effect_dial = new ControlGroupBox(

View File

@ -6,9 +6,11 @@
#include "DolphinWX/Input/InputConfigDiag.h" #include "DolphinWX/Input/InputConfigDiag.h"
class wxComboBox;
class TurntableInputConfigDialog final : public InputConfigDialog class TurntableInputConfigDialog final : public InputConfigDialog
{ {
public: public:
TurntableInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name, TurntableInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name,
int port_num = 0); wxComboBox* device_cbox_parent, int port_num = 0);
}; };