Giving users menu/toolbars option when adding plugin
Kovid mentioned on another thread the idea of popping up a list of possible menu/toolbar locations a user could display a GUI plugin in when adding a plugin. This would be great to stop the almost daily posts from users who cannot figure out how to add or only put it on the toolbar.
I said I would have go at adding this, but have hit a snag. The "dont_add_to" set of locations resides on the InterfaceAction class. At the point this code will reside in plugins.py you only have "plugin" which is a subclass of InterfaceActionBase. The gui actions are not instantiated until after a Calibre restart.
So how can I get to the "dont_add_to" set? Is it "safe" to call load_actual_plugin and then query that object? Presumably that means there are two instance instantiated temporarily for when you are upgrading plugins, is that ok?
Last edited by kiwidude; 03-09-2011 at 07:25 AM.
|