GUI split advanced search dialog in 2 tabs and add/adjust date and size filtering

This commit is contained in:
"Jean-Francois Dockes ext:(%22) 2012-03-13 16:33:59 +01:00
parent 9ff88adf22
commit 382cdc9f8a
3 changed files with 576 additions and 440 deletions

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>545</width> <width>544</width>
<height>537</height> <height>441</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -16,446 +16,537 @@
<property name="sizeGripEnabled"> <property name="sizeGripEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QHBoxLayout"> <widget class="QTabWidget" name="tabWidget">
<item> <property name="currentIndex">
<layout class="QVBoxLayout"> <number>0</number>
<property name="spacing"> </property>
<number>2</number> <widget class="QWidget" name="tab_5">
</property> <attribute name="title">
<string>Find</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QLabel" name="textLabel2"> <layout class="QHBoxLayout">
<property name="sizePolicy"> <item>
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <layout class="QVBoxLayout">
<horstretch>0</horstretch> <property name="spacing">
<verstretch>0</verstretch> <number>2</number>
</sizepolicy> </property>
</property> <item>
<property name="toolTip"> <widget class="QLabel" name="textLabel2">
<string>All non empty fields on the right will be combined with AND (&quot;All clauses&quot; choice) or OR (&quot;Any clause&quot; choice) conjunctions. &lt;br&gt;&quot;Any&quot; &quot;All&quot; and &quot;None&quot; field types can accept a mix of simple words, and phrases enclosed in double quotes.&lt;br&gt;Fields with no data are ignored.</string> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<property name="frameShape"> <horstretch>0</horstretch>
<enum>QFrame::NoFrame</enum> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="frameShadow"> </property>
<enum>QFrame::Plain</enum> <property name="toolTip">
</property> <string>All non empty fields on the right will be combined with AND (&quot;All clauses&quot; choice) or OR (&quot;Any clause&quot; choice) conjunctions. &lt;br&gt;&quot;Any&quot; &quot;All&quot; and &quot;None&quot; field types can accept a mix of simple words, and phrases enclosed in double quotes.&lt;br&gt;Fields with no data are ignored.</string>
<property name="text"> </property>
<string>Search for &lt;br&gt;documents&lt;br&gt;satisfying:</string> <property name="frameShape">
</property> <enum>QFrame::NoFrame</enum>
<property name="wordWrap"> </property>
<bool>false</bool> <property name="frameShadow">
</property> <enum>QFrame::Plain</enum>
<property name="margin"> </property>
<number>4</number> <property name="text">
</property> <string>Search for &lt;br&gt;documents&lt;br&gt;satisfying:</string>
</widget> </property>
</item> <property name="wordWrap">
<item> <bool>false</bool>
<widget class="QComboBox" name="conjunctCMB"> </property>
<property name="sizePolicy"> <property name="margin">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <number>4</number>
<horstretch>8</horstretch> </property>
<verstretch>0</verstretch> </widget>
</sizepolicy> </item>
</property> <item>
<property name="toolTip"> <widget class="QComboBox" name="conjunctCMB">
<string>All non empty fields on the right will be combined with AND (&quot;All clauses&quot; choice) or OR (&quot;Any clause&quot; choice) conjunctions. &lt;br&gt;&quot;Any&quot; &quot;All&quot; and &quot;None&quot; field types can accept a mix of simple words, and phrases enclosed in double quotes.&lt;br&gt;Fields with no data are ignored.</string> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</widget> <horstretch>8</horstretch>
</item> <verstretch>0</verstretch>
<item> </sizepolicy>
<spacer name="spacer2"> </property>
<property name="orientation"> <property name="toolTip">
<enum>Qt::Vertical</enum> <string>All non empty fields on the right will be combined with AND (&quot;All clauses&quot; choice) or OR (&quot;Any clause&quot; choice) conjunctions. &lt;br&gt;&quot;Any&quot; &quot;All&quot; and &quot;None&quot; field types can accept a mix of simple words, and phrases enclosed in double quotes.&lt;br&gt;Fields with no data are ignored.</string>
</property> </property>
<property name="sizeType"> </widget>
<enum>QSizePolicy::Expanding</enum> </item>
</property> <item>
<property name="sizeHint" stdset="0"> <spacer name="spacer2">
<size> <property name="orientation">
<width>0</width> <enum>Qt::Vertical</enum>
<height>0</height> </property>
</size> <property name="sizeType">
</property> <enum>QSizePolicy::Expanding</enum>
</spacer> </property>
</item> <property name="sizeHint" stdset="0">
<item> <size>
<widget class="QPushButton" name="delClausePB"> <width>0</width>
<property name="sizePolicy"> <height>0</height>
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> </size>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> </spacer>
</sizepolicy> </item>
</property> <item>
<property name="text"> <widget class="QPushButton" name="delClausePB">
<string>Delete clause</string> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<property name="autoDefault"> <horstretch>0</horstretch>
<bool>false</bool> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
</item> <property name="text">
<item> <string>Delete clause</string>
<widget class="QPushButton" name="addClausePB"> </property>
<property name="sizePolicy"> <property name="autoDefault">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <bool>false</bool>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> </widget>
</sizepolicy> </item>
</property> <item>
<property name="text"> <widget class="QPushButton" name="addClausePB">
<string>Add clause</string> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<property name="autoDefault"> <horstretch>0</horstretch>
<bool>false</bool> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
<property name="text">
<string>Add clause</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="clauseFRM">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>1</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="Line" name="clauseline">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</item>
<item>
<widget class="QFrame" name="clauseFRM">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>1</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="Line" name="clauseline">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line2">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="labelminsize">
<property name="toolTip">
<string>Minimum size. You can use k/K,m/M,g/G as multipliers</string>
</property>
<property name="text">
<string>Min. Size</string>
</property>
</widget> </widget>
</item> <widget class="QWidget" name="tab_6">
<item> <attribute name="title">
<widget class="QLineEdit" name="minSizeLE"/> <string>Filter</string>
</item> </attribute>
<item> <layout class="QVBoxLayout" name="verticalLayout_5">
<widget class="QLabel" name="labelmaxsize"> <item>
<property name="toolTip"> <layout class="QVBoxLayout" name="verticalLayout_4">
<string>Maximum size. You can use k/K,m/M,g/G as multipliers</string> <item>
</property> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="text"> <item>
<string>Max. Size</string> <widget class="QCheckBox" name="filterDatesCB">
</property> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Check this to enable filtering on dates</string>
</property>
<property name="text">
<string>Filter dates</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>From</string>
</property>
</widget>
</item>
<item>
<widget class="QDateEdit" name="minDateDTE">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>To</string>
</property>
</widget>
</item>
<item>
<widget class="QDateEdit" name="maxDateDTE">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line2">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="filterSizesCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Check this to enable filtering on sizes</string>
</property>
<property name="text">
<string>Filter sizes</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelminsize">
<property name="toolTip">
<string>Minimum size. You can use k/K,m/M,g/G as multipliers</string>
</property>
<property name="text">
<string>Min. Size</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="minSizeLE">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelmaxsize">
<property name="toolTip">
<string>Maximum size. You can use k/K,m/M,g/G as multipliers</string>
</property>
<property name="text">
<string>Max. Size</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="maxSizeLE">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line4">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QCheckBox" name="restrictFtCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Check this to enable filtering on file types</string>
</property>
<property name="text">
<string>Restrict file types</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="restrictCtCB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Check this to use file categories instead of raw mime types</string>
</property>
<property name="text">
<string>By categories</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveFileTypesPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Save as default</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel2_2">
<property name="text">
<string>Searched file types</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="yesFiltypsLB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="delAFiltypPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>All ----&gt;</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="delFiltypPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Sel -----&gt;</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addFiltypPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&lt;----- Sel</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addAFiltypPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&lt;----- All</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>Ignored file types</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="noFiltypsLB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line5">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout">
<item row="1" column="0">
<widget class="QComboBox" name="subtreeCMB">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>8</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Enter top directory for search</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="maxCount">
<number>20</number>
</property>
<property name="insertPolicy">
<enum>QComboBox::NoInsert</enum>
</property>
<property name="duplicatesEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="browsePB">
<property name="text">
<string>Browse</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Restrict results to files in subtree:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="direxclCB">
<property name="text">
<string>Invert</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget> </widget>
</item>
<item>
<widget class="QLineEdit" name="maxSizeLE"/>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line4">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QCheckBox" name="restrictFtCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Check this to enable filtering on file types</string>
</property>
<property name="text">
<string>Restrict file types</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="restrictCtCB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Check this to use file categories instead of raw mime types</string>
</property>
<property name="text">
<string>By categories</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveFileTypesPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Save as default</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel2_2">
<property name="text">
<string>Searched file types</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="yesFiltypsLB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="delAFiltypPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>All ----&gt;</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="delFiltypPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Sel -----&gt;</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addFiltypPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&lt;----- Sel</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addAFiltypPB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&lt;----- All</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>Ignored file types</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="noFiltypsLB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line5">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout">
<item row="1" column="0">
<widget class="QComboBox" name="subtreeCMB">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>8</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Enter top directory for search</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="maxCount">
<number>20</number>
</property>
<property name="insertPolicy">
<enum>QComboBox::NoInsert</enum>
</property>
<property name="duplicatesEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="browsePB">
<property name="text">
<string>Browse</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Restrict results to files in subtree:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="direxclCB">
<property name="text">
<string>Invert</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line1">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget> </widget>
</item> </item>
<item> <item>

