mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1929300 [[Enhancement] Add a Clear button to clear the tab Advanced search of the Advanced search window](https://bugs.launchpad.net/calibre/+bug/1929300)
This commit is contained in:
parent
bf9248ddea
commit
ef11d26921
@ -30,6 +30,7 @@ class AdvSearchBuilderDialog(QDialog, Ui_Dialog):
|
|||||||
self.tab_2_button_box.accepted.connect(self.accept)
|
self.tab_2_button_box.accepted.connect(self.accept)
|
||||||
self.tab_2_button_box.rejected.connect(self.reject)
|
self.tab_2_button_box.rejected.connect(self.reject)
|
||||||
self.clear_button.clicked.connect(self.clear_button_pushed)
|
self.clear_button.clicked.connect(self.clear_button_pushed)
|
||||||
|
self.advanced_clear_button.clicked.connect(self.clear_advanced)
|
||||||
self.adv_search_used = False
|
self.adv_search_used = False
|
||||||
self.mc = ''
|
self.mc = ''
|
||||||
|
|
||||||
@ -56,6 +57,12 @@ class AdvSearchBuilderDialog(QDialog, Ui_Dialog):
|
|||||||
self.download_combo.setCurrentIndex(0)
|
self.download_combo.setCurrentIndex(0)
|
||||||
self.affiliate_combo.setCurrentIndex(0)
|
self.affiliate_combo.setCurrentIndex(0)
|
||||||
|
|
||||||
|
def clear_advanced(self):
|
||||||
|
self.all.setText('')
|
||||||
|
self.phrase.setText('')
|
||||||
|
self.any.setText('')
|
||||||
|
self.none.setText('')
|
||||||
|
|
||||||
def tokens(self, raw):
|
def tokens(self, raw):
|
||||||
phrases = re.findall(r'\s*".*?"\s*', raw)
|
phrases = re.findall(r'\s*".*?"\s*', raw)
|
||||||
for f in phrases:
|
for f in phrases:
|
||||||
|
@ -56,8 +56,8 @@
|
|||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>A&dvanced search</string>
|
<string>A&dvanced search</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Find entries that have...</string>
|
<string>Find entries that have...</string>
|
||||||
@ -117,7 +117,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>But don't show entries that have...</string>
|
<string>But don't show entries that have...</string>
|
||||||
@ -159,15 +159,52 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
<property name="sizeHint" stdset="0">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="advanced_clear_button">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Clear</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -24,6 +24,7 @@ class AdvSearchBuilderDialog(QDialog, Ui_Dialog):
|
|||||||
self.tab_2_button_box.accepted.connect(self.accept)
|
self.tab_2_button_box.accepted.connect(self.accept)
|
||||||
self.tab_2_button_box.rejected.connect(self.reject)
|
self.tab_2_button_box.rejected.connect(self.reject)
|
||||||
self.clear_button.clicked.connect(self.clear_button_pushed)
|
self.clear_button.clicked.connect(self.clear_button_pushed)
|
||||||
|
self.advanced_clear_button.clicked.connect(self.clear_advanced)
|
||||||
self.adv_search_used = False
|
self.adv_search_used = False
|
||||||
self.mc = ''
|
self.mc = ''
|
||||||
|
|
||||||
@ -46,6 +47,12 @@ class AdvSearchBuilderDialog(QDialog, Ui_Dialog):
|
|||||||
self.author_box.setText('')
|
self.author_box.setText('')
|
||||||
self.format_box.setText('')
|
self.format_box.setText('')
|
||||||
|
|
||||||
|
def clear_advanced(self):
|
||||||
|
self.all.setText('')
|
||||||
|
self.phrase.setText('')
|
||||||
|
self.any.setText('')
|
||||||
|
self.none.setText('')
|
||||||
|
|
||||||
def tokens(self, raw):
|
def tokens(self, raw):
|
||||||
phrases = re.findall(r'\s*".*?"\s*', raw)
|
phrases = re.findall(r'\s*".*?"\s*', raw)
|
||||||
for f in phrases:
|
for f in phrases:
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<string>Advanced search</string>
|
<string>Advanced search</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset>
|
<iconset resource="../../../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/search.png</normaloff>:/images/search.png</iconset>
|
<normaloff>:/images/search.png</normaloff>:/images/search.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
@ -47,7 +47,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="1" column="0" rowspan="2" colspan="2">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
@ -56,8 +56,8 @@
|
|||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>A&dvanced search</string>
|
<string>A&dvanced search</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Find entries that have...</string>
|
<string>Find entries that have...</string>
|
||||||
@ -117,10 +117,10 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>But don't show entries that have...</string>
|
<string>But don't show entries that have...</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
@ -149,7 +149,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>See the <a href="https://manual.calibre-ebook.com/gui.html#the-search-interface">User Manual</a> for more help</string>
|
<string>See the <a href="https://manual.calibre-ebook.com/gui.html#the-search-interface">User Manual</a> for more help</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -159,7 +159,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item>
|
||||||
<spacer name="verticalSpacer_2">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -172,15 +172,39 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
<property name="orientation">
|
<item>
|
||||||
<enum>Qt::Horizontal</enum>
|
<widget class="QPushButton" name="advanced_clear_button">
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="standardButtons">
|
<string>&Clear</string>
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -274,19 +298,6 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
|
||||||
<spacer name="verticalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
@ -311,7 +322,7 @@
|
|||||||
<tabstop>matchkind</tabstop>
|
<tabstop>matchkind</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../../resources/images.qrc"/>
|
<include location="../../../../../../resources/images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
@ -321,8 +332,8 @@
|
|||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>248</x>
|
<x>259</x>
|
||||||
<y>254</y>
|
<y>451</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>157</x>
|
<x>157</x>
|
||||||
@ -337,8 +348,8 @@
|
|||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>316</x>
|
<x>327</x>
|
||||||
<y>260</y>
|
<y>451</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>286</x>
|
<x>286</x>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user