summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2010-08-15 23:03:15 +0000
committerJordan Woyak <jordan.woyak@gmail.com>2010-08-15 23:03:15 +0000
commitdac266623609a6b54df36ea36aebe43b324979fe (patch)
tree3d6f853b708f5f16ed5bef2842eb75fd3b68e929 /Source/Core
parent7c7257b8252df13e33d22f91254c40c6b592c285 (diff)
New Wiimote Plugin: Fix hang on close issue of my last commit.(thanks to glennrics) Made profile saving/deleting a bit more user friendly.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6097 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/InputUICommon/Src/ConfigDiag.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/Core/InputUICommon/Src/ConfigDiag.cpp b/Source/Core/InputUICommon/Src/ConfigDiag.cpp
index 251aa23c52..4dd75f6993 100644
--- a/Source/Core/InputUICommon/Src/ConfigDiag.cpp
+++ b/Source/Core/InputUICommon/Src/ConfigDiag.cpp
@@ -585,7 +585,7 @@ void GamepadPage::GetProfilePath(std::string& path)
}
}
-void GamepadPage::LoadProfile( wxCommandEvent& event )
+void GamepadPage::LoadProfile(wxCommandEvent& event)
{
std::string fname;
GamepadPage::GetProfilePath(fname);
@@ -604,7 +604,7 @@ void GamepadPage::LoadProfile( wxCommandEvent& event )
UpdateGUI();
}
-void GamepadPage::SaveProfile( wxCommandEvent& event )
+void GamepadPage::SaveProfile(wxCommandEvent& event)
{
std::string fname;
GamepadPage::GetProfilePath(fname);
@@ -615,22 +615,27 @@ void GamepadPage::SaveProfile( wxCommandEvent& event )
IniFile inifile;
controller->SaveConfig(inifile.GetOrCreateSection("Profile"));
inifile.Save(fname);
+
+ m_config_dialog->UpdateProfileComboBox();
}
-
- m_config_dialog->UpdateProfileComboBox();
+ else
+ PanicAlert("You must enter a valid profile name.");
}
-void GamepadPage::DeleteProfile( wxCommandEvent& event )
+void GamepadPage::DeleteProfile(wxCommandEvent& event)
{
std::string fname;
GamepadPage::GetProfilePath(fname);
const char* const fnamecstr = fname.c_str();
- if (File::Exists(fnamecstr))
+ if (File::Exists(fnamecstr) && AskYesNo("Are you sure you want to delete \"%s\"?",
+ STR_FROM_WXSTR(profile_cbox->GetValue()).c_str()))
+ {
File::Delete(fnamecstr);
- m_config_dialog->UpdateProfileComboBox();
+ m_config_dialog->UpdateProfileComboBox();
+ }
}
void InputConfigDialog::UpdateDeviceComboBox()
@@ -641,7 +646,8 @@ void InputConfigDialog::UpdateDeviceComboBox()
for ( ; i != e; ++i )
{
(*i)->device_cbox->Clear();
- std::vector<ControllerInterface::Device*>::const_iterator di = m_plugin.controller_interface.Devices().begin(),
+ std::vector<ControllerInterface::Device*>::const_iterator
+ di = m_plugin.controller_interface.Devices().begin(),
de = m_plugin.controller_interface.Devices().end();
for ( ; di!=de; ++di )
{