View File

@ -62,6 +62,10 @@ void AdvSearch::init()
// signals and slots connections // signals and slots connections
connect(delFiltypPB, SIGNAL(clicked()), this, SLOT(delFiltypPB_clicked())); connect(delFiltypPB, SIGNAL(clicked()), this, SLOT(delFiltypPB_clicked()));
connect(searchPB, SIGNAL(clicked()), this, SLOT(runSearch())); connect(searchPB, SIGNAL(clicked()), this, SLOT(runSearch()));
connect(filterDatesCB, SIGNAL(toggled(bool)),
this, SLOT(filterDatesCB_toggled(bool)));
connect(filterSizesCB, SIGNAL(toggled(bool)),
this, SLOT(filterSizesCB_toggled(bool)));
connect(restrictFtCB, SIGNAL(toggled(bool)), connect(restrictFtCB, SIGNAL(toggled(bool)),
this, SLOT(restrictFtCB_toggled(bool))); this, SLOT(restrictFtCB_toggled(bool)));
connect(restrictCtCB, SIGNAL(toggled(bool)), connect(restrictCtCB, SIGNAL(toggled(bool)),
@ -101,6 +105,14 @@ void AdvSearch::init()
} }
(*m_clauseWins.begin())->wordsLE->setFocus(); (*m_clauseWins.begin())->wordsLE->setFocus();
// Initialize min/max mtime from extrem values in the index
int minyear, maxyear;
if (rcldb) {
rcldb->maxYearSpan(&minyear, &maxyear);
minDateDTE->setDate(QDate(minyear, 1, 1));
maxDateDTE->setDate(QDate(maxyear, 12, 31));
}
// Initialize lists of accepted and ignored mime types from config // Initialize lists of accepted and ignored mime types from config
// and settings // and settings
m_ignTypes = prefs.asearchIgnFilTyps; m_ignTypes = prefs.asearchIgnFilTyps;
@ -118,6 +130,10 @@ void AdvSearch::init()
// don't want to see it. // don't want to see it.
clauseline->close(); clauseline->close();
bool calpop = 0;
minDateDTE->setCalendarPopup(calpop);
maxDateDTE->setCalendarPopup(calpop);
// Translations for known categories // Translations for known categories
cat_translations[QString::fromUtf8("texts")] = tr("texts"); cat_translations[QString::fromUtf8("texts")] = tr("texts");
cat_rtranslations[tr("texts")] = QString::fromUtf8("texts"); cat_rtranslations[tr("texts")] = QString::fromUtf8("texts");
@ -248,6 +264,19 @@ void AdvSearch::restrictFtCB_toggled(bool on)
saveFileTypesPB->setEnabled(on); saveFileTypesPB->setEnabled(on);
} }
// Activate file type selection
void AdvSearch::filterSizesCB_toggled(bool on)
{
minSizeLE->setEnabled(on);
maxSizeLE->setEnabled(on);
}
// Activate file type selection
void AdvSearch::filterDatesCB_toggled(bool on)
{
minDateDTE->setEnabled(on);
maxDateDTE->setEnabled(on);
}
void AdvSearch::restrictCtCB_toggled(bool on) void AdvSearch::restrictCtCB_toggled(bool on)
{ {
m_ignByCats = on; m_ignByCats = on;
@ -367,10 +396,24 @@ void AdvSearch::runSearch()
} }
} }
size_t size = stringToSize(minSizeLE->text()); if (filterDatesCB->isChecked()) {
sdata->setMinSize(size); QDate mindate = minDateDTE->date();
size = stringToSize(maxSizeLE->text()); QDate maxdate = maxDateDTE->date();
sdata->setMaxSize(size); DateInterval di;
di.y1 = mindate.year();
di.m1 = mindate.month();
di.d1 = mindate.day();
di.y2 = maxdate.year();
di.m2 = maxdate.month();
di.d2 = maxdate.day();
sdata->setDateSpan(&di);
}
if (filterSizesCB->isChecked()) {
size_t size = stringToSize(minSizeLE->text());
sdata->setMinSize(size);
size = stringToSize(maxSizeLE->text());
sdata->setMaxSize(size);
}
if (!subtreeCMB->currentText().isEmpty()) { if (!subtreeCMB->currentText().isEmpty()) {
QString current = subtreeCMB->currentText(); QString current = subtreeCMB->currentText();

View File

@ -48,6 +48,8 @@ public slots:
virtual void addFiltypPB_clicked(); virtual void addFiltypPB_clicked();
virtual void addAFiltypPB_clicked(); virtual void addAFiltypPB_clicked();
virtual void guiListsToIgnTypes(); virtual void guiListsToIgnTypes();
virtual void filterDatesCB_toggled(bool);
virtual void filterSizesCB_toggled(bool);
virtual void restrictFtCB_toggled(bool); virtual void restrictFtCB_toggled(bool);
virtual void restrictCtCB_toggled(bool); virtual void restrictCtCB_toggled(bool);
virtual void runSearch(); virtual void runSearch();