From 5e71cbddf3ad418bbe4cd42f65fbfad8aed16746 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 17 Jun 2010 14:35:53 +0100 Subject: [PATCH] 1) small correction to search box coloring 2) correct inlibrary search feature in model (exception on bool) --- src/calibre/gui2/library/models.py | 2 ++ src/calibre/gui2/search_box.py | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 787b77251f..ca1afbe6b4 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -823,6 +823,8 @@ class OnDeviceSearch(SearchQueryParser): # {{{ if accessor(row) is None: matches.add(index) continue + if locvalue == 'inlibrary': + continue # this is bool, so can't match below try: ### Can't separate authors because comma is used for name sep and author sep ### Exact match might not get what you want. For that reason, turn author diff --git a/src/calibre/gui2/search_box.py b/src/calibre/gui2/search_box.py index 848c3f2238..ab0737b650 100644 --- a/src/calibre/gui2/search_box.py +++ b/src/calibre/gui2/search_box.py @@ -136,11 +136,9 @@ class SearchBox2(QComboBox): def key_pressed(self, event): self.normalize_state() - if not self.as_you_type: - if event.key() in (Qt.Key_Return, Qt.Key_Enter): - self.do_search() - else: - self.timer = self.startTimer(self.__class__.INTERVAL) + if event.key() in (Qt.Key_Return, Qt.Key_Enter): + self.do_search() + self.timer = self.startTimer(self.__class__.INTERVAL) def mouse_released(self, event): self.normalize_state()