summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Willem Ferguson <willemferguson@zoology.up.ac.za>2019-02-28 15:35:34 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-02-28 15:45:42 -0800
commit10e7835290fef4275fb85e5efc9e37c06887b9e6 (patch)
tree8e0a413393fafb435c40546488c37f8fccd73f5c /desktop-widgets
parent01e8a54f5897c5aaab52f2bcd720f6350677fde5 (diff)
downloadsubsurface-10e7835290fef4275fb85e5efc9e37c06887b9e6.tar.gz
Filter panel: add suit and notes search fields
All the field in the Notes Panel of the main window are now supported. This needs some testing especially for the Notes field that may contain markup. It appears ok to me for single term searches. One would like to think about the default search option for the Notes. There is a vertical spacer in the Filter panel that I moved downwards and whose function I am not quite sure of. [Dirk Hohndel: small adjustments] Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/filterwidget2.cpp20
-rw-r--r--desktop-widgets/filterwidget2.ui62
2 files changed, 80 insertions, 2 deletions
diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp
index 5f78d6396..17e43f941 100644
--- a/desktop-widgets/filterwidget2.cpp
+++ b/desktop-widgets/filterwidget2.cpp
@@ -99,6 +99,18 @@ FilterWidget2::FilterWidget2(QWidget* parent) :
connect(ui.locationMode, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &FilterWidget2::updateFilter);
+ connect(ui.suit, &QLineEdit::textChanged,
+ this, &FilterWidget2::updateFilter);
+
+ connect(ui.suitMode, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &FilterWidget2::updateFilter);
+
+ connect(ui.dnotes, &QLineEdit::textChanged,
+ this, &FilterWidget2::updateFilter);
+
+ connect(ui.dnotesMode, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &FilterWidget2::updateFilter);
+
connect(ui.logged, &QCheckBox::stateChanged,
this, &FilterWidget2::updateLogged);
@@ -136,6 +148,8 @@ void FilterWidget2::clearFilter()
ui.planned->setChecked(filterData.planned);
ui.people->clear();
ui.location->clear();
+ ui.suit->clear();
+ ui.dnotes->clear();
ui.equipment->clear();
ui.tags->clear();
ui.fromDate->setDate(filterData.fromDate.date());
@@ -145,6 +159,8 @@ void FilterWidget2::clearFilter()
ui.tagsMode->setCurrentIndex((int)filterData.tagsMode);
ui.peopleMode->setCurrentIndex((int)filterData.peopleMode);
ui.locationMode->setCurrentIndex((int)filterData.locationMode);
+ ui.suitMode->setCurrentIndex((int)filterData.suitMode);
+ ui.dnotesMode->setCurrentIndex((int)filterData.dnotesMode);
ui.equipmentMode->setCurrentIndex((int)filterData.equipmentMode);
ignoreSignal = false;
@@ -187,10 +203,14 @@ void FilterWidget2::updateFilter()
filterData.tags = ui.tags->text().split(",", QString::SkipEmptyParts);
filterData.people = ui.people->text().split(",", QString::SkipEmptyParts);
filterData.location = ui.location->text().split(",", QString::SkipEmptyParts);
+ filterData.suit = ui.suit->text().split(",", QString::SkipEmptyParts);
+ filterData.dnotes = ui.dnotes->text().split(",", QString::SkipEmptyParts);
filterData.equipment = ui.equipment->text().split(",", QString::SkipEmptyParts);
filterData.tagsMode = (FilterData::Mode)ui.tagsMode->currentIndex();
filterData.peopleMode = (FilterData::Mode)ui.peopleMode->currentIndex();
filterData.locationMode = (FilterData::Mode)ui.locationMode->currentIndex();
+ filterData.suitMode = (FilterData::Mode)ui.suitMode->currentIndex();
+ filterData.dnotesMode = (FilterData::Mode)ui.dnotesMode->currentIndex();
filterData.equipmentMode = (FilterData::Mode)ui.equipmentMode->currentIndex();
filterData.logged = ui.logged->isChecked();
filterData.planned = ui.planned->isChecked();
diff --git a/desktop-widgets/filterwidget2.ui b/desktop-widgets/filterwidget2.ui
index eba4840e2..6b1318fc6 100644
--- a/desktop-widgets/filterwidget2.ui
+++ b/desktop-widgets/filterwidget2.ui
@@ -124,7 +124,13 @@
<item row="10" column="4" colspan="2">
<widget class="QLineEdit" name="location"/>
</item>
- <item row="11" column="0">
+ <item row="11" column="4" colspan="2">
+ <widget class="QLineEdit" name="suit"/>
+ </item>
+ <item row="12" column="4" colspan="2">
+ <widget class="QLineEdit" name="dnotes"/>
+ </item>
+ <item row="13" column="0">
<widget class="QLabel" name="labelEquipment">
<property name="text">
<string>Equipment</string>
@@ -164,6 +170,20 @@
</property>
</widget>
</item>
+ <item row="11" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>Suit</string>
+ </property>
+ </widget>
+ </item>
+ <item row="12" column="0">
+ <widget class="QLabel" name="label_19">
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ </widget>
+ </item>
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
@@ -349,6 +369,44 @@
</widget>
</item>
<item row="11" column="1" colspan="2">
+ <widget class="QComboBox" name="suitMode">
+ <item>
+ <property name="text">
+ <string>All of</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Any of</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>None of</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="12" column="1" colspan="2">
+ <widget class="QComboBox" name="dnotesMode">
+ <item>
+ <property name="text">
+ <string>All of</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Any of</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>None of</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="13" column="1" colspan="2">
<widget class="QComboBox" name="equipmentMode">
<item>
<property name="text">
@@ -367,7 +425,7 @@
</item>
</widget>
</item>
- <item row="12" column="0">
+ <item row="13" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>