DolphinWX: Enable/disable config UI options based on core state
This commit is contained in:
parent
0ad4e70fc5
commit
bfa9cc2736
|
@ -61,6 +61,7 @@ set(GUI_SRCS
|
|||
SoftwareVideoConfigDialog.cpp
|
||||
TASInputDlg.cpp
|
||||
VideoConfigDiag.cpp
|
||||
WxEventUtils.cpp
|
||||
WXInputBase.cpp
|
||||
WxUtils.cpp)
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "DolphinWX/Config/AdvancedConfigPane.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <wx/checkbox.h>
|
||||
|
@ -14,14 +16,14 @@
|
|||
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "DolphinWX/Config/AdvancedConfigPane.h"
|
||||
#include "DolphinWX/DolphinSlider.h"
|
||||
#include "DolphinWX/WxEventUtils.h"
|
||||
|
||||
AdvancedConfigPane::AdvancedConfigPane(wxWindow* parent, wxWindowID id) : wxPanel(parent, id)
|
||||
{
|
||||
InitializeGUI();
|
||||
LoadGUIValues();
|
||||
RefreshGUI();
|
||||
BindEvents();
|
||||
}
|
||||
|
||||
void AdvancedConfigPane::InitializeGUI()
|
||||
|
@ -31,22 +33,10 @@ void AdvancedConfigPane::InitializeGUI()
|
|||
new DolphinSlider(this, wxID_ANY, 100, 0, 150, wxDefaultPosition, FromDIP(wxSize(200, -1)));
|
||||
m_clock_override_text = new wxStaticText(this, wxID_ANY, "");
|
||||
|
||||
m_clock_override_checkbox->Bind(wxEVT_CHECKBOX,
|
||||
&AdvancedConfigPane::OnClockOverrideCheckBoxChanged, this);
|
||||
m_clock_override_slider->Bind(wxEVT_SLIDER, &AdvancedConfigPane::OnClockOverrideSliderChanged,
|
||||
this);
|
||||
|
||||
m_custom_rtc_checkbox = new wxCheckBox(this, wxID_ANY, _("Enable Custom RTC"));
|
||||
m_custom_rtc_date_picker = new wxDatePickerCtrl(this, wxID_ANY);
|
||||
m_custom_rtc_time_picker = new wxTimePickerCtrl(this, wxID_ANY);
|
||||
|
||||
m_custom_rtc_checkbox->Bind(wxEVT_CHECKBOX, &AdvancedConfigPane::OnCustomRTCCheckBoxChanged,
|
||||
this);
|
||||
m_custom_rtc_date_picker->Bind(wxEVT_DATE_CHANGED, &AdvancedConfigPane::OnCustomRTCDateChanged,
|
||||
this);
|
||||
m_custom_rtc_time_picker->Bind(wxEVT_TIME_CHANGED, &AdvancedConfigPane::OnCustomRTCTimeChanged,
|
||||
this);
|
||||
|
||||
wxStaticText* const clock_override_description =
|
||||
new wxStaticText(this, wxID_ANY, _("Higher values can make variable-framerate games "
|
||||
"run at a higher framerate, at the expense of CPU. "
|
||||
|
@ -122,6 +112,33 @@ void AdvancedConfigPane::LoadGUIValues()
|
|||
LoadCustomRTC();
|
||||
}
|
||||
|
||||
void AdvancedConfigPane::BindEvents()
|
||||
{
|
||||
m_clock_override_checkbox->Bind(wxEVT_CHECKBOX,
|
||||
&AdvancedConfigPane::OnClockOverrideCheckBoxChanged, this);
|
||||
m_clock_override_checkbox->Bind(wxEVT_UPDATE_UI, &AdvancedConfigPane::OnUpdateCPUClockControls,
|
||||
this);
|
||||
|
||||
m_clock_override_slider->Bind(wxEVT_SLIDER, &AdvancedConfigPane::OnClockOverrideSliderChanged,
|
||||
this);
|
||||
m_clock_override_slider->Bind(wxEVT_UPDATE_UI, &AdvancedConfigPane::OnUpdateCPUClockControls,
|
||||
this);
|
||||
|
||||
m_custom_rtc_checkbox->Bind(wxEVT_CHECKBOX, &AdvancedConfigPane::OnCustomRTCCheckBoxChanged,
|
||||
this);
|
||||
m_custom_rtc_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_custom_rtc_date_picker->Bind(wxEVT_DATE_CHANGED, &AdvancedConfigPane::OnCustomRTCDateChanged,
|
||||
this);
|
||||
m_custom_rtc_date_picker->Bind(wxEVT_UPDATE_UI, &AdvancedConfigPane::OnUpdateRTCDateTimeEntries,
|
||||
this);
|
||||
|
||||
m_custom_rtc_time_picker->Bind(wxEVT_TIME_CHANGED, &AdvancedConfigPane::OnCustomRTCTimeChanged,
|
||||
this);
|
||||
m_custom_rtc_time_picker->Bind(wxEVT_UPDATE_UI, &AdvancedConfigPane::OnUpdateRTCDateTimeEntries,
|
||||
this);
|
||||
}
|
||||
|
||||
void AdvancedConfigPane::OnClockOverrideCheckBoxChanged(wxCommandEvent& event)
|
||||
{
|
||||
SConfig::GetInstance().m_OCEnable = m_clock_override_checkbox->IsChecked();
|
||||
|
@ -188,17 +205,6 @@ void AdvancedConfigPane::LoadCustomRTC()
|
|||
// Limit dates to a valid range (Jan 1/2000 to Dec 31/2099)
|
||||
m_custom_rtc_date_picker->SetRange(wxDateTime(1, wxDateTime::Jan, 2000),
|
||||
wxDateTime(31, wxDateTime::Dec, 2099));
|
||||
if (Core::IsRunning())
|
||||
{
|
||||
m_custom_rtc_checkbox->Enable(false);
|
||||
m_custom_rtc_date_picker->Enable(false);
|
||||
m_custom_rtc_time_picker->Enable(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_custom_rtc_date_picker->Enable(custom_rtc_enabled);
|
||||
m_custom_rtc_time_picker->Enable(custom_rtc_enabled);
|
||||
}
|
||||
}
|
||||
|
||||
void AdvancedConfigPane::UpdateCustomRTC(time_t date, time_t time)
|
||||
|
@ -209,19 +215,18 @@ void AdvancedConfigPane::UpdateCustomRTC(time_t date, time_t time)
|
|||
m_custom_rtc_time_picker->SetValue(custom_rtc);
|
||||
}
|
||||
|
||||
void AdvancedConfigPane::RefreshGUI()
|
||||
void AdvancedConfigPane::OnUpdateCPUClockControls(wxUpdateUIEvent& event)
|
||||
{
|
||||
// Don't allow users to edit the RTC while the game is running
|
||||
if (Core::IsRunning())
|
||||
if (!Core::IsRunning())
|
||||
{
|
||||
m_custom_rtc_checkbox->Disable();
|
||||
m_custom_rtc_date_picker->Disable();
|
||||
m_custom_rtc_time_picker->Disable();
|
||||
}
|
||||
// Allow users to edit CPU clock speed in game, but not while needing determinism
|
||||
if (Core::IsRunning() && Core::g_want_determinism)
|
||||
{
|
||||
m_clock_override_checkbox->Disable();
|
||||
m_clock_override_slider->Disable();
|
||||
event.Enable(true);
|
||||
return;
|
||||
}
|
||||
|
||||
event.Enable(!Core::g_want_determinism);
|
||||
}
|
||||
|
||||
void AdvancedConfigPane::OnUpdateRTCDateTimeEntries(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.Enable(!Core::IsRunning() && m_custom_rtc_checkbox->IsChecked());
|
||||
}
|
||||
|
|
|
@ -23,7 +23,10 @@ public:
|
|||
private:
|
||||
void InitializeGUI();
|
||||
void LoadGUIValues();
|
||||
void RefreshGUI();
|
||||
void BindEvents();
|
||||
|
||||
void OnUpdateCPUClockControls(wxUpdateUIEvent&);
|
||||
void OnUpdateRTCDateTimeEntries(wxUpdateUIEvent&);
|
||||
|
||||
void OnClockOverrideCheckBoxChanged(wxCommandEvent&);
|
||||
void OnClockOverrideSliderChanged(wxCommandEvent&);
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "DolphinWX/Config/AudioConfigPane.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <wx/checkbox.h>
|
||||
|
@ -16,15 +18,15 @@
|
|||
#include "Common/Common.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "DolphinWX/Config/AudioConfigPane.h"
|
||||
#include "DolphinWX/DolphinSlider.h"
|
||||
#include "DolphinWX/WxEventUtils.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
|
||||
AudioConfigPane::AudioConfigPane(wxWindow* parent, wxWindowID id) : wxPanel(parent, id)
|
||||
{
|
||||
InitializeGUI();
|
||||
LoadGUIValues();
|
||||
RefreshGUI();
|
||||
BindEvents();
|
||||
}
|
||||
|
||||
void AudioConfigPane::InitializeGUI()
|
||||
|
@ -46,13 +48,6 @@ void AudioConfigPane::InitializeGUI()
|
|||
new wxSpinCtrl(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 30);
|
||||
m_audio_latency_label = new wxStaticText(this, wxID_ANY, _("Latency:"));
|
||||
|
||||
m_dsp_engine_radiobox->Bind(wxEVT_RADIOBOX, &AudioConfigPane::OnDSPEngineRadioBoxChanged, this);
|
||||
m_dpl2_decoder_checkbox->Bind(wxEVT_CHECKBOX, &AudioConfigPane::OnDPL2DecoderCheckBoxChanged,
|
||||
this);
|
||||
m_volume_slider->Bind(wxEVT_SLIDER, &AudioConfigPane::OnVolumeSliderChanged, this);
|
||||
m_audio_backend_choice->Bind(wxEVT_CHOICE, &AudioConfigPane::OnAudioBackendChanged, this);
|
||||
m_audio_latency_spinctrl->Bind(wxEVT_SPINCTRL, &AudioConfigPane::OnLatencySpinCtrlChanged, this);
|
||||
|
||||
m_audio_backend_choice->SetToolTip(
|
||||
_("Changing this will have no effect while the emulator is running."));
|
||||
m_audio_latency_spinctrl->SetToolTip(_("Sets the latency (in ms). Higher values may reduce audio "
|
||||
|
@ -139,15 +134,22 @@ void AudioConfigPane::ToggleBackendSpecificControls(const std::string& backend)
|
|||
m_volume_text->Enable(supports_volume_changes);
|
||||
}
|
||||
|
||||
void AudioConfigPane::RefreshGUI()
|
||||
void AudioConfigPane::BindEvents()
|
||||
{
|
||||
if (Core::IsRunning())
|
||||
{
|
||||
m_audio_latency_spinctrl->Disable();
|
||||
m_audio_backend_choice->Disable();
|
||||
m_dpl2_decoder_checkbox->Disable();
|
||||
m_dsp_engine_radiobox->Disable();
|
||||
}
|
||||
m_dsp_engine_radiobox->Bind(wxEVT_RADIOBOX, &AudioConfigPane::OnDSPEngineRadioBoxChanged, this);
|
||||
m_dsp_engine_radiobox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_dpl2_decoder_checkbox->Bind(wxEVT_CHECKBOX, &AudioConfigPane::OnDPL2DecoderCheckBoxChanged,
|
||||
this);
|
||||
m_dpl2_decoder_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_volume_slider->Bind(wxEVT_SLIDER, &AudioConfigPane::OnVolumeSliderChanged, this);
|
||||
|
||||
m_audio_backend_choice->Bind(wxEVT_CHOICE, &AudioConfigPane::OnAudioBackendChanged, this);
|
||||
m_audio_backend_choice->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_audio_latency_spinctrl->Bind(wxEVT_SPINCTRL, &AudioConfigPane::OnLatencySpinCtrlChanged, this);
|
||||
m_audio_latency_spinctrl->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
}
|
||||
|
||||
void AudioConfigPane::OnDSPEngineRadioBoxChanged(wxCommandEvent& event)
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
private:
|
||||
void InitializeGUI();
|
||||
void LoadGUIValues();
|
||||
void RefreshGUI();
|
||||
void BindEvents();
|
||||
|
||||
void PopulateBackendChoiceBox();
|
||||
void ToggleBackendSpecificControls(const std::string& backend);
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "DolphinWX/Config/GameCubeConfigPane.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <wx/button.h>
|
||||
|
@ -22,7 +24,7 @@
|
|||
#include "Core/HW/GCMemcard.h"
|
||||
#include "Core/NetPlayProto.h"
|
||||
#include "DolphinWX/Config/ConfigMain.h"
|
||||
#include "DolphinWX/Config/GameCubeConfigPane.h"
|
||||
#include "DolphinWX/WxEventUtils.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
|
||||
#define DEV_NONE_STR _trans("<Nothing>")
|
||||
|
@ -39,7 +41,7 @@ GameCubeConfigPane::GameCubeConfigPane(wxWindow* parent, wxWindowID id) : wxPane
|
|||
{
|
||||
InitializeGUI();
|
||||
LoadGUIValues();
|
||||
RefreshGUI();
|
||||
BindEvents();
|
||||
}
|
||||
|
||||
void GameCubeConfigPane::InitializeGUI()
|
||||
|
@ -54,17 +56,13 @@ void GameCubeConfigPane::InitializeGUI()
|
|||
m_system_lang_choice =
|
||||
new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ipl_language_strings);
|
||||
m_system_lang_choice->SetToolTip(_("Sets the GameCube system language."));
|
||||
m_system_lang_choice->Bind(wxEVT_CHOICE, &GameCubeConfigPane::OnSystemLanguageChange, this);
|
||||
|
||||
m_override_lang_checkbox = new wxCheckBox(this, wxID_ANY, _("Override Language on NTSC Games"));
|
||||
m_override_lang_checkbox->SetToolTip(_(
|
||||
"Lets the system language be set to values that games were not designed for. This can allow "
|
||||
"the use of extra translations for a few games, but can also lead to text display issues."));
|
||||
m_override_lang_checkbox->Bind(wxEVT_CHECKBOX,
|
||||
&GameCubeConfigPane::OnOverrideLanguageCheckBoxChanged, this);
|
||||
|
||||
m_skip_bios_checkbox = new wxCheckBox(this, wxID_ANY, _("Skip BIOS"));
|
||||
m_skip_bios_checkbox->Bind(wxEVT_CHECKBOX, &GameCubeConfigPane::OnSkipBiosCheckBoxChanged, this);
|
||||
|
||||
if (!File::Exists(File::GetUserPath(D_GCUSER_IDX) + DIR_SEP + USA_DIR + DIR_SEP GC_IPL) &&
|
||||
!File::Exists(File::GetSysDirectory() + GC_SYS_DIR + DIR_SEP + USA_DIR + DIR_SEP GC_IPL) &&
|
||||
|
@ -85,20 +83,15 @@ void GameCubeConfigPane::InitializeGUI()
|
|||
};
|
||||
|
||||
m_exi_devices[0] = new wxChoice(this, wxID_ANY);
|
||||
m_exi_devices[0]->Bind(wxEVT_CHOICE, &GameCubeConfigPane::OnSlotAChanged, this);
|
||||
m_exi_devices[1] = new wxChoice(this, wxID_ANY);
|
||||
m_exi_devices[1]->Bind(wxEVT_CHOICE, &GameCubeConfigPane::OnSlotBChanged, this);
|
||||
m_exi_devices[2] = new wxChoice(this, wxID_ANY);
|
||||
m_exi_devices[2]->Bind(wxEVT_CHOICE, &GameCubeConfigPane::OnSP1Changed, this);
|
||||
m_exi_devices[2]->SetToolTip(
|
||||
_("Serial Port 1 - This is the port which devices such as the net adapter use."));
|
||||
|
||||
m_memcard_path[0] =
|
||||
new wxButton(this, wxID_ANY, "...", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
|
||||
m_memcard_path[0]->Bind(wxEVT_BUTTON, &GameCubeConfigPane::OnSlotAButtonClick, this);
|
||||
m_memcard_path[1] =
|
||||
new wxButton(this, wxID_ANY, "...", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
|
||||
m_memcard_path[1]->Bind(wxEVT_BUTTON, &GameCubeConfigPane::OnSlotBButtonClick, this);
|
||||
|
||||
const int space5 = FromDIP(5);
|
||||
const int space10 = FromDIP(10);
|
||||
|
@ -131,9 +124,6 @@ void GameCubeConfigPane::InitializeGUI()
|
|||
if (i < 2)
|
||||
gamecube_EXIDev_sizer->Add(m_memcard_path[i], wxGBPosition(i, 2), wxDefaultSpan,
|
||||
wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
if (NetPlay::IsNetPlayRunning())
|
||||
m_exi_devices[i]->Disable();
|
||||
}
|
||||
sbGamecubeDeviceSettings->AddSpacer(space5);
|
||||
sbGamecubeDeviceSettings->Add(gamecube_EXIDev_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
|
||||
|
@ -218,14 +208,27 @@ void GameCubeConfigPane::LoadGUIValues()
|
|||
}
|
||||
}
|
||||
|
||||
void GameCubeConfigPane::RefreshGUI()
|
||||
void GameCubeConfigPane::BindEvents()
|
||||
{
|
||||
if (Core::IsRunning())
|
||||
{
|
||||
m_system_lang_choice->Disable();
|
||||
m_override_lang_checkbox->Disable();
|
||||
m_skip_bios_checkbox->Disable();
|
||||
}
|
||||
m_system_lang_choice->Bind(wxEVT_CHOICE, &GameCubeConfigPane::OnSystemLanguageChange, this);
|
||||
m_system_lang_choice->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_override_lang_checkbox->Bind(wxEVT_CHECKBOX,
|
||||
&GameCubeConfigPane::OnOverrideLanguageCheckBoxChanged, this);
|
||||
m_override_lang_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_skip_bios_checkbox->Bind(wxEVT_CHECKBOX, &GameCubeConfigPane::OnSkipBiosCheckBoxChanged, this);
|
||||
m_skip_bios_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_exi_devices[0]->Bind(wxEVT_CHOICE, &GameCubeConfigPane::OnSlotAChanged, this);
|
||||
m_exi_devices[0]->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfNetplayNotRunning);
|
||||
m_exi_devices[1]->Bind(wxEVT_CHOICE, &GameCubeConfigPane::OnSlotBChanged, this);
|
||||
m_exi_devices[1]->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfNetplayNotRunning);
|
||||
m_exi_devices[2]->Bind(wxEVT_CHOICE, &GameCubeConfigPane::OnSP1Changed, this);
|
||||
m_exi_devices[2]->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfNetplayNotRunning);
|
||||
|
||||
m_memcard_path[0]->Bind(wxEVT_BUTTON, &GameCubeConfigPane::OnSlotAButtonClick, this);
|
||||
m_memcard_path[1]->Bind(wxEVT_BUTTON, &GameCubeConfigPane::OnSlotBButtonClick, this);
|
||||
}
|
||||
|
||||
void GameCubeConfigPane::OnSystemLanguageChange(wxCommandEvent& event)
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
private:
|
||||
void InitializeGUI();
|
||||
void LoadGUIValues();
|
||||
void RefreshGUI();
|
||||
void BindEvents();
|
||||
|
||||
void OnSystemLanguageChange(wxCommandEvent&);
|
||||
void OnOverrideLanguageCheckBoxChanged(wxCommandEvent&);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "DolphinWX/WxEventUtils.h"
|
||||
|
||||
GeneralConfigPane::GeneralConfigPane(wxWindow* parent, wxWindowID id) : wxPanel(parent, id)
|
||||
{
|
||||
|
@ -34,7 +35,7 @@ GeneralConfigPane::GeneralConfigPane(wxWindow* parent, wxWindowID id) : wxPanel(
|
|||
|
||||
InitializeGUI();
|
||||
LoadGUIValues();
|
||||
RefreshGUI();
|
||||
BindEvents();
|
||||
}
|
||||
|
||||
void GeneralConfigPane::InitializeGUI()
|
||||
|
@ -86,15 +87,6 @@ void GeneralConfigPane::InitializeGUI()
|
|||
"that raising or lowering the emulation speed will also raise "
|
||||
"or lower the audio pitch to prevent audio from stuttering."));
|
||||
|
||||
m_dual_core_checkbox->Bind(wxEVT_CHECKBOX, &GeneralConfigPane::OnDualCoreCheckBoxChanged, this);
|
||||
m_cheats_checkbox->Bind(wxEVT_CHECKBOX, &GeneralConfigPane::OnCheatCheckBoxChanged, this);
|
||||
m_force_ntscj_checkbox->Bind(wxEVT_CHECKBOX, &GeneralConfigPane::OnForceNTSCJCheckBoxChanged,
|
||||
this);
|
||||
m_analytics_checkbox->Bind(wxEVT_CHECKBOX, &GeneralConfigPane::OnAnalyticsCheckBoxChanged, this);
|
||||
m_analytics_new_id->Bind(wxEVT_BUTTON, &GeneralConfigPane::OnAnalyticsNewIdButtonClick, this);
|
||||
m_throttler_choice->Bind(wxEVT_CHOICE, &GeneralConfigPane::OnThrottlerChoiceChanged, this);
|
||||
m_cpu_engine_radiobox->Bind(wxEVT_RADIOBOX, &GeneralConfigPane::OnCPUEngineRadioBoxChanged, this);
|
||||
|
||||
const int space5 = FromDIP(5);
|
||||
|
||||
wxBoxSizer* const throttler_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
@ -161,15 +153,26 @@ void GeneralConfigPane::LoadGUIValues()
|
|||
}
|
||||
}
|
||||
|
||||
void GeneralConfigPane::RefreshGUI()
|
||||
void GeneralConfigPane::BindEvents()
|
||||
{
|
||||
if (Core::IsRunning())
|
||||
{
|
||||
m_dual_core_checkbox->Disable();
|
||||
m_cheats_checkbox->Disable();
|
||||
m_force_ntscj_checkbox->Disable();
|
||||
m_cpu_engine_radiobox->Disable();
|
||||
}
|
||||
m_dual_core_checkbox->Bind(wxEVT_CHECKBOX, &GeneralConfigPane::OnDualCoreCheckBoxChanged, this);
|
||||
m_dual_core_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_cheats_checkbox->Bind(wxEVT_CHECKBOX, &GeneralConfigPane::OnCheatCheckBoxChanged, this);
|
||||
m_cheats_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_force_ntscj_checkbox->Bind(wxEVT_CHECKBOX, &GeneralConfigPane::OnForceNTSCJCheckBoxChanged,
|
||||
this);
|
||||
m_force_ntscj_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_analytics_checkbox->Bind(wxEVT_CHECKBOX, &GeneralConfigPane::OnAnalyticsCheckBoxChanged, this);
|
||||
|
||||
m_analytics_new_id->Bind(wxEVT_BUTTON, &GeneralConfigPane::OnAnalyticsNewIdButtonClick, this);
|
||||
|
||||
m_throttler_choice->Bind(wxEVT_CHOICE, &GeneralConfigPane::OnThrottlerChoiceChanged, this);
|
||||
|
||||
m_cpu_engine_radiobox->Bind(wxEVT_RADIOBOX, &GeneralConfigPane::OnCPUEngineRadioBoxChanged, this);
|
||||
m_cpu_engine_radiobox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
}
|
||||
|
||||
void GeneralConfigPane::OnDualCoreCheckBoxChanged(wxCommandEvent& event)
|
||||
|
|
|
@ -27,7 +27,7 @@ private:
|
|||
std::vector<CPUCore> m_cpu_cores;
|
||||
void InitializeGUI();
|
||||
void LoadGUIValues();
|
||||
void RefreshGUI();
|
||||
void BindEvents();
|
||||
|
||||
void OnDualCoreCheckBoxChanged(wxCommandEvent&);
|
||||
void OnCheatCheckBoxChanged(wxCommandEvent&);
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "DolphinWX/Config/PathConfigPane.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <wx/button.h>
|
||||
|
@ -18,16 +20,16 @@
|
|||
#include "Core/Core.h"
|
||||
#include "DiscIO/NANDContentLoader.h"
|
||||
#include "DolphinWX/Config/ConfigMain.h"
|
||||
#include "DolphinWX/Config/PathConfigPane.h"
|
||||
#include "DolphinWX/Frame.h"
|
||||
#include "DolphinWX/Main.h"
|
||||
#include "DolphinWX/WxEventUtils.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
|
||||
PathConfigPane::PathConfigPane(wxWindow* panel, wxWindowID id) : wxPanel(panel, id)
|
||||
{
|
||||
InitializeGUI();
|
||||
LoadGUIValues();
|
||||
RefreshGUI();
|
||||
BindEvents();
|
||||
}
|
||||
|
||||
void PathConfigPane::InitializeGUI()
|
||||
|
@ -62,21 +64,6 @@ void PathConfigPane::InitializeGUI()
|
|||
this, wxID_ANY, wxEmptyString, _("Choose an SD Card file:"), wxFileSelectorDefaultWildcardStr,
|
||||
wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL | wxDIRP_SMALL);
|
||||
|
||||
m_iso_paths_listbox->Bind(wxEVT_LISTBOX, &PathConfigPane::OnISOPathSelectionChanged, this);
|
||||
m_recursive_iso_paths_checkbox->Bind(wxEVT_CHECKBOX,
|
||||
&PathConfigPane::OnRecursiveISOCheckBoxChanged, this);
|
||||
m_add_iso_path_button->Bind(wxEVT_BUTTON, &PathConfigPane::OnAddISOPath, this);
|
||||
m_remove_iso_path_button->Bind(wxEVT_BUTTON, &PathConfigPane::OnRemoveISOPath, this);
|
||||
m_default_iso_filepicker->Bind(wxEVT_FILEPICKER_CHANGED, &PathConfigPane::OnDefaultISOChanged,
|
||||
this);
|
||||
m_dvd_root_dirpicker->Bind(wxEVT_DIRPICKER_CHANGED, &PathConfigPane::OnDVDRootChanged, this);
|
||||
m_apploader_path_filepicker->Bind(wxEVT_FILEPICKER_CHANGED,
|
||||
&PathConfigPane::OnApploaderPathChanged, this);
|
||||
m_nand_root_dirpicker->Bind(wxEVT_DIRPICKER_CHANGED, &PathConfigPane::OnNANDRootChanged, this);
|
||||
m_dump_path_dirpicker->Bind(wxEVT_DIRPICKER_CHANGED, &PathConfigPane::OnDumpPathChanged, this);
|
||||
m_wii_sdcard_filepicker->Bind(wxEVT_FILEPICKER_CHANGED, &PathConfigPane::OnSdCardPathChanged,
|
||||
this);
|
||||
|
||||
const int space5 = FromDIP(5);
|
||||
|
||||
wxBoxSizer* const iso_button_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
@ -141,10 +128,24 @@ void PathConfigPane::LoadGUIValues()
|
|||
m_iso_paths_listbox->Append(StrToWxStr(folder));
|
||||
}
|
||||
|
||||
void PathConfigPane::RefreshGUI()
|
||||
void PathConfigPane::BindEvents()
|
||||
{
|
||||
if (Core::IsRunning())
|
||||
Disable();
|
||||
m_iso_paths_listbox->Bind(wxEVT_LISTBOX, &PathConfigPane::OnISOPathSelectionChanged, this);
|
||||
m_recursive_iso_paths_checkbox->Bind(wxEVT_CHECKBOX,
|
||||
&PathConfigPane::OnRecursiveISOCheckBoxChanged, this);
|
||||
m_add_iso_path_button->Bind(wxEVT_BUTTON, &PathConfigPane::OnAddISOPath, this);
|
||||
m_remove_iso_path_button->Bind(wxEVT_BUTTON, &PathConfigPane::OnRemoveISOPath, this);
|
||||
m_default_iso_filepicker->Bind(wxEVT_FILEPICKER_CHANGED, &PathConfigPane::OnDefaultISOChanged,
|
||||
this);
|
||||
m_dvd_root_dirpicker->Bind(wxEVT_DIRPICKER_CHANGED, &PathConfigPane::OnDVDRootChanged, this);
|
||||
m_apploader_path_filepicker->Bind(wxEVT_FILEPICKER_CHANGED,
|
||||
&PathConfigPane::OnApploaderPathChanged, this);
|
||||
m_nand_root_dirpicker->Bind(wxEVT_DIRPICKER_CHANGED, &PathConfigPane::OnNANDRootChanged, this);
|
||||
m_dump_path_dirpicker->Bind(wxEVT_DIRPICKER_CHANGED, &PathConfigPane::OnDumpPathChanged, this);
|
||||
m_wii_sdcard_filepicker->Bind(wxEVT_FILEPICKER_CHANGED, &PathConfigPane::OnSdCardPathChanged,
|
||||
this);
|
||||
|
||||
Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
}
|
||||
|
||||
void PathConfigPane::OnISOPathSelectionChanged(wxCommandEvent& event)
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
private:
|
||||
void InitializeGUI();
|
||||
void LoadGUIValues();
|
||||
void RefreshGUI();
|
||||
void BindEvents();
|
||||
|
||||
void OnISOPathSelectionChanged(wxCommandEvent&);
|
||||
void OnRecursiveISOCheckBoxChanged(wxCommandEvent&);
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "DolphinWX/Config/WiiConfigPane.h"
|
||||
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/gbsizer.h>
|
||||
|
@ -12,15 +14,15 @@
|
|||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE.h"
|
||||
#include "DolphinWX/Config/WiiConfigPane.h"
|
||||
#include "DolphinWX/DolphinSlider.h"
|
||||
#include "DolphinWX/WxEventUtils.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
|
||||
WiiConfigPane::WiiConfigPane(wxWindow* parent, wxWindowID id) : wxPanel(parent, id)
|
||||
{
|
||||
InitializeGUI();
|
||||
LoadGUIValues();
|
||||
RefreshGUI();
|
||||
BindEvents();
|
||||
}
|
||||
|
||||
void WiiConfigPane::InitializeGUI()
|
||||
|
@ -56,18 +58,6 @@ void WiiConfigPane::InitializeGUI()
|
|||
m_bt_speaker_volume = new DolphinSlider(this, wxID_ANY, 0, 0, 127);
|
||||
m_bt_wiimote_motor = new wxCheckBox(this, wxID_ANY, _("Wii Remote Motor"));
|
||||
|
||||
m_screensaver_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnScreenSaverCheckBoxChanged, this);
|
||||
m_pal60_mode_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnPAL60CheckBoxChanged, this);
|
||||
m_aspect_ratio_choice->Bind(wxEVT_CHOICE, &WiiConfigPane::OnAspectRatioChoiceChanged, this);
|
||||
m_system_language_choice->Bind(wxEVT_CHOICE, &WiiConfigPane::OnSystemLanguageChoiceChanged, this);
|
||||
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_sens->Bind(wxEVT_SLIDER, &WiiConfigPane::OnSensorBarSensChanged, this);
|
||||
m_bt_speaker_volume->Bind(wxEVT_SLIDER, &WiiConfigPane::OnSpeakerVolumeChanged, this);
|
||||
m_bt_wiimote_motor->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnWiimoteMotorChanged, this);
|
||||
|
||||
m_screensaver_checkbox->SetToolTip(_("Dims the screen after five minutes of inactivity."));
|
||||
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."));
|
||||
|
@ -167,20 +157,35 @@ void WiiConfigPane::LoadGUIValues()
|
|||
m_bt_wiimote_motor->SetValue(SConfig::GetInstance().m_wiimote_motor);
|
||||
}
|
||||
|
||||
void WiiConfigPane::RefreshGUI()
|
||||
void WiiConfigPane::BindEvents()
|
||||
{
|
||||
if (Core::IsRunning())
|
||||
{
|
||||
m_screensaver_checkbox->Disable();
|
||||
m_pal60_mode_checkbox->Disable();
|
||||
m_aspect_ratio_choice->Disable();
|
||||
m_system_language_choice->Disable();
|
||||
m_screensaver_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnScreenSaverCheckBoxChanged, this);
|
||||
m_screensaver_checkbox->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
|
||||
m_bt_sensor_bar_pos->Disable();
|
||||
m_bt_sensor_bar_sens->Disable();
|
||||
m_bt_speaker_volume->Disable();
|
||||
m_bt_wiimote_motor->Disable();
|
||||
}
|
||||
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);
|
||||
|
||||
m_bt_wiimote_motor->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnWiimoteMotorChanged, this);
|
||||
m_bt_wiimote_motor->Bind(wxEVT_UPDATE_UI, &WxEventUtils::OnEnableIfCoreNotRunning);
|
||||
}
|
||||
|
||||
void WiiConfigPane::OnScreenSaverCheckBoxChanged(wxCommandEvent& event)
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
private:
|
||||
void InitializeGUI();
|
||||
void LoadGUIValues();
|
||||
void RefreshGUI();
|
||||
void BindEvents();
|
||||
|
||||
void OnScreenSaverCheckBoxChanged(wxCommandEvent&);
|
||||
void OnPAL60CheckBoxChanged(wxCommandEvent&);
|
||||
|
|
|
@ -120,6 +120,7 @@
|
|||
<ClCompile Include="VideoConfigDiag.cpp" />
|
||||
<ClCompile Include="PostProcessingConfigDiag.cpp" />
|
||||
<ClCompile Include="ControllerConfigDiag.cpp" />
|
||||
<ClCompile Include="WxEventUtils.cpp" />
|
||||
<ClCompile Include="WXInputBase.cpp" />
|
||||
<ClCompile Include="WxUtils.cpp" />
|
||||
</ItemGroup>
|
||||
|
@ -184,6 +185,7 @@
|
|||
<ClInclude Include="VideoConfigDiag.h" />
|
||||
<ClInclude Include="PostProcessingConfigDiag.h" />
|
||||
<ClInclude Include="ControllerConfigDiag.h" />
|
||||
<ClInclude Include="WxEventUtils.h" />
|
||||
<ClInclude Include="WXInputBase.h" />
|
||||
<ClInclude Include="WxUtils.h" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="MainNoGUI.cpp" />
|
||||
<ClCompile Include="WxEventUtils.cpp" />
|
||||
<ClCompile Include="WXInputBase.cpp" />
|
||||
<ClCompile Include="WxUtils.cpp" />
|
||||
<ClCompile Include="Cheats\CheatsWindow.cpp">
|
||||
|
@ -223,6 +224,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Main.h" />
|
||||
<ClInclude Include="WxEventUtils.h" />
|
||||
<ClInclude Include="WXInputBase.h" />
|
||||
<ClInclude Include="WxUtils.h" />
|
||||
<ClInclude Include="Cheats\CheatSearchTab.h">
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2016 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "DolphinWX/WxEventUtils.h"
|
||||
|
||||
#include <wx/event.h>
|
||||
#include "Core/Core.h"
|
||||
#include "Core/NetPlayProto.h"
|
||||
|
||||
namespace WxEventUtils
|
||||
{
|
||||
void OnEnableIfCoreNotRunning(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.Enable(!Core::IsRunning());
|
||||
}
|
||||
|
||||
void OnEnableIfNetplayNotRunning(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.Enable(!NetPlay::IsNetPlayRunning());
|
||||
}
|
||||
} // namespace WxEventUtils
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2016 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
// Intended for containing event functions that are bound to
|
||||
// different window controls through wxEvtHandler's Bind()
|
||||
// function.
|
||||
|
||||
class wxUpdateUIEvent;
|
||||
|
||||
namespace WxEventUtils
|
||||
{
|
||||
void OnEnableIfCoreNotRunning(wxUpdateUIEvent&);
|
||||
void OnEnableIfNetplayNotRunning(wxUpdateUIEvent&);
|
||||
} // namespace WxEventUtils
|
Loading…
Reference in New Issue