From bb319266fc8e594c2081171a0496fb02cbb44d2e Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sat, 19 Dec 2009 23:02:05 +0000 Subject: [PATCH] Lilypad and PCSX2 ini/config bugfixes. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2362 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/Panels/ConfigurationPanels.h | 2 -- pcsx2/gui/Panels/PluginSelectorPanel.cpp | 13 ++++++++----- plugins/LilyPad/Config.cpp | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pcsx2/gui/Panels/ConfigurationPanels.h b/pcsx2/gui/Panels/ConfigurationPanels.h index 28e5974e59..42483294b6 100644 --- a/pcsx2/gui/Panels/ConfigurationPanels.h +++ b/pcsx2/gui/Panels/ConfigurationPanels.h @@ -427,8 +427,6 @@ namespace Panels class ComboBoxPanel : public wxPanelWithHelpers { protected: - EventListenerBinding m_Listener_CorePluginStatus; - wxComboBox* m_combobox[PluginId_Count]; wxButton* m_configbutton[PluginId_Count]; DirPickerPanel& m_FolderPicker; diff --git a/pcsx2/gui/Panels/PluginSelectorPanel.cpp b/pcsx2/gui/Panels/PluginSelectorPanel.cpp index 684dcbf037..1ad8bd4c75 100644 --- a/pcsx2/gui/Panels/PluginSelectorPanel.cpp +++ b/pcsx2/gui/Panels/PluginSelectorPanel.cpp @@ -184,7 +184,6 @@ static const int ButtonId_Configure = 51; // ===================================================================================================== Panels::PluginSelectorPanel::ComboBoxPanel::ComboBoxPanel( PluginSelectorPanel* parent ) : wxPanelWithHelpers( parent, wxVERTICAL ) - , m_Listener_CorePluginStatus( wxGetApp().Source_CorePluginStatus(), EventListener ( this, OnCorePluginStatusChanged ) ) , m_FolderPicker( *new DirPickerPanel( this, FolderId_Plugins, _("Plugins Search Path:"), _("Select a folder with PCSX2 plugins") ) @@ -237,11 +236,15 @@ void __evt_fastcall Panels::PluginSelectorPanel::OnCorePluginStatusChanged( void if( (evt != PluginsEvt_Loaded) && (evt != PluginsEvt_Unloaded) ) return; // everything else we don't care about PluginSelectorPanel& panel = *(PluginSelectorPanel*)obj; + + if( panel.IsBeingDeleted() ) return; - const PluginInfo* pi = tbl_PluginInfo; do { + const PluginInfo* pi = tbl_PluginInfo; do + { + wxComboBox& box( panel.m_ComponentBoxes->Get(pi->id) ); panel.m_ComponentBoxes->GetConfigButton(pi->id).Enable( - (panel.m_FileList==NULL) ? false : - g_Conf->FullpathMatchTest( pi->id, (*panel.m_FileList)[pi->id] ) + (panel.m_FileList==NULL || panel.m_FileList->Count() == 0) ? false : + g_Conf->FullpathMatchTest( pi->id, panel.m_FileList->at((int)box.GetClientData(box.GetSelection())) ) ); } while( ++pi, pi->shortname != NULL ); @@ -474,7 +477,7 @@ void Panels::PluginSelectorPanel::OnPluginSelected( wxCommandEvent& evt ) const PluginInfo* pi = tbl_PluginInfo; do { - wxComboBox& box = m_ComponentBoxes->Get(pi->id); + wxComboBox& box( m_ComponentBoxes->Get(pi->id) ); if( box.GetId() == evt.GetId() ) { // Button is enabled if: diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index 1fce72a7c4..b094c23d11 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -274,10 +274,10 @@ wchar_t *GetCommandStringW(u8 command, int port, int slot) { static wchar_t iniFile[MAX_PATH*2] = L"inis\\LilyPad.ini"; -void CALLBACK PADsetSettingsDir(wchar_t *dir) +void CALLBACK PADsetSettingsDir( const char *dir ) { // emulator assures a trailing slash/backslash (yay!) - wcscpy(iniFile, (dir==NULL) ? L"inis\\" : dir); + swprintf_s( iniFile, L"%S", (dir==NULL) ? "inis\\" : dir ); wcscat(iniFile, L"LilyPad.ini"); createIniDir = false;