2015-03-18 22:00:27 +00:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2015-03-18 22:00:27 +00:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2016-10-31 20:51:35 +00:00
|
|
|
#include <wx/button.h>
|
2015-03-18 22:00:27 +00:00
|
|
|
#include <wx/checkbox.h>
|
|
|
|
#include <wx/choice.h>
|
|
|
|
#include <wx/gbsizer.h>
|
2016-10-31 20:51:35 +00:00
|
|
|
#include <wx/listbox.h>
|
2015-03-18 22:00:27 +00:00
|
|
|
#include <wx/sizer.h>
|
2016-09-12 18:25:36 +00:00
|
|
|
#include <wx/slider.h>
|
2015-03-18 22:00:27 +00:00
|
|
|
#include <wx/stattext.h>
|
|
|
|
|
2017-08-01 14:37:42 +00:00
|
|
|
#include "Common/Config/Config.h"
|
|
|
|
#include "Core/Config/SYSCONFSettings.h"
|
2015-03-18 22:00:27 +00:00
|
|
|
#include "Core/ConfigManager.h"
|
|
|
|
#include "Core/Core.h"
|
2017-04-29 14:11:22 +00:00
|
|
|
#include "Core/IOS/IOS.h"
|
2016-10-31 20:51:35 +00:00
|
|
|
#include "DolphinWX/Config/AddUSBDeviceDiag.h"
|
|
|
|
#include "DolphinWX/Config/WiiConfigPane.h"
|
2016-08-02 06:22:37 +00:00
|
|
|
#include "DolphinWX/DolphinSlider.h"
|
2016-11-05 12:29:29 +00:00
|
|
|
#include "DolphinWX/WxEventUtils.h"
|
2016-06-24 08:43:46 +00:00
|
|
|
#include "DolphinWX/WxUtils.h"
|
2016-10-31 20:51:35 +00:00
|
|
|
#include "UICommon/USBUtils.h"
|
2015-03-18 22:00:27 +00:00
|
|
|
|
2017-04-11 09:12:44 +00:00
|
|
|
// SYSCONF uses 0 for bottom and 1 for top, but we place them in
|
|
|
|
// the other order in the GUI so that Top will be above Bottom,
|
|
|
|
// matching the respective physical placements of the sensor bar.
|
|
|
|
// This also matches the layout of the settings in the Wii Menu.
|
|
|
|
static int TranslateSensorBarPosition(int position)
|
|
|
|
{
|
|
|
|
if (position == 0)
|
|
|
|
return 1;
|
|
|
|
if (position == 1)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return position;
|
|
|
|
}
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
WiiConfigPane::WiiConfigPane(wxWindow* parent, wxWindowID id) : wxPanel(parent, id)
|
2015-03-18 22:00:27 +00:00
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
InitializeGUI();
|
|
|
|
LoadGUIValues();
|
2016-11-05 12:29:29 +00:00
|
|
|
BindEvents();
|
2017-08-02 18:14:37 +00:00
|
|
|
// This is only safe because WiiConfigPane is owned by CConfigMain, which exists
|
|
|
|
// as long as the DolphinWX app exists.
|
|
|
|
Config::AddConfigChangedCallback([&] { Core::QueueHostJob([&] { LoadGUIValues(); }, true); });
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::InitializeGUI()
|
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
m_aspect_ratio_strings.Add("4:3");
|
|
|
|
m_aspect_ratio_strings.Add("16:9");
|
|
|
|
|
|
|
|
m_system_language_strings.Add(_("Japanese"));
|
|
|
|
m_system_language_strings.Add(_("English"));
|
|
|
|
m_system_language_strings.Add(_("German"));
|
|
|
|
m_system_language_strings.Add(_("French"));
|
|
|
|
m_system_language_strings.Add(_("Spanish"));
|
|
|
|
m_system_language_strings.Add(_("Italian"));
|
|
|
|
m_system_language_strings.Add(_("Dutch"));
|
|
|
|
m_system_language_strings.Add(_("Simplified Chinese"));
|
|
|
|
m_system_language_strings.Add(_("Traditional Chinese"));
|
|
|
|
m_system_language_strings.Add(_("Korean"));
|
|
|
|
|
2016-09-12 18:25:36 +00:00
|
|
|
m_bt_sensor_bar_pos_strings.Add(_("Top"));
|
2017-04-11 09:12:44 +00:00
|
|
|
m_bt_sensor_bar_pos_strings.Add(_("Bottom"));
|
2016-09-12 18:25:36 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
m_pal60_mode_checkbox = new wxCheckBox(this, wxID_ANY, _("Use PAL60 Mode (EuRGB60)"));
|
2017-04-11 08:19:19 +00:00
|
|
|
m_screensaver_checkbox = new wxCheckBox(this, wxID_ANY, _("Enable Screen Saver"));
|
2016-06-24 08:43:46 +00:00
|
|
|
m_aspect_ratio_choice =
|
|
|
|
new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_aspect_ratio_strings);
|
|
|
|
m_system_language_choice =
|
|
|
|
new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_system_language_strings);
|
|
|
|
m_sd_card_checkbox = new wxCheckBox(this, wxID_ANY, _("Insert SD Card"));
|
|
|
|
m_connect_keyboard_checkbox = new wxCheckBox(this, wxID_ANY, _("Connect USB Keyboard"));
|
2016-10-31 20:51:35 +00:00
|
|
|
m_usb_passthrough_devices_listbox =
|
|
|
|
new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 100));
|
|
|
|
m_usb_passthrough_add_device_btn = new wxButton(this, wxID_ANY, _("Add..."));
|
|
|
|
m_usb_passthrough_rem_device_btn = new wxButton(this, wxID_ANY, _("Remove"));
|
2016-09-12 18:25:36 +00:00
|
|
|
m_bt_sensor_bar_pos =
|
|
|
|
new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_bt_sensor_bar_pos_strings);
|
2016-08-02 06:22:37 +00:00
|
|
|
m_bt_sensor_bar_sens = new DolphinSlider(this, wxID_ANY, 0, 0, 4);
|
|
|
|
m_bt_speaker_volume = new DolphinSlider(this, wxID_ANY, 0, 0, 127);
|
2017-08-11 19:15:51 +00:00
|
|
|
m_bt_wiimote_motor_checkbox = new wxCheckBox(this, wxID_ANY, _("Wii Remote Rumble"));
|
2016-09-12 18:25:36 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
m_pal60_mode_checkbox->SetToolTip(_("Sets the Wii display mode to 60Hz (480i) instead of 50Hz "
|
|
|
|
"(576i) for PAL games.\nMay not work for all games."));
|
2017-04-11 08:19:19 +00:00
|
|
|
m_screensaver_checkbox->SetToolTip(_("Dims the screen after five minutes of inactivity."));
|
2016-06-24 08:43:46 +00:00
|
|
|
m_system_language_choice->SetToolTip(_("Sets the Wii system language."));
|
2017-11-19 21:11:33 +00:00
|
|
|
m_sd_card_checkbox->SetToolTip(_("Saved to /Wii/sd.raw (default size is 128mb)."));
|
2016-06-24 08:43:46 +00:00
|
|
|
m_connect_keyboard_checkbox->SetToolTip(_("May cause slow down in Wii Menu and some games."));
|
2017-08-11 19:15:51 +00:00
|
|
|
m_bt_wiimote_motor_checkbox->SetToolTip(_("Enables Wii Remote vibration."));
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2016-08-02 06:22:37 +00:00
|
|
|
const int space5 = FromDIP(5);
|
|
|
|
|
|
|
|
wxGridBagSizer* const misc_settings_grid_sizer = new wxGridBagSizer(space5, space5);
|
2017-04-11 08:19:19 +00:00
|
|
|
misc_settings_grid_sizer->Add(m_pal60_mode_checkbox, wxGBPosition(0, 0), wxGBSpan(1, 2));
|
|
|
|
misc_settings_grid_sizer->Add(m_screensaver_checkbox, wxGBPosition(0, 2), wxGBSpan(1, 2));
|
|
|
|
misc_settings_grid_sizer->Add(m_sd_card_checkbox, wxGBPosition(1, 0), wxGBSpan(1, 2));
|
|
|
|
misc_settings_grid_sizer->Add(m_connect_keyboard_checkbox, wxGBPosition(1, 2), wxGBSpan(1, 2));
|
2016-06-24 08:43:46 +00:00
|
|
|
misc_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Aspect Ratio:")),
|
2016-08-02 06:22:37 +00:00
|
|
|
wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
|
|
|
|
misc_settings_grid_sizer->Add(m_aspect_ratio_choice, wxGBPosition(2, 1), wxDefaultSpan,
|
|
|
|
wxALIGN_CENTER_VERTICAL);
|
2016-06-24 08:43:46 +00:00
|
|
|
misc_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("System Language:")),
|
2017-04-11 08:19:19 +00:00
|
|
|
wxGBPosition(2, 2), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
|
|
|
|
misc_settings_grid_sizer->Add(m_system_language_choice, wxGBPosition(2, 3), wxDefaultSpan,
|
2016-08-02 06:22:37 +00:00
|
|
|
wxALIGN_CENTER_VERTICAL);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2016-10-31 20:51:35 +00:00
|
|
|
auto* const usb_passthrough_btn_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
usb_passthrough_btn_sizer->AddStretchSpacer();
|
|
|
|
usb_passthrough_btn_sizer->Add(m_usb_passthrough_add_device_btn, 0,
|
|
|
|
wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, space5);
|
|
|
|
usb_passthrough_btn_sizer->Add(m_usb_passthrough_rem_device_btn, 0, wxALIGN_CENTER_VERTICAL);
|
|
|
|
|
2016-09-12 18:25:36 +00:00
|
|
|
auto* const bt_sensor_bar_pos_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
bt_sensor_bar_pos_sizer->Add(new wxStaticText(this, wxID_ANY, _("Min")), 0,
|
|
|
|
wxALIGN_CENTER_VERTICAL);
|
2016-08-02 06:22:37 +00:00
|
|
|
bt_sensor_bar_pos_sizer->Add(m_bt_sensor_bar_sens, 0, wxALIGN_CENTER_VERTICAL);
|
2016-09-12 18:25:36 +00:00
|
|
|
bt_sensor_bar_pos_sizer->Add(new wxStaticText(this, wxID_ANY, _("Max")), 0,
|
|
|
|
wxALIGN_CENTER_VERTICAL);
|
|
|
|
|
|
|
|
auto* const bt_speaker_volume_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
bt_speaker_volume_sizer->Add(new wxStaticText(this, wxID_ANY, _("Min")), 0,
|
|
|
|
wxALIGN_CENTER_VERTICAL);
|
2016-08-02 06:22:37 +00:00
|
|
|
bt_speaker_volume_sizer->Add(m_bt_speaker_volume, 0, wxALIGN_CENTER_VERTICAL);
|
2016-09-12 18:25:36 +00:00
|
|
|
bt_speaker_volume_sizer->Add(new wxStaticText(this, wxID_ANY, _("Max")), 0,
|
|
|
|
wxALIGN_CENTER_VERTICAL);
|
|
|
|
|
2016-08-02 06:22:37 +00:00
|
|
|
wxGridBagSizer* const bt_settings_grid_sizer = new wxGridBagSizer(space5, space5);
|
2016-09-12 18:25:36 +00:00
|
|
|
bt_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Sensor Bar Position:")),
|
2016-08-02 06:22:37 +00:00
|
|
|
wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
|
|
|
|
bt_settings_grid_sizer->Add(m_bt_sensor_bar_pos, wxGBPosition(0, 1), wxDefaultSpan,
|
|
|
|
wxALIGN_CENTER_VERTICAL);
|
2017-04-08 11:27:17 +00:00
|
|
|
// i18n: IR stands for infrared and refers to the pointer functionality of Wii Remotes
|
2016-09-12 18:25:36 +00:00
|
|
|
bt_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("IR Sensitivity:")),
|
2016-08-02 06:22:37 +00:00
|
|
|
wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
|
|
|
|
bt_settings_grid_sizer->Add(bt_sensor_bar_pos_sizer, wxGBPosition(1, 1), wxDefaultSpan,
|
|
|
|
wxALIGN_CENTER_VERTICAL);
|
2016-09-12 18:25:36 +00:00
|
|
|
bt_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Speaker Volume:")),
|
2016-08-02 06:22:37 +00:00
|
|
|
wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
|
|
|
|
bt_settings_grid_sizer->Add(bt_speaker_volume_sizer, wxGBPosition(2, 1), wxDefaultSpan,
|
|
|
|
wxALIGN_CENTER_VERTICAL);
|
2017-08-11 19:15:51 +00:00
|
|
|
bt_settings_grid_sizer->Add(m_bt_wiimote_motor_checkbox, wxGBPosition(3, 0), wxGBSpan(1, 2),
|
2016-08-02 06:22:37 +00:00
|
|
|
wxALIGN_CENTER_VERTICAL);
|
2016-09-12 18:25:36 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
wxStaticBoxSizer* const misc_settings_static_sizer =
|
|
|
|
new wxStaticBoxSizer(wxVERTICAL, this, _("Misc Settings"));
|
2016-08-02 06:22:37 +00:00
|
|
|
misc_settings_static_sizer->AddSpacer(space5);
|
|
|
|
misc_settings_static_sizer->Add(misc_settings_grid_sizer, 0, wxLEFT | wxRIGHT, space5);
|
|
|
|
misc_settings_static_sizer->AddSpacer(space5);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2016-10-31 20:51:35 +00:00
|
|
|
auto* const usb_passthrough_sizer =
|
|
|
|
new wxStaticBoxSizer(wxVERTICAL, this, _("Whitelisted USB Passthrough Devices"));
|
|
|
|
usb_passthrough_sizer->AddSpacer(space5);
|
|
|
|
usb_passthrough_sizer->Add(m_usb_passthrough_devices_listbox, 0, wxEXPAND | wxLEFT | wxRIGHT,
|
|
|
|
space5);
|
|
|
|
usb_passthrough_sizer->AddSpacer(space5);
|
|
|
|
usb_passthrough_sizer->Add(usb_passthrough_btn_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
|
|
|
|
usb_passthrough_sizer->AddSpacer(space5);
|
|
|
|
|
2016-09-12 18:25:36 +00:00
|
|
|
auto* const bt_settings_static_sizer =
|
|
|
|
new wxStaticBoxSizer(wxVERTICAL, this, _("Wii Remote Settings"));
|
2016-08-02 06:22:37 +00:00
|
|
|
bt_settings_static_sizer->AddSpacer(space5);
|
|
|
|
bt_settings_static_sizer->Add(bt_settings_grid_sizer, 0, wxLEFT | wxRIGHT, space5);
|
|
|
|
bt_settings_static_sizer->AddSpacer(space5);
|
2016-09-12 18:25:36 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
|
2016-08-02 06:22:37 +00:00
|
|
|
main_sizer->AddSpacer(space5);
|
|
|
|
main_sizer->Add(misc_settings_static_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
|
|
|
|
main_sizer->AddSpacer(space5);
|
2016-10-31 20:51:35 +00:00
|
|
|
main_sizer->Add(usb_passthrough_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
|
|
|
|
main_sizer->AddSpacer(space5);
|
2016-08-02 06:22:37 +00:00
|
|
|
main_sizer->Add(bt_settings_static_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
|
|
|
|
main_sizer->AddSpacer(space5);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
SetSizer(main_sizer);
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::LoadGUIValues()
|
|
|
|
{
|
2017-08-01 14:37:42 +00:00
|
|
|
m_screensaver_checkbox->SetValue(Config::Get(Config::SYSCONF_SCREENSAVER));
|
|
|
|
m_pal60_mode_checkbox->SetValue(Config::Get(Config::SYSCONF_PAL60));
|
|
|
|
m_aspect_ratio_choice->SetSelection(Config::Get(Config::SYSCONF_WIDESCREEN));
|
|
|
|
m_system_language_choice->SetSelection(Config::Get(Config::SYSCONF_LANGUAGE));
|
2015-03-18 22:00:27 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
m_sd_card_checkbox->SetValue(SConfig::GetInstance().m_WiiSDCard);
|
|
|
|
m_connect_keyboard_checkbox->SetValue(SConfig::GetInstance().m_WiiKeyboard);
|
2016-09-12 18:25:36 +00:00
|
|
|
|
2016-10-31 20:51:35 +00:00
|
|
|
PopulateUSBPassthroughListbox();
|
|
|
|
|
2017-04-11 09:12:44 +00:00
|
|
|
m_bt_sensor_bar_pos->SetSelection(
|
2017-08-01 14:37:42 +00:00
|
|
|
TranslateSensorBarPosition(Config::Get(Config::SYSCONF_SENSOR_BAR_POSITION)));
|
|
|
|
m_bt_sensor_bar_sens->SetValue(Config::Get(Config::SYSCONF_SENSOR_BAR_SENSITIVITY));
|
|
|
|
m_bt_speaker_volume->SetValue(Config::Get(Config::SYSCONF_SPEAKER_VOLUME));
|
2017-08-11 19:15:51 +00:00
|
|
|
m_bt_wiimote_motor_checkbox->SetValue(Config::Get(Config::SYSCONF_WIIMOTE_MOTOR));
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
2016-10-31 20:51:35 +00:00
|
|
|
void WiiConfigPane::PopulateUSBPassthroughListbox()
|
|
|
|
{
|
|
|
|
m_usb_passthrough_devices_listbox->Freeze();
|
|
|
|
m_usb_passthrough_devices_listbox->Clear();
|
|
|
|
for (const auto& device : SConfig::GetInstance().m_usb_passthrough_devices)
|
|
|
|
{
|
|
|
|
m_usb_passthrough_devices_listbox->Append(USBUtils::GetDeviceName(device),
|
|
|
|
new USBPassthroughDeviceEntry(device));
|
|
|
|
}
|
|
|
|
m_usb_passthrough_devices_listbox->Thaw();
|
|
|
|
}
|
|
|
|
|
2016-11-05 12:29:29 +00:00
|
|
|
void WiiConfigPane::BindEvents()
|
2015-03-18 22:00:27 +00:00
|
|
|
{
|
2016-11-05 12:29:29 +00:00
|
|
|
m_screensaver_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnScreenSaverCheckBoxChanged, this);
|
|
|
|
m_screensaver_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
|
|
|
|
|
|
|
m_pal60_mode_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnPAL60CheckBoxChanged, this);
|
|
|
|
m_pal60_mode_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
|
|
|
|
|
|
|
m_aspect_ratio_choice->Bind(wxEVT_CHOICE, &WiiConfigPane::OnAspectRatioChoiceChanged, this);
|
|
|
|
m_aspect_ratio_choice->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
|
|
|
|
|
|
|
m_system_language_choice->Bind(wxEVT_CHOICE, &WiiConfigPane::OnSystemLanguageChoiceChanged, this);
|
|
|
|
m_system_language_choice->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
|
|
|
|
|
|
|
m_sd_card_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnSDCardCheckBoxChanged, this);
|
|
|
|
m_connect_keyboard_checkbox->Bind(wxEVT_CHECKBOX,
|
|
|
|
&WiiConfigPane::OnConnectKeyboardCheckBoxChanged, this);
|
|
|
|
|
|
|
|
m_bt_sensor_bar_pos->Bind(wxEVT_CHOICE, &WiiConfigPane::OnSensorBarPosChanged, this);
|
|
|
|
m_bt_sensor_bar_pos->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
|
|
|
|
|
|
|
m_bt_sensor_bar_sens->Bind(wxEVT_SLIDER, &WiiConfigPane::OnSensorBarSensChanged, this);
|
|
|
|
m_bt_sensor_bar_sens->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
|
|
|
|
|
|
|
m_bt_speaker_volume->Bind(wxEVT_SLIDER, &WiiConfigPane::OnSpeakerVolumeChanged, this);
|
|
|
|
m_bt_speaker_volume->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
|
|
|
|
2017-08-11 19:15:51 +00:00
|
|
|
m_bt_wiimote_motor_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnWiimoteMotorChanged, this);
|
|
|
|
m_bt_wiimote_motor_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
2016-10-31 20:51:35 +00:00
|
|
|
|
|
|
|
m_usb_passthrough_add_device_btn->Bind(wxEVT_BUTTON, &WiiConfigPane::OnUSBWhitelistAddButton,
|
|
|
|
this);
|
|
|
|
|
|
|
|
m_usb_passthrough_rem_device_btn->Bind(wxEVT_BUTTON, &WiiConfigPane::OnUSBWhitelistRemoveButton,
|
|
|
|
this);
|
|
|
|
m_usb_passthrough_rem_device_btn->Bind(wxEVT_UPDATE_UI,
|
|
|
|
&WiiConfigPane::OnUSBWhitelistRemoveButtonUpdate, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnUSBWhitelistAddButton(wxCommandEvent&)
|
|
|
|
{
|
|
|
|
AddUSBDeviceDiag add_dialog{this};
|
|
|
|
// Reload the USB device whitelist
|
|
|
|
if (add_dialog.ShowModal() == wxID_OK)
|
|
|
|
PopulateUSBPassthroughListbox();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnUSBWhitelistRemoveButton(wxCommandEvent&)
|
|
|
|
{
|
|
|
|
const int index = m_usb_passthrough_devices_listbox->GetSelection();
|
|
|
|
if (index == wxNOT_FOUND)
|
|
|
|
return;
|
|
|
|
auto* const entry = static_cast<const USBPassthroughDeviceEntry*>(
|
|
|
|
m_usb_passthrough_devices_listbox->GetClientObject(index));
|
|
|
|
SConfig::GetInstance().m_usb_passthrough_devices.erase({entry->m_vid, entry->m_pid});
|
|
|
|
m_usb_passthrough_devices_listbox->Delete(index);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnUSBWhitelistRemoveButtonUpdate(wxUpdateUIEvent& event)
|
|
|
|
{
|
|
|
|
event.Enable(m_usb_passthrough_devices_listbox->GetSelection() != wxNOT_FOUND);
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnScreenSaverCheckBoxChanged(wxCommandEvent& event)
|
|
|
|
{
|
2017-08-01 14:37:42 +00:00
|
|
|
Config::SetBase(Config::SYSCONF_SCREENSAVER, m_screensaver_checkbox->IsChecked());
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnPAL60CheckBoxChanged(wxCommandEvent& event)
|
|
|
|
{
|
2017-08-01 14:37:42 +00:00
|
|
|
Config::SetBase(Config::SYSCONF_PAL60, m_pal60_mode_checkbox->IsChecked());
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnSDCardCheckBoxChanged(wxCommandEvent& event)
|
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
SConfig::GetInstance().m_WiiSDCard = m_sd_card_checkbox->IsChecked();
|
2017-04-29 14:11:22 +00:00
|
|
|
const auto ios = IOS::HLE::GetIOS();
|
|
|
|
if (ios)
|
|
|
|
ios->SDIO_EventNotify();
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnConnectKeyboardCheckBoxChanged(wxCommandEvent& event)
|
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
SConfig::GetInstance().m_WiiKeyboard = m_connect_keyboard_checkbox->IsChecked();
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnSystemLanguageChoiceChanged(wxCommandEvent& event)
|
|
|
|
{
|
2017-08-01 14:37:42 +00:00
|
|
|
Config::SetBase(Config::SYSCONF_LANGUAGE,
|
|
|
|
static_cast<u32>(m_system_language_choice->GetSelection()));
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnAspectRatioChoiceChanged(wxCommandEvent& event)
|
|
|
|
{
|
2017-08-01 14:37:42 +00:00
|
|
|
Config::SetBase(Config::SYSCONF_WIDESCREEN, m_aspect_ratio_choice->GetSelection() == 1);
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|
|
|
|
|
2016-09-12 18:25:36 +00:00
|
|
|
void WiiConfigPane::OnSensorBarPosChanged(wxCommandEvent& event)
|
|
|
|
{
|
2017-08-01 14:37:42 +00:00
|
|
|
Config::SetBase(Config::SYSCONF_SENSOR_BAR_POSITION,
|
|
|
|
static_cast<u32>(TranslateSensorBarPosition(event.GetInt())));
|
2016-09-12 18:25:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnSensorBarSensChanged(wxCommandEvent& event)
|
|
|
|
{
|
2017-08-01 14:37:42 +00:00
|
|
|
Config::SetBase(Config::SYSCONF_SENSOR_BAR_SENSITIVITY, static_cast<u32>(event.GetInt()));
|
2016-09-12 18:25:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnSpeakerVolumeChanged(wxCommandEvent& event)
|
|
|
|
{
|
2017-08-01 14:37:42 +00:00
|
|
|
Config::SetBase(Config::SYSCONF_SPEAKER_VOLUME, static_cast<u32>(event.GetInt()));
|
2016-09-12 18:25:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiiConfigPane::OnWiimoteMotorChanged(wxCommandEvent& event)
|
|
|
|
{
|
2017-08-01 14:37:42 +00:00
|
|
|
Config::SetBase(Config::SYSCONF_WIIMOTE_MOTOR, event.IsChecked());
|
2015-03-18 22:00:27 +00:00
|
|
|
}
|