Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

cbEVT_PROJECT_OPEN and cbEVT_PROJECT_ACTIVATE

<< < (2/2)

MortenMacFly:

--- Quote from: daniloz on December 05, 2011, 09:49:25 pm ---@devs any feedback?

--- End quote ---
I'm afraid this might be caused due to a change in the logic how projects are processed in combination with (re-)building the visual project tree. This change was done to speed-up the process and this event might not have been considered. You could check this by compiling the DisplayEvents plugin against 10.05 (for example) and see if the order was really different.

However, it really means to inform whenever a project is activated which is what it does. That the order is now after the project open event maybe something to fix by moving the project open event before activate, but this needs to be done with care.

I wonder why you need both: Open and Activate. Usually you only need one of these depending on what you have in mind and then the order becomes not important. Is there a particular reason why you need the Open before the Avtivate event?

daniloz:

--- Quote from: MortenMacFly on December 06, 2011, 04:36:44 pm ---
--- Quote from: daniloz on December 05, 2011, 09:49:25 pm ---@devs any feedback?

--- End quote ---
I'm afraid this might be caused due to a change in the logic how projects are processed in combination with (re-)building the visual project tree. This change was done to speed-up the process and this event might not have been considered. You could check this by compiling the DisplayEvents plugin against 10.05 (for example) and see if the order was really different.

--- End quote ---
Thanks for the reply, Morten.

I've tried with 10.05 and it's even worst (from my point of view). From the log below, you'll see that the cbEVT_PROJECT_ACTIVATE is triggered after loading the first project, which is the active one. But the four cbEVT_PROJECT_OPEN just come at the end of the workspace loading.

So, to answer your question... it's different, but not yet what I'd expect...


--- Code: ---17:21:24,622  =>  cbEVT_WORKSPACE_CHANGED
17:21:24,626  =>  cbEVT_EDITOR_CLOSE
Loading workspace "C:\Data\GPA\FW-DSP\Flexus.workspace"
Loading project file...
Parsing project file...
[...]
261 files loaded
Done loading project in 41ms
[...]
17:21:24,859  =>  cbEVT_PROJECT_ACTIVATE
Loading project file...
Parsing project file...
[...]
202 files loaded
Done loading project in 47ms
[...]
2 files loaded
Done loading project in 13ms
Loading project file...
Parsing project file...
[...]
2 files loaded
Done loading project in 12ms
[...]
17:21:25,261  =>  cbEVT_PROJECT_OPEN
17:21:25,262  =>  cbEVT_PROJECT_OPEN
17:21:25,263  =>  cbEVT_PROJECT_OPEN
17:21:25,267  =>  cbEVT_PROJECT_OPEN
[...]
Updating class browser...
Class browser updated.
17:21:25,939  =>  cbEVT_WORKSPACE_CHANGED

--- End code ---


--- Quote from: MortenMacFly on December 06, 2011, 04:36:44 pm ---However, it really means to inform whenever a project is activated which is what it does. That the order is now after the project open event maybe something to fix by moving the project open event before activate, but this needs to be done with care.

--- End quote ---
That's what I'd do, if I knew the code better... but I understand that this has to be done with extra care to avoid breaking something else...


--- Quote from: MortenMacFly on December 06, 2011, 04:36:44 pm ---I wonder why you need both: Open and Activate. Usually you only need one of these depending on what you have in mind and then the order becomes not important. Is there a particular reason why you need the Open before the Avtivate event?

--- End quote ---
Maybe there's a clever way of doing things, but I'm writing a source control plugin for MS Visual SourceSafe and I get the config information from the project on Open. And whenever then user activate another project, I use this information to display the actual files in check-out for the active project on Activate.

It all works well, expect when loading a workspace with more than one project. Then, I hit the Activate before having seen the Open and I don't have the config information to access the SourceSafe DataBase...

Navigation

[0] Message Index

[*] Previous page

Go to full version