Ok, this explains one of them.
When switching libraries, look at lines 452 onwards in ui.py
First it calls the plugin library_changed method
Then it clears the search restrictions and saved searches in 455-457.
I can't see any obvious events or anything I could hook into after that point.
As for Calibre startup, I have found that I can actually apply a saved search, but not a search restriction. I'll see if I can find why on that one out too...
EDIT: Ok, I don't know what I did wrong previously but I can now apply searches AND restrictions from my plugin at startup. It is ONLY when switching libraries, for the reasons stated above that I cannot apply from library_changed.
Any alternative suggestions?
Last edited by kiwidude; 04-10-2011 at 06:59 PM.
Reason: Update findings
|