summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Config/PathConfigPane.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2016-07-29 17:42:39 +0200
committerGitHub <noreply@github.com>2016-07-29 17:42:39 +0200
commitfc85d8036f1bab0963b3a64278f8e4ea157b6dcf (patch)
tree47cc91801fd1095827bd1b638c83c2a8390248c9 /Source/Core/DolphinWX/Config/PathConfigPane.cpp
parent49d17c40a96c7840b33f5aed142951e5df296a5c (diff)
parent0aa6e20685b368e7272049c55a2fd6eedcbb0f14 (diff)
Merge pull request #4061 from Aestek/sd-path
Allow to change Wii sd card path in config pane
Diffstat (limited to 'Source/Core/DolphinWX/Config/PathConfigPane.cpp')
-rw-r--r--Source/Core/DolphinWX/Config/PathConfigPane.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Config/PathConfigPane.cpp b/Source/Core/DolphinWX/Config/PathConfigPane.cpp
index 48eaaada0d..896073bb9a 100644
--- a/Source/Core/DolphinWX/Config/PathConfigPane.cpp
+++ b/Source/Core/DolphinWX/Config/PathConfigPane.cpp
@@ -58,6 +58,9 @@ void PathConfigPane::InitializeGUI()
m_dump_path_dirpicker =
new wxDirPickerCtrl(this, wxID_ANY, wxEmptyString, _("Choose a dump directory:"),
wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL | wxDIRP_SMALL);
+ m_wii_sdcard_filepicker = new wxFilePickerCtrl(
+ 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,
@@ -71,6 +74,8 @@ void PathConfigPane::InitializeGUI()
&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);
wxBoxSizer* const iso_button_sizer = new wxBoxSizer(wxHORIZONTAL);
iso_button_sizer->Add(m_recursive_iso_paths_checkbox, 0, wxALL | wxALIGN_CENTER);
@@ -101,6 +106,10 @@ void PathConfigPane::InitializeGUI()
picker_sizer->Add(new wxStaticText(this, wxID_ANY, _("Dump Path:")), wxGBPosition(4, 0),
wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL, 5);
picker_sizer->Add(m_dump_path_dirpicker, wxGBPosition(4, 1), wxDefaultSpan, wxEXPAND | wxALL, 5);
+ picker_sizer->Add(new wxStaticText(this, wxID_ANY, _("SD Card Path:")), wxGBPosition(5, 0),
+ wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL, 5);
+ picker_sizer->Add(m_wii_sdcard_filepicker, wxGBPosition(5, 1), wxDefaultSpan, wxEXPAND | wxALL,
+ 5);
picker_sizer->AddGrowableCol(1);
// Populate the Paths page
@@ -121,6 +130,7 @@ void PathConfigPane::LoadGUIValues()
m_apploader_path_filepicker->SetPath(StrToWxStr(startup_params.m_strApploader));
m_nand_root_dirpicker->SetPath(StrToWxStr(SConfig::GetInstance().m_NANDPath));
m_dump_path_dirpicker->SetPath(StrToWxStr(SConfig::GetInstance().m_DumpPath));
+ m_wii_sdcard_filepicker->SetPath(StrToWxStr(SConfig::GetInstance().m_strWiiSDCardPath));
// Update selected ISO paths
for (const std::string& folder : SConfig::GetInstance().m_ISOFolder)
@@ -194,6 +204,13 @@ void PathConfigPane::OnApploaderPathChanged(wxCommandEvent& event)
SConfig::GetInstance().m_strApploader = WxStrToStr(m_apploader_path_filepicker->GetPath());
}
+void PathConfigPane::OnSdCardPathChanged(wxCommandEvent& event)
+{
+ std::string sd_card_path = WxStrToStr(m_wii_sdcard_filepicker->GetPath());
+ SConfig::GetInstance().m_strWiiSDCardPath = sd_card_path;
+ File::SetUserPath(F_WIISDCARD_IDX, sd_card_path);
+}
+
void PathConfigPane::OnNANDRootChanged(wxCommandEvent& event)
{
std::string nand_path = SConfig::GetInstance().m_NANDPath =