Ajatt-Tools / anki.koplugin

KOReader plugin enabling Anki card generations for words looked up in the internal dictionary.
49 stars 6 forks source link

Play nice with vocab builder plugin #22

Closed equwal closed 1 month ago

equwal commented 4 months ago

Looks like this plugin and vocab builder conflict because they both try to set the same button, rather than creating two buttons for example.

nairyosangha commented 4 months ago

I'm not sure this is going to be possible. KOReader provides a tweak_buttons_func which is called by the widget that shows the dictionary when you do a lookup. This was added specifically for the vocabbuilder plugin. I'm using the same thing, and I make sure that it gets overwritten when the reader is loaded, while vocabbuilder only calls it on startup.

Because of that, I overwrite the function set by vocabbuilder. It's not really designed in a way to be called in multiple places

equwal commented 3 months ago

ok then

nairyosangha commented 3 months ago

The guys at koreader were nice enough to allow me to make this work for me, so I can actually do this properly now after all, but I will wait for a new koreader release first

nairyosangha commented 1 month ago

New koreader release is out, this should no longer be a problem now (be sure to check out the latest commit here too)