Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 11-04-2018, 08:45 AM   #1
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 664
Karma: 2180702
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
How to gray out the plugin icon after selecting "Device"

I want grayed plugin icon on toolbar after click on "Device" icon.
This plugin works only in libraries.

Of course I have the right message, but grayed icon suits me better/easier.
Attached Thumbnails
Click image for larger version

Name:	grayed.gif
Views:	222
Size:	12.0 KB
ID:	167433  
BeckyEbook is offline   Reply With Quote
Old 11-04-2018, 11:04 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
disable the qaction of the plugin, that should make qt render it as disabled. But in general in calibre actions are not rendered disabled, as it is not always clear to the user why it is disabled. Instead popup an error message explaining that the action can only be used in the main book list not the device list. And add metadata to the plugin to indicate it should not be added to the device toolbars (see dont_add_to) in the plugin api.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-04-2018, 12:17 PM   #3
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 664
Karma: 2180702
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
Thank you. Works!

Code:
    def location_selected(self, loc):
        enabled = loc == 'library'
        self.qaction.setEnabled(enabled)
        self.menuless_qaction.setEnabled(enabled)
I do not want to add dont_add_to for 'toolbar-device', because the plugin is neutral and works always, but only in libraries.
BeckyEbook is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting the Wheat from the Chaff - Selecting "New Market" EBooks darryl General Discussions 18 09-11-2014 09:55 PM
question about "user defined usb device" plugin Kaverin Plugins 2 03-08-2014 09:59 PM
Folder "device" plugin - suggestions? schizoiddonkey Development 4 05-03-2012 12:20 PM
SONY pocket edition: "Device locked" + "charge battery" obstacles? hermes Devices 3 06-02-2011 03:32 AM
Run plugin after "send to device" minicheck Development 1 02-26-2011 09:42 PM


All times are GMT -4. The time now is 06:34 PM.


MobileRead.com is a privately owned, operated and funded community.