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, 09:45 AM   #1
BeckyEbook
Zealot
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: 136
Karma: 481790
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:	25
Size:	12.0 KB
ID:	167433  
BeckyEbook is offline   Reply With Quote
Old 11-04-2018, 12:04 PM   #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: 33,615
Karma: 10209576
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
Old 11-04-2018, 01:17 PM   #3
BeckyEbook
Zealot
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: 136
Karma: 481790
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 10:55 PM
question about "user defined usb device" plugin Kaverin Plugins 2 03-08-2014 10:59 PM
Folder "device" plugin - suggestions? schizoiddonkey Development 4 05-03-2012 01:20 PM
SONY pocket edition: "Device locked" + "charge battery" obstacles? hermes Devices 3 06-02-2011 04:32 AM
Run plugin after "send to device" minicheck Development 1 02-26-2011 10:42 PM


All times are GMT -4. The time now is 06:02 AM.


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