View Single Post
Old 03-09-2011, 07:17 AM   #1
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,718
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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.
kiwidude is offline   Reply With Quote