View Single Post
Old 09-09-2022, 05:15 PM   #16
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,730
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Just FYI I am making a few changes/fixes to this plugin, particularly as it is one that I use every day.

Thanks to @ownedbycats for that bug report above after clearing history. It is a simple bug in displaying the history in the menu which I have fixed.

Several of you also reported problems with the keyboard shortcuts. I've replicated the issue. You will find the keys work fine provided you don't do anything to trigger the menu being rebuilt - like using the Favourites Menu plugin or directly opening the menu of this plugin. There seems to be a problem with the keyboard shortcut being "double registered" - so under the covers Qt goes "what is this nonsense" and reports an "Ambiguous shortcut overload". It doesn't matter what you change the shortcut keys to it will eventually get doubled up and stop working. I'm certain this worked fine a long time ago, nowadays not so much...

Slightly concerning is similar code to register shortcuts was used in most of my plugins (and probably those of many others) - the create_menu_action_unique() method in common_utils.py. Still looking into exactly why it's going wrong and if it is just a bugged version that has been used here vs other plugins as the code has diverged independently over the years. I mention it here in case some of the other plugin authors recall "ahhh yeah I had that happen and I fixed it in XXX plugin"...

EDIT: Ok I think I finally figured it out and yes some other plugins like ReadingList do work around it. The problem is that you have to manually call unregister_shortcut() every time you rebuild the menu. It is only a problem for plugins which have default keyboard shortcuts specified like this one does...

One further addition I have also made for the next version of this plugin is an option to support having a different history per library, remembered as you switch between them. Thanks to @BetterRed for that suggestion - as recently as 2014 so I'm sure it is top of their mind, ha...

Last edited by kiwidude; 09-09-2022 at 06:49 PM.
kiwidude is offline   Reply With Quote