From: Eran I. <no...@so...> - 2014-01-10 12:37:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "codelite". The branch, master has been updated via e97e1d93b209ee4e7b8d21396f07c51f38531994 (commit) via 3817a5d60218c61130e4c31eafa92381a5c21c55 (commit) from 5c7e4747d0d4e8d4b31884d1cc69273fd32e9733 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceforge.net/p/codelite/codelitegit/ci/e97e1d93b209ee4e7b8d21396f07c51f38531994 commit e97e1d93b209ee4e7b8d21396f07c51f38531994 Author: Eran <era...@gm...> Date: Fri Jan 10 14:37:24 2014 +0200 CMakePlugin: make sure that the 'topic' selection control is disabled while help content is being constructed diff --git a/CMakePlugin/CMakeHelpTab.cpp b/CMakePlugin/CMakeHelpTab.cpp index c71ad06..3412d0b 100644 --- a/CMakePlugin/CMakeHelpTab.cpp +++ b/CMakePlugin/CMakeHelpTab.cpp @@ -65,7 +65,7 @@ CMakeHelpTab::CMakeHelpTab(wxWindow* parent, CMakePlugin* plugin) Bind(EVT_THREAD_DONE, &CMakeHelpTab::OnThreadDone, this); // Initial load - //LoadData(); + LoadData(); } /* ************************************************************************ */ diff --git a/CMakePlugin/CMakePlugin.wxcp b/CMakePlugin/CMakePlugin.wxcp index 15e8ca3..bd40109 100644 --- a/CMakePlugin/CMakePlugin.wxcp +++ b/CMakePlugin/CMakePlugin.wxcp @@ -1019,7 +1019,13 @@ "m_label": "Wrap:", "m_value": "-1" }], - "m_events": [], + "m_events": [{ + "m_eventName": "wxEVT_UPDATE_UI", + "m_eventClass": "wxUpdateUIEvent", + "m_eventHandler": "wxUpdateUIEventHandler", + "m_functionNameAndSignature": "OnUpdateUi(wxUpdateUIEvent& event)", + "m_description": "Process a wxEVT_UPDATE_UI event" + }], "m_children": [] }, { "m_type": 4411, @@ -1100,6 +1106,12 @@ "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnChangeTopic(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected." + }, { + "m_eventName": "wxEVT_UPDATE_UI", + "m_eventClass": "wxUpdateUIEvent", + "m_eventHandler": "wxUpdateUIEventHandler", + "m_functionNameAndSignature": "OnUpdateUi(wxUpdateUIEvent& event)", + "m_description": "Process a wxEVT_UPDATE_UI event" }], "m_children": [] }, { diff --git a/CMakePlugin/CMakePluginUi.cpp b/CMakePlugin/CMakePluginUi.cpp index d205f91..d13f9bd 100644 --- a/CMakePlugin/CMakePluginUi.cpp +++ b/CMakePlugin/CMakePluginUi.cpp @@ -180,7 +180,9 @@ CMakeHelpTabBase::CMakeHelpTabBase(wxWindow* parent, wxWindowID id, const wxPoin // Connect events m_staticTextVersion->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); m_staticTextVersionValue->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); + m_staticText222->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); m_choiceTopics->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(CMakeHelpTabBase::OnChangeTopic), NULL, this); + m_choiceTopics->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); m_buttonReload->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CMakeHelpTabBase::OnReload), NULL, this); m_buttonReload->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); m_splitter->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(CMakeHelpTabBase::OnRightClick), NULL, this); @@ -199,7 +201,9 @@ CMakeHelpTabBase::~CMakeHelpTabBase() { m_staticTextVersion->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); m_staticTextVersionValue->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); + m_staticText222->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); m_choiceTopics->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(CMakeHelpTabBase::OnChangeTopic), NULL, this); + m_choiceTopics->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); m_buttonReload->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CMakeHelpTabBase::OnReload), NULL, this); m_buttonReload->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CMakeHelpTabBase::OnUpdateUi), NULL, this); m_splitter->Disconnect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(CMakeHelpTabBase::OnRightClick), NULL, this); diff --git a/CMakePlugin/CMakePluginUi_bitmaps.cpp b/CMakePlugin/CMakePluginUi_bitmaps.cpp index 778c9f6..0302b40 100644 --- a/CMakePlugin/CMakePluginUi_bitmaps.cpp +++ b/CMakePlugin/CMakePluginUi_bitmaps.cpp @@ -1,48 +1,48 @@ -// -// This file was automatically generated by wxrc, do not edit by hand. -// - -#include <wx/wxprec.h> - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include <wx/filesys.h> -#include <wx/fs_mem.h> -#include <wx/xrc/xmlres.h> -#include <wx/xrc/xh_all.h> - -#if wxCHECK_VERSION(2,8,5) && wxABI_VERSION >= 20805 - #define XRC_ADD_FILE(name, data, size, mime) \ - wxMemoryFSHandler::AddFileWithMimeType(name, data, size, mime) -#else - #define XRC_ADD_FILE(name, data, size, mime) \ - wxMemoryFSHandler::AddFile(name, data, size) -#endif - -static size_t xml_res_size_0 = 108; -static unsigned char xml_res_file_0[] = { -60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101, -110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,114,101, -115,111,117,114,99,101,32,120,109,108,110,115,61,34,104,116,116,112,58, -47,47,119,119,119,46,119,120,119,105,110,100,111,119,115,46,111,114,103, -47,119,120,120,114,99,34,32,118,101,114,115,105,111,110,61,34,50,46,51, -46,48,46,49,34,47,62,10}; - -void wxCrafterR3nJ3cInitBitmapResources() -{ - - // Check for memory FS. If not present, load the handler: - { - wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"), wxT("dummy one")); - wxFileSystem fsys; - wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file")); - wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file")); - if (f) delete f; - else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase); - } - - XRC_ADD_FILE(wxT("XRC_resource/CMakePluginUi_bitmaps.cpp$C__Users_Geo_Development_Cpp_codelite-dev_CMakePlugin_CMakePluginUi_bitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml")); - wxXmlResource::Get()->Load(wxT("memory:XRC_resource/CMakePluginUi_bitmaps.cpp$C__Users_Geo_Development_Cpp_codelite-dev_CMakePlugin_CMakePluginUi_bitmaps.xrc")); -} +// +// This file was automatically generated by wxrc, do not edit by hand. +// + +#include <wx/wxprec.h> + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include <wx/filesys.h> +#include <wx/fs_mem.h> +#include <wx/xrc/xmlres.h> +#include <wx/xrc/xh_all.h> + +#if wxCHECK_VERSION(2,8,5) && wxABI_VERSION >= 20805 + #define XRC_ADD_FILE(name, data, size, mime) \ + wxMemoryFSHandler::AddFileWithMimeType(name, data, size, mime) +#else + #define XRC_ADD_FILE(name, data, size, mime) \ + wxMemoryFSHandler::AddFile(name, data, size) +#endif + +static size_t xml_res_size_0 = 108; +static unsigned char xml_res_file_0[] = { +60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101, +110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,114,101, +115,111,117,114,99,101,32,120,109,108,110,115,61,34,104,116,116,112,58, +47,47,119,119,119,46,119,120,119,105,110,100,111,119,115,46,111,114,103, +47,119,120,120,114,99,34,32,118,101,114,115,105,111,110,61,34,50,46,51, +46,48,46,49,34,47,62,10}; + +void wxCrafterR3nJ3cInitBitmapResources() +{ + + // Check for memory FS. If not present, load the handler: + { + wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"), wxT("dummy one")); + wxFileSystem fsys; + wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file")); + wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file")); + if (f) delete f; + else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase); + } + + XRC_ADD_FILE(wxT("XRC_resource/CMakePluginUi_bitmaps.cpp$C__src_codelitegit_CMakePlugin_CMakePluginUi_bitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml")); + wxXmlResource::Get()->Load(wxT("memory:XRC_resource/CMakePluginUi_bitmaps.cpp$C__src_codelitegit_CMakePlugin_CMakePluginUi_bitmaps.xrc")); +} https://sourceforge.net/p/codelite/codelitegit/ci/3817a5d60218c61130e4c31eafa92381a5c21c55 commit 3817a5d60218c61130e4c31eafa92381a5c21c55 Author: Eran <era...@gm...> Date: Fri Jan 10 14:28:28 2014 +0200 CMakePlugin: make sure that the worker thread is joined before exiting codelite while the worker thread is working CMakePlugin: don't attempt to load the help content automatically diff --git a/CMakePlugin/CMake.cpp b/CMakePlugin/CMake.cpp index 0d29802..a2a2263 100644 --- a/CMakePlugin/CMake.cpp +++ b/CMakePlugin/CMake.cpp @@ -191,7 +191,8 @@ CMake::LoadData(bool force, LoadNotifier* notifier) } // Load data - LoadFromCMake(notifier); + if ( !LoadFromCMake(notifier) ) + return false; // Request to stop if (notifier && notifier->RequestStop()) { @@ -283,7 +284,8 @@ CMake::LoadFromCMake(LoadNotifier* notifier) } // Load - LoadList(types[i].first, *types[i].second, notifier, STEP); + if ( !LoadList(types[i].first, *types[i].second, notifier, STEP) ) + return false; } return true; @@ -446,7 +448,7 @@ CMake::StoreIntoDatabase() /* ************************************************************************ */ -void +bool CMake::LoadList(const wxString& type, CMake::HelpMap& list, LoadNotifier* notifier, int limit) { @@ -466,7 +468,12 @@ CMake::LoadList(const wxString& type, CMake::HelpMap& list, // Foreach names for (wxArrayString::const_iterator it = names.begin(), ite = names.end(); it != ite; ++it) { - + + if ( notifier && notifier->RequestStop() ) { + // Someone called 'wxThread::Delete' + return false; + } + // Trim name wxString name = *it; name.Trim().Trim(false); @@ -496,6 +503,7 @@ CMake::LoadList(const wxString& type, CMake::HelpMap& list, loaded = 0; } } + return true; } /* ************************************************************************ */ diff --git a/CMakePlugin/CMake.h b/CMakePlugin/CMake.h index 3f1d1ac..b6a7290 100644 --- a/CMakePlugin/CMake.h +++ b/CMakePlugin/CMake.h @@ -94,7 +94,11 @@ public: * @brief Loading is done. */ virtual void Done() = 0; - + + /** + * @brief stop the current thread + */ + virtual void Stop() = 0; }; @@ -283,8 +287,10 @@ private: * @param list Output variable. * @param handler Progress notifier. * @param limit Notifier limit. + * @return false incase 'RequestStop' was called during the loading of the help + * true otherwise */ - void LoadList(const wxString& type, CMake::HelpMap& list, + bool LoadList(const wxString& type, CMake::HelpMap& list, LoadNotifier* notifier, int limit); diff --git a/CMakePlugin/CMakeHelpTab.cpp b/CMakePlugin/CMakeHelpTab.cpp index dfbf180..c71ad06 100644 --- a/CMakePlugin/CMakeHelpTab.cpp +++ b/CMakePlugin/CMakeHelpTab.cpp @@ -65,7 +65,7 @@ CMakeHelpTab::CMakeHelpTab(wxWindow* parent, CMakePlugin* plugin) Bind(EVT_THREAD_DONE, &CMakeHelpTab::OnThreadDone, this); // Initial load - LoadData(); + //LoadData(); } /* ************************************************************************ */ @@ -432,4 +432,15 @@ CMakeHelpTab::Done() AddPendingEvent(wxThreadEvent(EVT_THREAD_DONE)); } -/* ************************************************************************ */ +void CMakeHelpTab::Stop() +{ + if ( GetThread() && GetThread()->IsAlive() ) { + GetThread()->Delete(NULL, wxTHREAD_WAIT_BLOCK); + + } else if ( GetThread() ) { + GetThread()->Wait(wxTHREAD_WAIT_BLOCK); + } +} + + +/* ************************************************************************ */ diff --git a/CMakePlugin/CMakeHelpTab.h b/CMakePlugin/CMakeHelpTab.h index 972b1e6..9149004 100644 --- a/CMakePlugin/CMakeHelpTab.h +++ b/CMakePlugin/CMakeHelpTab.h @@ -49,13 +49,12 @@ class CMakePlugin; * @brief Dockable window with CMake help. */ class CMakeHelpTab : public CMakeHelpTabBase, public wxThreadHelper, - public CMake::LoadNotifier + public CMake::LoadNotifier { // Public Ctors & Dtors public: - - + /** * @brief Constructor. * @@ -230,7 +229,11 @@ public: */ virtual void Done(); - + /** + * @brief stop the worker thread + */ + virtual void Stop(); + // Protected Operations protected: @@ -289,4 +292,4 @@ private: /* ************************************************************************ */ -#endif // CMAKE_HELP_TAB_H_ +#endif // CMAKE_HELP_TAB_H_ diff --git a/CMakePlugin/CMakePlugin.cpp b/CMakePlugin/CMakePlugin.cpp index ac31550..81d509b 100644 --- a/CMakePlugin/CMakePlugin.cpp +++ b/CMakePlugin/CMakePlugin.cpp @@ -444,9 +444,14 @@ CMakePlugin::UnPlug() size_t pos = notebook->GetPageIndex("CMake Help"); if (pos != Notebook::npos) { + CMakeHelpTab* helpTab = dynamic_cast<CMakeHelpTab*>( notebook->GetPage(pos) ); + if ( helpTab ) { + helpTab->Stop(); + } notebook->RemovePage(pos); } - + + // Unbind events wxTheApp->Unbind(wxEVT_COMMAND_MENU_SELECTED, &CMakePlugin::OnSettings, this, XRCID("cmake_settings")); diff --git a/CMakePlugin/CMakePlugin.project b/CMakePlugin/CMakePlugin.project index 1a3ea17..6385723 100644 --- a/CMakePlugin/CMakePlugin.project +++ b/CMakePlugin/CMakePlugin.project @@ -1,6 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> <CodeLite_Project Name="CMakePlugin"> <Plugins> + <Plugin Name="CMakePlugin"> + <![CDATA[[{ + "name": "WinDebugUnicode", + "enabled": false, + "buildDirectory": "build", + "sourceDirectory": "$(ProjectPath)", + "generator": "", + "buildType": "", + "arguments": [], + "parentProject": "" + }]]]> + </Plugin> <Plugin Name="qmake"> <![CDATA[00030001N0015WinDebugUnicode0000000000000001N0011WinDebug_290000000000000001N0013WinRelease_29000000000000]]> </Plugin> @@ -60,6 +72,7 @@ <File Name="CMakePlugin.wxcp"/> </VirtualDirectory> <Dependencies Name="WinDebugUnicode"/> + <Dependencies Name="WinReleaseUnicode"/> <Settings Type="Dynamic Library"> <GlobalSettings> <Compiler Options="" C_Options="" Assembler=""> @@ -92,7 +105,7 @@ <Library Value="libwxsqlite3ud.dll"/> </Linker> <ResourceCompiler Options="" Required="no"/> - <General OutputFile="$(IntermediateDirectory)/$(ProjectName)-dbg.dll" IntermediateDirectory="./WinDebugUnicode" Command="./CodeLite" CommandArguments="-b ." UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="../Runtime" PauseExecWhenProcTerminates="no"/> + <General OutputFile="$(IntermediateDirectory)/$(ProjectName)-dbg.dll" IntermediateDirectory="./WinDebugUnicode" Command="./codelite-dbg.exe" CommandArguments="-b . --with-plugins CMakePlugin" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="../Runtime" PauseExecWhenProcTerminates="no" IsGUIProgram="no" IsEnabled="yes"/> <Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>"> <![CDATA[]]> </Environment> @@ -144,7 +157,7 @@ <Library Value="libwxsqlite3u.dll"/> </Linker> <ResourceCompiler Options="" Required="no"/> - <General OutputFile="$(IntermediateDirectory)/$(ProjectName).dll" IntermediateDirectory="./WinReleaseUnicode" Command="./CodeLite" CommandArguments="-b ." UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="../Runtime" PauseExecWhenProcTerminates="no"/> + <General OutputFile="$(IntermediateDirectory)/$(ProjectName).dll" IntermediateDirectory="./WinReleaseUnicode" Command="./CodeLite" CommandArguments="-b ." UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="../Runtime" PauseExecWhenProcTerminates="no" IsGUIProgram="no" IsEnabled="yes"/> <Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>"> <![CDATA[]]> </Environment> @@ -194,7 +207,7 @@ <Library Value="libwxsqlite3ud.dll"/> </Linker> <ResourceCompiler Options="" Required="no"/> - <General OutputFile="../Runtime/plugins/CMakePlugin.dll" IntermediateDirectory="./WinDbg_29" Command="./CodeLite" CommandArguments="-b ." UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="../Runtime" PauseExecWhenProcTerminates="no"/> + <General OutputFile="../Runtime/plugins/CMakePlugin.dll" IntermediateDirectory="./WinDbg_29" Command="./CodeLite" CommandArguments="-b ." UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="../Runtime" PauseExecWhenProcTerminates="no" IsGUIProgram="no" IsEnabled="yes"/> <Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>"> <![CDATA[]]> </Environment> @@ -227,5 +240,4 @@ </Completion> </Configuration> </Settings> - <Dependencies Name="WinReleaseUnicode"/> </CodeLite_Project> ----------------------------------------------------------------------- Summary of changes: CMakePlugin/CMake.cpp | 16 ++++-- CMakePlugin/CMake.h | 10 +++- CMakePlugin/CMakeHelpTab.cpp | 13 ++++- CMakePlugin/CMakeHelpTab.h | 13 +++-- CMakePlugin/CMakePlugin.cpp | 7 ++- CMakePlugin/CMakePlugin.project | 20 ++++++-- CMakePlugin/CMakePlugin.wxcp | 14 +++++- CMakePlugin/CMakePluginUi.cpp | 4 ++ CMakePlugin/CMakePluginUi_bitmaps.cpp | 96 ++++++++++++++++---------------- 9 files changed, 127 insertions(+), 66 deletions(-) hooks/post-receive -- codelite |