View Single Post
Old 08-27-2011, 11:11 AM   #6
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,732
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Ok, so I'm just starting to look into this again. Firstly I think there is a minor bug - if you go to Preferences -> Keyboard, click on an existing shortcut, don't change anything (so radio button of default is set) and click Done, then it shows "Shortcuts: None". When in actual fact it is really still the default shortcut. To genuinely set a shortcut to none, you choose "Custom" and click Done - but visually you cannot see the difference of "None" until you close and come back into the dialog?

Anyhow, back to the main challenge - plugin shortcuts. I'm seeing different behaviour from the "InterfaceAction.create_action" versus "create_menu_action" functions. This could well be intentional but it would be good to hear your intentions with these?

Currently my plugins all call create_action(). Which means that they will only appear in the Preferences->Keyboard dialog if at the time I call create_action I am setting a shortcut value.

However as you mention above the Calibre plugins are calling create_menu_action(). Which has a differing behaviour - if no shortcut is specified they will still appear in your Keyboard dialog.

I know create_menu_action() is a new addition as part of these changes - I just want to figure out when I should be using which?
kiwidude is offline   Reply With Quote