I borrowed some code from SendToDeviceAction to disable my plugins while on device view:
def location_selected(self, loc):
enabled = loc == 'library'
But in both my plugin and
SendToDeviceAction, the Keyboard Shortcut key still triggered it.
IE, I can select a book in the library, switch to the device view--'Send to Device' on my toolbar is now disabled--and hit 'D' and calibre will send the book from the library to the device.
Is it supposed to work that way? I would expect disabled actions to not work from Keyboard Shortcut either.