Any ideas? I haven't found any event defined for that...A loading complete event does not exist.
void MyPlugin::OnProjectActivated(CodeBlocksEvent& event)
{
// project will be apointer to the active project
cbProject* project = event.GetProject();
// first check if project is not NULL
if (project)
{
// do something meaningful here
}
event.Skip();
}
If I see it right, cbEVT_WORKSPACE_CHANGED is send from EndLoadingWorkspace().Any ideas? I haven't found any event defined for that...A loading complete event does not exist.
However, you can use the project activated event.
If you really need an event for the case "workspace completely loaded", provide a patch accordingly. It should be really simple to implement. Create an event in sdk_events{.cpp/.h} and instrument the method "ProjectManager::LoadWorkspace" accordingly.
There is an event:
cbEVT_PROJECT_ACTIVATE
The event provides the active project as pointer:
However, you can use the project activated event.If I see it right, cbEVT_WORKSPACE_CHANGED is send from EndLoadingWorkspace().
If you really need an event for the case "workspace completely loaded", provide a patch accordingly. It should be really simple to implement. Create an event in sdk_events{.cpp/.h} and instrument the method "ProjectManager::LoadWorkspace" accordingly.
16:29:19,888 => cbEVT_APP_ACTIVATED
16:29:19,891 => cbEVT_EDITOR_SWITCHED
16:29:19,891 => cbEVT_EDITOR_ACTIVATED
16:29:21,481 => cbEVT_WORKSPACE_CHANGED
16:29:21,507 => cbEVT_EDITOR_CLOSE
Loading workspace "/home/jens/src/src/SPS_Log.workspace"
Loading project file...
Parsing project file...
16:29:21,512 => cbEVT_PROJECT_RENAMED
16:29:21,512 => cbEVT_PROJECT_TARGETS_MODIFIED
16:29:21,513 => cbEVT_BUILDTARGET_ADDED
16:29:21,513 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Debug
16:29:21,513 => cbEVT_BUILDTARGET_ADDED
16:29:21,514 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Release
16:29:21,516 => cbEVT_BUILDTARGET_ADDED
16:29:21,516 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target WinRelease
16:29:21,517 => cbEVT_BUILDTARGET_ADDED
16:29:21,517 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target WinDebug
16:29:21,518 => cbEVT_BUILDTARGET_ADDED
16:29:21,518 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Release gcc-4.4
16:29:21,518 => cbEVT_BUILDTARGET_ADDED
16:29:21,519 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target clang++ Debug
Loading project files...
16:29:21,519 => cbEVT_PROJECT_BEGIN_ADD_FILES
16:29:21,520 => cbEVT_PROJECT_END_ADD_FILES
2 files loaded
Done loading project in 10ms
Project's base path: /home/jens/src/src/libbeckhoff/
Project's common toplevel path: /home/jens/src/src/libbeckhoff/
16:29:21,522 => cbEVT_BUILDTARGET_SELECTED
Loading project file...
Parsing project file...
16:29:21,524 => cbEVT_PROJECT_RENAMED
16:29:21,525 => cbEVT_PROJECT_TARGETS_MODIFIED
16:29:21,525 => cbEVT_BUILDTARGET_ADDED
16:29:21,525 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Debug
16:29:21,526 => cbEVT_BUILDTARGET_ADDED
16:29:21,526 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Release
16:29:21,526 => cbEVT_BUILDTARGET_ADDED
16:29:21,527 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target WinRelease
16:29:21,527 => cbEVT_BUILDTARGET_ADDED
16:29:21,527 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target WinDebug
16:29:21,528 => cbEVT_BUILDTARGET_ADDED
16:29:21,528 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Release gcc-4.4
16:29:21,529 => cbEVT_BUILDTARGET_ADDED
16:29:21,529 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target clang++ Debug
Loading project files...
16:29:21,530 => cbEVT_PROJECT_BEGIN_ADD_FILES
16:29:21,531 => cbEVT_PROJECT_END_ADD_FILES
13 files loaded
Done loading project in 9ms
Project's base path: /home/jens/src/src/
Project's common toplevel path: /home/jens/src/src/
16:29:21,533 => cbEVT_BUILDTARGET_SELECTED
SPS_Log now depends on libbeckhoff (1 deps)
16:29:21,538 => cbEVT_PROJECT_ACTIVATE
16:29:21,539 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,541 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,541 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,542 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,542 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,548 => cbEVT_PROJECT_OPEN
16:29:21,548 => cbEVT_PROJECT_OPEN
16:29:21,549 => cbEVT_WORKSPACE_CHANGED
Passing list of files to batch-parser.
Header to parse with priority: '/usr/include/c++/4.6/cstddef'
Header to parse with priority: '/usr/include/wx-2.8/wx/defs.h'
Header to parse with priority: '/usr/include/wx-2.8/wx/dlimpexp.h'
Header to parse with priority: '/usr/include/wx-2.8/wx/toplevel.h'
Header to parse with priority: '/usr/include/boost/config.hpp'
Header to parse with priority: '/usr/include/boost/filesystem/config.hpp'
Add 6 priority parsing file(s) for project 'SPS_Log'...
Added 9 file(s) for project 'SPS_Log' to batch-parser...
Create new parser for project 'SPS_Log'
Starting batch parsing for project 'SPS_Log'...
Project 'SPS_Log' parsing stage done!
Project 'SPS_Log' parsing stage done (512 total parsed files, 26463 tokens in 0 minute(s), 2.260 seconds).
Updating class browser...
Class browser updated.
16:29:24,607 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:24,609 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:24,610 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:24,610 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:24,611 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:24,612 => cbEVT_COMPILER_SET_BUILD_OPTIONS
Add project (libbeckhoff) to parser
Done adding 1 files of project (libbeckhoff) to parser.
Add next project to parser.
Starting batch parsing for project 'libbeckhoff'...
Project 'libbeckhoff' parsing stage done!
Project 'libbeckhoff' parsing stage done (513 total parsed files, 26463 tokens in 0 minute(s), 0.021 seconds).
Updating class browser...
Class browser updated.
I just looked into the events with my DisplayEvents-plugin, and I see it being triggered.
16:29:21,538 => cbEVT_PROJECT_ACTIVATE
16:29:21,539 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,541 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,541 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,542 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,542 => cbEVT_COMPILER_SET_BUILD_OPTIONS
16:29:21,548 => cbEVT_PROJECT_OPEN
16:29:21,548 => cbEVT_PROJECT_OPEN
16:29:21,549 => cbEVT_WORKSPACE_CHANGED
But, I see that I can use the cbEVT_WORKSPACE_CHANGED, as expected.Didn't digged deeper into it, but if this event is really only thrown if the WS is loaded we should consider renaming it, indeed. I would have thought that this event is also triggered in case I change WS settings, like project dependencies.
But, I see that I can use the cbEVT_WORKSPACE_CHANGED, as expected.Didn't digged deeper into it, but if this event is really only thrown if the WS is loaded we should consider renaming it, indeed. I would have thought that this event is also triggered in case I change WS settings, like project dependencies.
you mentioned a plugin you use for developement: "DisplayEvents-plugin". Where do I find this one to use it myself?Search the forums. ;-)
Ok, I haven't dug into it neither, so I'm also not sure....I had a look: I guess for your purpose this event is no good. It really fires several times, whenever a project is closed, all projects are closed, a WS is closed, a project has finished loading and a WS has finished loading. If that' still OK with you - go ahead. However, the most accurate way for your purpose would really be to implement such an event yourself and provide us with a patch.
I also indexed it (http://wiki.codeblocks.org/index.php?title=DisplayEvents_plugin) in the plugins page (http://wiki.codeblocks.org/index.php?title=Code::Blocks_Plugins#3rd_Party_Plugins) about a month ago.you mentioned a plugin you use for developement: "DisplayEvents-plugin". Where do I find this one to use it myself?Search the forums. ;-)
Ok, I haven't dug into it neither, so I'm also not sure....I had a look: I guess for your purpose this event is no good. It really fires several times, whenever a project is closed, all projects are closed, a WS is closed, a project has finished loading and a WS has finished loading. If that' still OK with you - go ahead. However, the most accurate way for your purpose would really be to implement such an event yourself and provide us with a patch.
08:26:30,294 => cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Debug
Loading project files...
08:26:30,296 => cbEVT_PROJECT_BEGIN_ADD_FILES
08:26:30,297 => cbEVT_PROJECT_END_ADD_FILES
2 files loaded
Done loading project in 10ms
08:26:30,302 => cbEVT_BUILDTARGET_SELECTED
08:26:30,910 => cbEVT_COMPILER_SET_BUILD_OPTIONS
08:26:30,911 => cbEVT_COMPILER_SET_BUILD_OPTIONS
08:26:30,912 => cbEVT_COMPILER_SET_BUILD_OPTIONS
08:26:30,920 => cbEVT_PROJECT_ACTIVATE
EnvVars: Obtained 'default' as active envvar set from config.
EnvVars: Active envvar set is 'default', config path '/sets/default'.
EnvVars: Searching for envvars in path '/sets/default'.
EnvVars: Read 0/0 envvars in path '/sets/default'.
08:26:30,954 => cbEVT_PROJECT_OPEN
08:26:31,002 => cbEVT_PROJECT_OPEN
08:26:31,004 => cbEVT_PROJECT_OPEN
08:26:31,006 => cbEVT_PROJECT_OPEN
08:26:31,007 => cbEVT_WORKSPACE_CHANGED
08:26:31,007 => cbEVT_WORKSPACE_FINISH_LOADING
I also indexed it (http://wiki.codeblocks.org/index.php?title=DisplayEvents_plugin) in the plugins page (http://wiki.codeblocks.org/index.php?title=Code::Blocks_Plugins#3rd_Party_Plugins) about a month ago.you mentioned a plugin you use for developement: "DisplayEvents-plugin". Where do I find this one to use it myself?Search the forums. ;-)
If you really need an event for the case "workspace completely loaded", provide a patch accordingly. It should be really simple to implement. Create an event in sdk_events{.cpp/.h} and instrument the method "ProjectManager::LoadWorkspace" accordingly.
If you do what I said here:If you really need an event for the case "workspace completely loaded", provide a patch accordingly. It should be really simple to implement. Create an event in sdk_events{.cpp/.h} and instrument the method "ProjectManager::LoadWorkspace" accordingly.
You wouldn't even need to change the API interface. I think putting this event in WorkspaceChanged is the wrong place.
And maybe I'll change the event name to cbEVT_WORKSPACE_LOADING_COMPLETE, that would be more uniform with the other events names...True... I'll wait patiently...
I don't want to keep you wanting, so here it is...And maybe I'll change the event name to cbEVT_WORKSPACE_LOADING_COMPLETE, that would be more uniform with the other events names...True... I'll wait patiently...