View Single Post
Old 02-08-2020, 11:34 AM   #1
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
UI plugin icon not displaying in context menu

Never mind, I figured it out. My problem was due to a missing line.
Code:
popup_type = QToolButton.InstantPopup
I never have been exactly sure about the available options for popup_type. I just learnt the hard way.

Hi Kovid,

calibre 4.10.1 Win10 32-bit ... Can you shed any light on the following:

This is not a showstopper but I've just noticed a problem with non-display of the main plugin icon in some of my UI plugins. It may have been around longer but I've only just noticed it.

The problem seems to occur only in the right-click context menu and only for UI plugins which don't have a sub-menu. See attached screenshots.

Using ScrambleEbook as an example of a UI plugin with no sub-menu, as you can see (2nd image) the plugin icon displays OK in the main toolbar and in the main menu. However in the right-click context menu (1st image) the icon is blank.

Compare this with the 'TTS to MP3' (which does have a sub-menu) next to ScrambleEbook where the icon displays OK everywhere.

I notice that the built-in tools/plugins which don't have a sub-menu (e.g. 'Polish book', 'Unpack book') don't have the same problem. I don't think the problem is specific to ScrambleEbook because 2 of my other (personal) plugins have the same problem.


This is the genesis code from ScrambleEbook in case this is where the problem lies.
Code:
def genesis(self):
    self.is_library_selected = True
    self.icons = get_icons(['images/plugin_icon.png',
                            'images/azw3.png',
                            'images/epub.png',
                            'images/kepub.png',
                            'images/azw3.svg',
                            'images/epub.svg',
                            'images/kepub.svg'
                            ])
    icon = get_icons('images/plugin_icon.png')
    self.qaction.setIcon(icon)
    self.qaction.triggered.connect(self.show_dialog)
Attached Thumbnails
Click image for larger version

Name:	calibre_noicon.jpg
Views:	423
Size:	317.6 KB
ID:	177020   Click image for larger version

Name:	calibre_noicon2.jpg
Views:	400
Size:	16.7 KB
ID:	177021  

Last edited by jackie_w; 02-08-2020 at 04:34 PM.
jackie_w is offline   Reply With Quote