View Single Post
Old 03-08-2011, 09:27 AM   #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,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by chaley View Post
What should work today is library_view.select_rows(). This is not a search, but instead will highlight the rows in the view in the same fashion as search w/highlight search results. The user can use next and previous to move around in the highlighted set. This technique will not interfere with searching and restrictions.
So I decided to give this approach a go. I have built up a list of ids I want to highlight, and have code something like this:
Code:
self.gui.search.clear() # As my code works across the whole library
invalid_ids = [... build up my model ids...]
self.gui.library_view.model().set_highlight_only(True)
self.gui.library_view.select_rows(invalid_ids)
However all that does is select the rows, it won't actually color them. The highlighting code seems to take place in the search code in BooksModel, where it sets those "ids_to_highlight" etc.

Any suggestions as to what else I need to do?
kiwidude is offline   Reply With Quote