From: Fabien C. <fab...@go...> - 2009-03-08 19:40:11
|
On Sun, Mar 8, 2009 at 8:22 PM, Matthew Gates <mat...@gm...> wrote: > I modified the plugins AngleMeasure, CompassMarks and Ocular to add a > toolbar button for each. By using a gui action to toggle their on/off > status, rather than handleKeys, we also get the hot-key added into the help > dialog. The button and help text make plugins discoverable by users who are > not reading the console output. > > Disadvantage - plugins are now dependent on the GUI code. When the plugin > control interface is implemented we need to add a way to remove toolbar > buttons and gui actions when a plugin is disabled, so as to prevent > connections between key bindings and no-longer-loaded plugins (potential for > SEGV). > > On the subject of help text for key bindings, we do not presently have a > mechanism to add help for key bindings which are handled by the handleKeys > function. e.g. the numeric keys in the Ocular plugin for selecting which > ocular to use. I think this is necessary for the help dialog key bindings > list to be complete. I think plugins authors should have a nice mechanism > for doing this. > > One possible mechanism would be that all plugins provide a member which > returns a map of key binding / help texts, and that the help text is updated > whenever a plugin is loaded/unloaded. Fabien, you said you didn't like this > approach, but I would like to advocate it again now. > > Plugins should be able to provide a more free-form help string for use in > the plugin management tool when it is implemented (i.e. a description of > what the plugin is for), but I think it's important to have a separate > method so that key binding list in the help dialog is complete and all in > one place. OK OK, I was probably too extreme. So we could add the 2 following methods: - one for getting a key stroke/help text for non Action key binding - add a generic deinit() method which removes all the added GUI elements and which is called automatically when a plugin is unregistered. - for the general description of the plugin info, I guess the easiest approach is to make like for the SkyCultures: provide a free form html file stored in each plugin directory which will be displayed in the dialog. Fabien |