View Single Post
Old 04-20-2011, 11:09 AM   #2
kiwidude
calibre/Sigil 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,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
There is code that does this in my walk search history plugin. There is a bunch more stuff to actually hook/unhook events as appropriate but the magic line is:
Code:
        # Apply the popup type for this action in the toolbar
        # Only update on the toolbar if it is actually visible there
        if self.qaction in self.gui.tool_bar.added_actions:
            self.gui.tool_bar.setup_tool_button(self.gui.tool_bar, self.qaction, self.popup_type)
Of course with all the additional toolbars etc Calibre has nowadays perhaps it is not sufficient, I haven't tested it elsewhere than the main toolbar.
kiwidude is offline   Reply With Quote