summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-01 12:37:50 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-02 06:50:50 -0700
commitd966fd2606e4ac0054eafd5af1171fc2a5c495b4 (patch)
tree5e6b7d9779a9d656b1a4e83fd9ac3fdc028df833 /qt-ui
parentbaf68868f5af3f3339504bceca0ca0d6676f8eee (diff)
downloadsubsurface-d966fd2606e4ac0054eafd5af1171fc2a5c495b4.tar.gz
Trigger reverse geo lookup by pressing the button
This may not be the best UI, but for now it works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp10
-rw-r--r--qt-ui/maintab.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 109c816c2..26f221883 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -59,6 +59,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
closeMessage();
connect(ui.addDiveSite, SIGNAL(clicked()), this, SLOT(showDiveSiteSimpleEdit()));
+ connect(ui.geocodeButton, SIGNAL(clicked()), this, SLOT(reverseGeocode()));
QAction *action = new QAction(tr("Apply changes"), this);
connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));
@@ -496,7 +497,7 @@ void MainTab::updateDiveInfo(bool clear)
if (!clear) {
struct dive_site *ds = get_dive_site_by_uuid(displayed_dive.dive_site_uuid);
- qDebug() << "showing dive site uuid" << ds->uuid << ds;
+ ui.geocodeButton->setVisible(ds && dive_site_has_gps_location(ds));
if (ds) {
// construct the location tags
QString locationTag;
@@ -1550,3 +1551,10 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what)
weightModel->changed = true;
}
}
+
+void MainTab::reverseGeocode()
+{
+ ReverseGeoLookupThread *geoLookup = ReverseGeoLookupThread::instance();
+ geoLookup->lookup(&displayed_dive_site);
+ MainWindow::instance()->information()->updateDiveInfo();
+}
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index 844710954..eac1521cc 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -97,6 +97,7 @@ slots:
void disableGeoLookupEdition();
void setCurrentLocationIndex();
void showDiveSiteSimpleEdit();
+ void reverseGeocode();
private:
Ui::MainTab ui;
WeightModel *weightModel;