From 2bd4c6f6ec8bdd65af28a5158a456f03171d2c0a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 16 Feb 2020 22:31:06 +0100 Subject: 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 --- desktop-widgets/filterwidget2.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'desktop-widgets') 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::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(); -- cgit v1.2.3-70-g09d2