mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement advanced search
This commit is contained in:
parent
1de21832e5
commit
2080d9e52d
@ -42,6 +42,8 @@ class SearchItem(Ui_Form, QWidget):
|
||||
def token(self):
|
||||
txt = qstring_to_unicode(self.text.text()).strip()
|
||||
if txt:
|
||||
if self.negate.isChecked():
|
||||
txt = '!'+txt
|
||||
tok = self.FIELDS[qstring_to_unicode(self.field.currentText())]+txt
|
||||
if re.search(r'\s', tok):
|
||||
tok = '"%s"'%tok
|
||||
|
@ -30,6 +30,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="negate" >
|
||||
<property name="toolTip" >
|
||||
<string><p>Negate this match. That is, only return results that <b>do not</b> match this query.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Negate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user