summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-08-25 18:45:29 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-25 17:58:59 -0700
commit03702edf87c7a8787302a08bcf1f051223f6accb (patch)
tree181d8018b87f346d5db37ba64dab03da1dbbc3f5 /qt-ui
parentaaa70ff56e2b5891f1c8241bf10a8e236bf86108 (diff)
downloadsubsurface-03702edf87c7a8787302a08bcf1f051223f6accb.tar.gz
Get taxonomy from edit dive site widget
Moved the get taxonomy button from the maintab to the edit dive site widget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/locationInformation.ui53
-rw-r--r--qt-ui/locationinformation.cpp11
-rw-r--r--qt-ui/locationinformation.h1
-rw-r--r--qt-ui/maintab.cpp7
-rw-r--r--qt-ui/maintab.h1
5 files changed, 45 insertions, 28 deletions
diff --git a/qt-ui/locationInformation.ui b/qt-ui/locationInformation.ui
index ad33b2a90..56e8b0e35 100644
--- a/qt-ui/locationInformation.ui
+++ b/qt-ui/locationInformation.ui
@@ -18,24 +18,11 @@
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
- <number>-1</number>
+ <number>6</number>
</property>
<property name="verticalSpacing">
<number>4</number>
</property>
- <item row="0" column="0" colspan="2">
- <widget class="KMessageWidget" name="diveSiteMessage" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="diveSiteName"/>
- </item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
@@ -70,6 +57,9 @@
</property>
</widget>
</item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="diveSiteCoordinates"/>
+ </item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
@@ -77,15 +67,36 @@
</property>
</widget>
</item>
- <item row="4" column="1" rowspan="2">
- <widget class="QPlainTextEdit" name="diveSiteNotes"/>
+ <item row="2" column="2">
+ <widget class="QToolButton" name="geoCodeButton">
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../subsurface.qrc">
+ <normaloff>:/satellite</normaloff>:/satellite</iconset>
+ </property>
+ </widget>
</item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="diveSiteCoordinates"/>
+ <item row="1" column="1" colspan="2">
+ <widget class="QLineEdit" name="diveSiteName"/>
</item>
- <item row="3" column="1">
+ <item row="3" column="1" colspan="2">
<widget class="QLineEdit" name="diveSiteDescription"/>
</item>
+ <item row="4" column="1" rowspan="2" colspan="2">
+ <widget class="QPlainTextEdit" name="diveSiteNotes"/>
+ </item>
+ <item row="0" column="0" colspan="3">
+ <widget class="KMessageWidget" name="diveSiteMessage" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<customwidgets>
@@ -96,6 +107,8 @@
<container>1</container>
</customwidget>
</customwidgets>
- <resources/>
+ <resources>
+ <include location="../subsurface.qrc"/>
+ </resources>
<connections/>
</ui>
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index d8d027a34..2a52d6d7f 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -6,6 +6,8 @@
#include "globe.h"
#include "filtermodels.h"
#include "divelocationmodel.h"
+#include "divesitehelpers.h"
+
#include <QDebug>
#include <QShowEvent>
@@ -26,6 +28,7 @@ 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()));
+ connect(ui.geoCodeButton, SIGNAL(clicked()), this, SLOT(reverseGeocode()));
#ifndef NO_MARBLE
// Globe Management Code.
@@ -248,3 +251,11 @@ void LocationManagementEditHelper::resetDiveSiteUuid() {
uint32_t LocationManagementEditHelper::diveSiteUuid() const {
return last_uuid;
}
+
+void LocationInformationWidget::reverseGeocode()
+{
+ qDebug() << "Chamou";
+ ReverseGeoLookupThread *geoLookup = ReverseGeoLookupThread::instance();
+ geoLookup->lookup(&displayed_dive_site);
+ updateLabels();
+}
diff --git a/qt-ui/locationinformation.h b/qt-ui/locationinformation.h
index 0a2f66262..445fd87d4 100644
--- a/qt-ui/locationinformation.h
+++ b/qt-ui/locationinformation.h
@@ -24,6 +24,7 @@ public slots:
void on_diveSiteDescription_textChanged(const QString& text);
void on_diveSiteName_textChanged(const QString& text);
void on_diveSiteNotes_textChanged();
+ void reverseGeocode();
private slots:
void updateLabels();
signals:
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index dc9ec9441..ec25fe36e 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -1656,10 +1656,3 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what)
weightModel->changed = true;
}
}
-
-void MainTab::reverseGeocode()
-{
- ReverseGeoLookupThread *geoLookup = ReverseGeoLookupThread::instance();
- geoLookup->lookup(&displayed_dive_site);
- updateDiveInfo();
-}
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index 4c64b0b15..332285949 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -99,7 +99,6 @@ slots:
void enableGeoLookupEdition();
void disableGeoLookupEdition();
void setCurrentLocationIndex();
- void reverseGeocode();
private:
Ui::MainTab ui;
WeightModel *weightModel;