From: <sag...@us...> - 2011-09-18 21:12:58
|
Revision: 1042 http://modplug.svn.sourceforge.net/modplug/?rev=1042&view=rev Author: saga-games Date: 2011-09-18 21:12:51 +0000 (Sun, 18 Sep 2011) Log Message: ----------- [Imp] Plugin Manager: Plugin list doesn't collapse every time a plugin is removed (http://bugs.openmpt.org/view.php?id=186). [Mod] Plugin Manager: Keyboard handler is bypassed while the Plugin Manager is open. Modified Paths: -------------- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp trunk/OpenMPT/mptrack/SelectPluginDialog.h trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2011-09-18 20:27:04 UTC (rev 1041) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2011-09-18 21:12:51 UTC (rev 1042) @@ -55,9 +55,18 @@ m_pPlugin = &pSndFile->m_MixPlugins[m_nPlugSlot]; } } + + CMainFrame::GetMainFrame()->GetInputHandler()->Bypass(true); } +CSelectPluginDlg::~CSelectPluginDlg() +//----------------------------------- +{ + CMainFrame::GetMainFrame()->GetInputHandler()->Bypass(false); +} + + BOOL CSelectPluginDlg::OnInitDialog() //----------------------------------- { @@ -440,7 +449,7 @@ UpdatePluginsList(plugLib ? plugLib->dwPluginId2 : 0); } else { - Reporting::Error("At least one selected file was not a valid VST-Plugin."); + Reporting::Error("At least one selected file was not a valid VST Plugin."); } } @@ -448,12 +457,16 @@ void CSelectPluginDlg::OnRemovePlugin() //------------------------------------- { + const HTREEITEM pluginToDelete = m_treePlugins.GetSelectedItem(); + PVSTPLUGINLIB pPlug = (PVSTPLUGINLIB)m_treePlugins.GetItemData(pluginToDelete); CVstPluginManager *pManager = theApp.GetPluginManager(); - PVSTPLUGINLIB pPlug = (PVSTPLUGINLIB)m_treePlugins.GetItemData(m_treePlugins.GetSelectedItem()); + if ((pManager) && (pPlug)) { - pManager->RemovePlugin(pPlug); - UpdatePluginsList(); + if(pManager->RemovePlugin(pPlug)) + { + m_treePlugins.DeleteItem(pluginToDelete); + } } } Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.h =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.h 2011-09-18 20:27:04 UTC (rev 1041) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.h 2011-09-18 21:12:51 UTC (rev 1042) @@ -30,6 +30,7 @@ public: CSelectPluginDlg(CModDoc *pModDoc, int nPlugSlot, CWnd *parent); //rewbs.plugDocAware + ~CSelectPluginDlg(); void DoClose(); void UpdatePluginsList(DWORD forceSelect = 0); bool VerifyPlug(PVSTPLUGINLIB plug); Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-09-18 20:27:04 UTC (rev 1041) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-09-18 21:12:51 UTC (rev 1042) @@ -434,7 +434,7 @@ } -BOOL CVstPluginManager::RemovePlugin(PVSTPLUGINLIB pFactory) +bool CVstPluginManager::RemovePlugin(PVSTPLUGINLIB pFactory) //---------------------------------------------------------- { PVSTPLUGINLIB p = m_pVstHead; @@ -462,11 +462,11 @@ CVstPluginManager::ReportPlugException("Exception while trying to release plugin \"%s\"!\n", pFactory->szLibraryName); } - return TRUE; + return true; } p = p->pNext; } - return FALSE; + return false; } Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2011-09-18 20:27:04 UTC (rev 1041) +++ trunk/OpenMPT/mptrack/Vstplug.h 2011-09-18 21:12:51 UTC (rev 1042) @@ -244,7 +244,7 @@ PVSTPLUGINLIB GetFirstPlugin() const { return m_pVstHead; } BOOL IsValidPlugin(const VSTPLUGINLIB *pLib); PVSTPLUGINLIB AddPlugin(LPCSTR pszDllPath, BOOL bCache=TRUE, const bool checkFileExistence = false, CString* const errStr = 0); - BOOL RemovePlugin(PVSTPLUGINLIB); + bool RemovePlugin(PVSTPLUGINLIB); BOOL CreateMixPlugin(PSNDMIXPLUGIN, CSoundFile*); void OnIdle(); static void ReportPlugException(LPCSTR format,...); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |