summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-07-30 22:10:01 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-31 10:29:17 -0700
commitf8b64da1365e2919adacc5f928358b474844ebdc (patch)
treeb738c5ad0c6a20da03530bda30a7622afe60beb6 /qt-ui
parent2faff7ceaea61a6b9dc6b53fbc52169671a27874 (diff)
downloadsubsurface-f8b64da1365e2919adacc5f928358b474844ebdc.tar.gz
Change the coordinates via globe.
Now when the user selects the dive site edit, the globe will enter in edit mode too. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/locationinformation.cpp20
-rw-r--r--qt-ui/locationinformation.h3
2 files changed, 16 insertions, 7 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index aec20f936..721e831a6 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -26,6 +26,14 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo
connect(this, SIGNAL(startFilterDiveSite(uint32_t)), MultiFilterSortModel::instance(), SLOT(startFilterDiveSite(uint32_t)));
connect(this, SIGNAL(stopFilterDiveSite()), MultiFilterSortModel::instance(), SLOT(stopFilterDiveSite()));
+
+ // Globe Management Code.
+ connect(this, &LocationInformationWidget::requestCoordinates,
+ GlobeGPS::instance(), &GlobeGPS::prepareForGetDiveCoordinates);
+ connect(this, &LocationInformationWidget::endRequestCoordinates,
+ GlobeGPS::instance(), &GlobeGPS::endGetDiveCoordinates);
+ connect(GlobeGPS::instance(), &GlobeGPS::coordinatesChanged,
+ this, &LocationInformationWidget::updateGpsCoordinates);
}
void LocationInformationWidget::updateLabels()
@@ -85,18 +93,15 @@ void LocationInformationWidget::acceptChanges()
mark_divelist_changed(true);
resetState();
+ emit endRequestCoordinates();
emit endEditDiveSite();
emit coordinatesChanged();
}
-void LocationInformationWidget::on_btnPickCoordinates_clicked()
-{
- qDebug() << "Sim, Deve haver o perdao";
-}
-
void LocationInformationWidget::rejectChanges()
{
resetState();
+ emit endRequestCoordinates();
emit stopFilterDiveSite();
emit endEditDiveSite();
emit coordinatesChanged();
@@ -104,9 +109,12 @@ void LocationInformationWidget::rejectChanges()
void LocationInformationWidget::showEvent(QShowEvent *ev)
{
- if (displayed_dive_site.uuid)
+ if (displayed_dive_site.uuid) {
updateLabels();
emit startFilterDiveSite(displayed_dive_site.uuid);
+ }
+ emit requestCoordinates();
+
QGroupBox::showEvent(ev);
}
diff --git a/qt-ui/locationinformation.h b/qt-ui/locationinformation.h
index ef28ddafd..09814e9c0 100644
--- a/qt-ui/locationinformation.h
+++ b/qt-ui/locationinformation.h
@@ -24,7 +24,6 @@ public slots:
void on_diveSiteDescription_textChanged(const QString& text);
void on_diveSiteName_textChanged(const QString& text);
void on_diveSiteNotes_textChanged();
- void on_btnPickCoordinates_clicked();
private slots:
void updateLabels();
signals:
@@ -33,6 +32,8 @@ signals:
void coordinatesChanged();
void startFilterDiveSite(uint32_t uuid);
void stopFilterDiveSite();
+ void requestCoordinates();
+ void endRequestCoordinates();
private:
Ui::LocationInformation ui;
bool modified;