I suggest removing the persistence of shortcuts from your plugins, use calibre's global functionality for that. Depending on exactly how you implement shortcuts in your plugins, the shortcut persistence in the plugin may lose or it may win.
General background on this change:
1) Any shortcut defined via the action_spec field in your plugin class is automatically managed by calibre. Do not persist these manually.
2) If you want to define shortcuts for more actions (for example for actions in the menu of the main action, use the convenience methods
create_action or create_menu_action
to register these with calibre automatically. All the builtin plugins have been migrated to use create_menu_action, so it should be easy to see how they are used.
3) If for any reason you dont want to use create_menu_action, use gui.keyboard.register_shortcut instead. See the register_shortcut method in gui2/keyboard.py
|