summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-05-26 17:36:06 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-26 21:48:22 -0700
commitee7e5113723cf40d598ed30a6f8409b5d4504422 (patch)
tree7ebbf1c003e62d194f19f2200f675853efa1ac5b
parent785051c9dd0734acfdbb14fea558aa6e59917b68 (diff)
downloadsubsurface-ee7e5113723cf40d598ed30a6f8409b5d4504422.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/filtermodels.cpp14
-rw-r--r--qt-ui/filtermodels.h4
-rw-r--r--qt-ui/locationinformation.h5
3 files changed, 20 insertions, 3 deletions
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<MultiFilterInterface *> 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;