Ahhh - () is the magic trick, thanks. There is quite a bit of "different" looking code between the two methods so I wasn't sure if there were other intended differences. I have my own plugin wrapper function from previous so just figuring out the combination I want to use.
Another question - as I mentioned above all my plugins have had to include on their configuration dialogs a way for the user to customise shortcuts. Now the Calibre dialog exists, that offers a more powerful alternative.
So for a plugin that has a fixed number of menu actions (e.g. Find Duplicates), the question is whether I should rip out all the GUI configuration in my plugin for these. My inclination is to rip them out, and for those plugins leave all keyboard shortcut configuration via the Calibre dialog in Preferences->Plugins.
The only downside I see is that a user needs to go to two places to configure a plugin. There are some other options that "might" be possible, but it is the simplest approach.
The second part of this is for plugins that have a dynamic number of actions (plus sometimes some static ones as well). Open With, Search the Internet, View Manager & Reading List are all examples of this. The user can dynamically add more menu items in all these plugins and have keyboard shortcuts associated with them (sometimes multiple). Do you think it acceptable that I completely remove all shortcut configuration from the plugins, and leave it to the user to go into the completely separate Calibre dialog to associate shortcuts?
Again I am inclined to take the "easy" route and say all shortcuts are via Calibre's dialog. The pluses being consistency and the user gets instant feedback of conflicts and a more user friendly UI.
Any opinions from anyone as to what they would like the "standard" for Calibre to be (since with only a couple of exceptions like meme's Kindle plugin I have written darn near all the GUI plugins in the forum).
My final comment is that from an upgrade perspective, I have all but decided that users will lose any shortcuts they have configured, and must manually recreate them in the Calibre dialog. I think it will be way too complicated to try to migrate shortcuts stored in config files for existing users into the new way of doing things.
|