View Single Post
Old 04-10-2011, 06:47 PM   #4
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,733
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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
kiwidude is offline   Reply With Quote