diff options
| author | Lioncash <mathew1800@gmail.com> | 2016-11-05 08:29:29 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2016-11-05 11:14:37 -0400 |
| commit | bfa9cc27361415a78ddb366764be6f929bf78d6a (patch) | |
| tree | 0025fb4ca0b7674b0402916cf9e53ca32bc646d4 /Source/Core/DolphinWX/Config/PathConfigPane.cpp | |
| parent | 0ad4e70fc50381ccd9875fe9d5c80be1f24342a5 (diff) | |
DolphinWX: Enable/disable config UI options based on core state
Diffstat (limited to 'Source/Core/DolphinWX/Config/PathConfigPane.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Config/PathConfigPane.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/Source/Core/DolphinWX/Config/PathConfigPane.cpp b/Source/Core/DolphinWX/Config/PathConfigPane.cpp index a6e33b52f7..acd56b7747 100644 --- a/Source/Core/DolphinWX/Config/PathConfigPane.cpp +++ b/Source/Core/DolphinWX/Config/PathConfigPane.cpp @@ -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) |
