From ee7e5113723cf40d598ed30a6f8409b5d4504422 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 26 May 2015 17:36:06 -0300 Subject: Create signals/slots for filtering the dive_site, The dive site management requires that we filter all the dives that are on the current dive_site, this is the preparatory work for that. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/filtermodels.cpp | 14 +++++++++++++- qt-ui/filtermodels.h | 4 ++++ qt-ui/locationinformation.h | 5 +++-- 3 files changed, 20 insertions(+), 3 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/filtermodels.cpp b/qt-ui/filtermodels.cpp index be26a253b..aba480dd9 100644 --- a/qt-ui/filtermodels.cpp +++ b/qt-ui/filtermodels.cpp @@ -292,7 +292,7 @@ void LocationFilterModel::repopulate() anyChecked = false; } -MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent), justCleared(false) +MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent), justCleared(false), curr_dive_site(NULL) { } @@ -388,3 +388,15 @@ void MultiFilterSortModel::clearFilter() justCleared = false; myInvalidate(); } + +void MultiFilterSortModel::startFilterDiveSite(int32_t uuid) +{ + curr_dive_site = get_dive_site_by_uuid(uuid); + myInvalidate(); +} + +void MultiFilterSortModel::stopFilterDiveSite() +{ + curr_dive_site = NULL; + myInvalidate(); +} diff --git a/qt-ui/filtermodels.h b/qt-ui/filtermodels.h index 9d8724173..f9eb700dd 100644 --- a/qt-ui/filtermodels.h +++ b/qt-ui/filtermodels.h @@ -93,12 +93,16 @@ public slots: void myInvalidate(); void clearFilter(); + void startFilterDiveSite(int32_t uuid); + void stopFilterDiveSite(); + signals: void filterFinished(); private: MultiFilterSortModel(QObject *parent = 0); QList models; bool justCleared; + struct dive_site *curr_dive_site; }; #endif diff --git a/qt-ui/locationinformation.h b/qt-ui/locationinformation.h index 41f626b3f..49db2ce47 100644 --- a/qt-ui/locationinformation.h +++ b/qt-ui/locationinformation.h @@ -22,7 +22,7 @@ public: LocationInformationWidget(QWidget *parent = 0); protected: void showEvent(QShowEvent *); -\ + public slots: void acceptChanges(); void rejectChanges(); @@ -40,7 +40,8 @@ public slots: signals: void informationManagementEnded(); void coordinatesChanged(); - + void startFilterDiveSite(uint32_t uuid); + void stopFilterFiveSite(); private: struct dive_site *currentDs; Ui::LocationInformation ui; -- cgit v1.2.3-70-g09d2