From 4caa7653a747d120575a43344c7acb771f71b1b3 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Tue, 8 Mar 2011 16:47:03 +0000 Subject: [PATCH] highlighting rows API --- src/calibre/gui2/library/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index b782cc7c72..33d12e8ab9 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -268,6 +268,15 @@ class BooksModel(QAbstractTableModel): # {{{ return None return self.get_current_highlighted_id() + def highlight_ids(self, ids_to_highlight): + self.ids_to_highlight = ids_to_highlight + self.ids_to_highlight_set = set(self.ids_to_highlight) + if self.ids_to_highlight: + self.current_highlighted_idx = 0 + else: + self.current_highlighted_idx = None + self.reset() + def search(self, text, reset=True): try: if self.highlight_only: