diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-02-16 22:31:06 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-01 10:21:44 -0800 |
commit | 2bd4c6f6ec8bdd65af28a5158a456f03171d2c0a (patch) | |
tree | 8ca0111d6c93c33394a40e2aee8a66f399e91f40 /desktop-widgets | |
parent | 68d6a75ea38932a4dbd6db4a2dc53e520f32b7e1 (diff) | |
download | subsurface-2bd4c6f6ec8bdd65af28a5158a456f03171d2c0a.tar.gz |
filter: connect fulltext filter to frontend
There are now three filter modes:
1) Dive site
2) Fulltext
3) Normal
When doing a fulltext search, get the dives that match the
fulltext filter and then apply the other filters on that list.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/filterwidget2.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp index 534cb4594..0e44a6bde 100644 --- a/desktop-widgets/filterwidget2.cpp +++ b/desktop-widgets/filterwidget2.cpp @@ -78,6 +78,12 @@ FilterWidget2::FilterWidget2(QWidget* parent) : connect(ui.toTime, &QDateTimeEdit::timeChanged, this, &FilterWidget2::updateFilter); + connect(ui.fullText, &QLineEdit::textChanged, + this, &FilterWidget2::updateFilter); + + connect(ui.fulltextStringMode, QOverload<int>::of(&QComboBox::currentIndexChanged), + this, &FilterWidget2::updateFilter); + connect(ui.tags, &QLineEdit::textChanged, this, &FilterWidget2::updateFilter); @@ -170,6 +176,7 @@ void FilterWidget2::clearFilter() ui.suitMode->setCurrentIndex((int)filterData.suitMode); ui.dnotesMode->setCurrentIndex((int)filterData.dnotesMode); ui.equipmentMode->setCurrentIndex((int)filterData.equipmentMode); + ui.fulltextStringMode->setCurrentIndex((int)filterData.fulltextStringMode); ui.tagsStringMode->setCurrentIndex((int)filterData.tagsStringMode); ui.peopleStringMode->setCurrentIndex((int)filterData.peopleStringMode); ui.locationStringMode->setCurrentIndex((int)filterData.locationStringMode); @@ -214,6 +221,7 @@ void FilterWidget2::updateFilter() filterData.fromTime = ui.fromTime->time(); filterData.toDate = ui.toDate->dateTime(); filterData.toTime = ui.toTime->time(); + filterData.fullText = ui.fullText->text(); filterData.tags = ui.tags->text().split(",", QString::SkipEmptyParts); filterData.people = ui.people->text().split(",", QString::SkipEmptyParts); filterData.location = ui.location->text().split(",", QString::SkipEmptyParts); @@ -226,6 +234,7 @@ void FilterWidget2::updateFilter() filterData.suitMode = (FilterData::Mode)ui.suitMode->currentIndex(); filterData.dnotesMode = (FilterData::Mode)ui.dnotesMode->currentIndex(); filterData.equipmentMode = (FilterData::Mode)ui.equipmentMode->currentIndex(); + filterData.fulltextStringMode = (StringFilterMode)ui.fulltextStringMode->currentIndex(); filterData.tagsStringMode = (StringFilterMode)ui.tagsStringMode->currentIndex(); filterData.peopleStringMode = (StringFilterMode)ui.peopleStringMode->currentIndex(); filterData.locationStringMode = (StringFilterMode)ui.locationStringMode->currentIndex(); |