[FR-devel] Project plugin thoughts - Was : remove the plugin-menu-item when a plugin is stopped

Laurent Julliard laurent at moldus.org
Sat Apr 16 04:42:44 EDT 2005

Günter Glück wrote:
> hi,
> sorry for beeing so silent in the past time.
> now i'm view at the plugin-manager plugin i started to develop in the past.
> this plugin should make it possible to start and stop plugins on demand over 
> the plugin-manager-panel.
> so i search for the right method to remove a menu-item from the tools-menu.
> sorry if this is a silly question :-)
> günter


Nice to see you again on the FR-devel list. It's good that you are 
restarting the work on the projet manager and, as a matter of fact I 
have been giving some thoughts to it (again!) recently.

So here is where I am and may be it's time to restart the discussion 
on the subject between all of us.

First thing is to think about what a projet is. The conclusion I came 
to is that a project in the FreeRIDE sense is nothing else than a 
collection of properties spread over the various active plugins that 
define the state of FreeRIDE. An example of this is that A project has 
a collection of opened files which are properties of the editpane plugin.

So then the next question is: are all properties related to a project 
context? The asnweer is clearly no. There are properties that belong 
to the plugin itself regardless of the project you are working on. As 
an example it's very likely that you want the editor behavior to be 
the same whatever project you work on.

So what I was thinking of doing is the following:

a) rework the plugins so that their properties are stored either in 
the 'plugin' slot or the 'project' slot depending on their scope. This 
is easy to do.

b) With this in place the project manager plugin will be responsible 
for loading, saving and creating projects.

Saving a project simply means
   - the project manager plugin collects all 'project' property slots 
in all running plugins and store them in the .frp file (the freeride 
project file)

Loading a new project means
   - the project manager plugin reads the .frp file, and calls each 
plugin in turn to pass the corresponding project property slot

   - each plugin must put in place this new project properties and act 

Creating a new projet means
   - from the project manager plugin, create a project property slot 
from a template (which can be different depending on the project type 
e.g. FXRuby application, Console application, Rails application...)

   - each plugin must put in place this new project properties and act 

So now the question is: what does 'act accordingly' means ? After 
looking carefylly at the existing code it occured to me that 
restarting a plugin by calling the stop and then start method was 
probably not the right thing to do. The main reason is because the 
start code has a lot to do with bringing the plugin to life and also 
creating it UI, menu entries....

It seems quite obvious that there is no need to do this again when a 
new project is loaded. For instance for the editpane plugin, loading a 
new projet simply means a) closing all the opened files of the current 
project and b) load all the files of the new project. That's about all.

Consequently my suggestion is to add a new class method to the plugins 
  that would be in charge of doing this. We could call the method 
project_properties=, restart or reload are not really good names 
because start and load already exist and they do something not related 
to what we are trying to achieve here. Suggestions are welcome.. 

So, Günter, while it is an interesting exercise to write the 'plugin 
manager' plugin, I think it is not necessarily what we need for the 
project manager.

Comments from everybody is welcome.


More information about the Freeride-devel mailing list