mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove 'refinement' from search box, because the model doesn't use it (and I had removed it there)
This commit is contained in:
parent
0babff7427
commit
1429832542
@ -57,7 +57,7 @@ class SearchBox2(QComboBox):
|
|||||||
INTERVAL = 1500 #: Time to wait before emitting search signal
|
INTERVAL = 1500 #: Time to wait before emitting search signal
|
||||||
MAX_COUNT = 25
|
MAX_COUNT = 25
|
||||||
|
|
||||||
search = pyqtSignal(object, object)
|
search = pyqtSignal(object)
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
QComboBox.__init__(self, parent)
|
QComboBox.__init__(self, parent)
|
||||||
@ -97,7 +97,7 @@ class SearchBox2(QComboBox):
|
|||||||
self.help_state = False
|
self.help_state = False
|
||||||
|
|
||||||
def clear_to_help(self):
|
def clear_to_help(self):
|
||||||
self.search.emit('', False)
|
self.search.emit('')
|
||||||
self._in_a_search = False
|
self._in_a_search = False
|
||||||
self.setEditText(self.help_text)
|
self.setEditText(self.help_text)
|
||||||
if self.timer is not None: # Turn off any timers that got started in setEditText
|
if self.timer is not None: # Turn off any timers that got started in setEditText
|
||||||
@ -158,9 +158,8 @@ class SearchBox2(QComboBox):
|
|||||||
if not text or text == self.help_text:
|
if not text or text == self.help_text:
|
||||||
return self.clear()
|
return self.clear()
|
||||||
self.help_state = False
|
self.help_state = False
|
||||||
refinement = text.startswith(self.prev_search) and ':' not in text
|
|
||||||
self.prev_search = text
|
self.prev_search = text
|
||||||
self.search.emit(text, refinement)
|
self.search.emit(text)
|
||||||
|
|
||||||
idx = self.findText(text, Qt.MatchFixedString)
|
idx = self.findText(text, Qt.MatchFixedString)
|
||||||
self.block_signals(True)
|
self.block_signals(True)
|
||||||
@ -195,7 +194,7 @@ class SearchBox2(QComboBox):
|
|||||||
if self.timer is not None: # Turn off any timers that got started in setEditText
|
if self.timer is not None: # Turn off any timers that got started in setEditText
|
||||||
self.killTimer(self.timer)
|
self.killTimer(self.timer)
|
||||||
self.timer = None
|
self.timer = None
|
||||||
self.search.emit(txt, False)
|
self.search.emit(txt)
|
||||||
self.line_edit.end(False)
|
self.line_edit.end(False)
|
||||||
self.initial_state = False
|
self.initial_state = False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user