[referencer] lyx plugin

Aurélien Naldi aurelien.naldi at gmail.com
Sat Jan 5 16:06:13 EST 2008


Le samedi 05 janvier 2008 à 18:02 +0000, John Spray a écrit :
> On Sat, 2008-01-05 at 13:13 +0100, Aurélien Naldi wrote:
> 
> > * the plugin does not set it's icon. I could add one more field for
> > this, defaulting to stock:execute as now. Being limited to stock icons
> > would be a good start, especially as we would have to deal with
> > dependencies/installation for non-stock ones.
> 
> I'd be happy with letting the plugins give an icon name relative to the
> referencer data directory, and looking it up in
> onEanbledpluginsPrefChanged using Utility::findDataFile.  Obviously it's
> not very useful for third-party plugins, but for stuff included in
> referencer it'll do.  An empty string would mean "use some default
> icon", which could be the stock execute icon as it is now.
> 
> The UI should go into the Documents menu as well as the toolbar, I think
> -- that should just require adding a bit to the UI XML.

Here is another patch adding custom icon for plugins (and an entry in
the document menu).
It is a bit messy, but I haven't found any cleaner way to do it (taken
and adapted from http://lugod.org/presentations/gtkmm/menus.html )

It can probably be a bit improved, especially by avoiding creating a
stock icon each time, but by testing first if one exists:
* if a stock icon with the name specified by the plugin exists, take it.
This will allow plugin to use whichever stock icons they want.
* if the plugin has been enabled, disabled and enabled again, we can
probably avoid recreating it again.

Is there a better way to do it or can it go with these improvements ?

-- 
Aurélien Naldi <aurelien.naldi at gmail.com>




More information about the referencer mailing list