View Single Post
Old 04-20-2011, 11:09 AM   #2
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,731
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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