diff options
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/qml/DiveDetails.qml | 1 | ||||
-rw-r--r-- | qt-mobile/qml/DiveDetailsView.qml | 22 | ||||
-rw-r--r-- | qt-mobile/qml/DiveList.qml | 1 | ||||
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 10 | ||||
-rw-r--r-- | qt-mobile/qmlmanager.h | 1 |
5 files changed, 35 insertions, 0 deletions
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml index b815a04cc..7958871fe 100644 --- a/qt-mobile/qml/DiveDetails.qml +++ b/qt-mobile/qml/DiveDetails.qml @@ -13,6 +13,7 @@ MobileComponents.Page { flickable: flick property string location + property string gps property string depth property string dive_id property string diveNumber diff --git a/qt-mobile/qml/DiveDetailsView.qml b/qt-mobile/qml/DiveDetailsView.qml index ce7f2485e..f2eb66407 100644 --- a/qt-mobile/qml/DiveDetailsView.qml +++ b/qt-mobile/qml/DiveDetailsView.qml @@ -1,4 +1,7 @@ import QtQuick 2.3 +/* +import QtWebView 1.0 +*/ import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.2 import QtQuick.Dialogs 1.2 @@ -29,7 +32,26 @@ GridLayout { text: location Layout.columnSpan: 4 wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere + MouseArea { + anchors.fill: parent + onClicked: { + if (gps !== "") + manager.showMap(gps) + } + } + } + /* + Rectangle { + id: mapView + width: parent.width + height: parents.width * 0.7 + WebView { + id: webView + anchors.fill: parent + url: "http://www.google.com" + } } +*/ MobileComponents.Label { Layout.alignment: Qt.AlignRight id: dateLabel diff --git a/qt-mobile/qml/DiveList.qml b/qt-mobile/qml/DiveList.qml index 12c36b0c8..abf60036f 100644 --- a/qt-mobile/qml/DiveList.qml +++ b/qt-mobile/qml/DiveList.qml @@ -28,6 +28,7 @@ MobileComponents.Page { diveListView.currentIndex = model.index detailsWindow.width = parent.width detailsWindow.location = location + detailsWindow.gps = gps detailsWindow.dive_id = id detailsWindow.diveNumber = diveNumber detailsWindow.duration = duration diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 6ad52c419..0897dcff8 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -4,6 +4,7 @@ #include <QDebug> #include <QNetworkAccessManager> #include <QAuthenticator> +#include <QDesktopServices> #include "qt-models/divelistmodel.h" #include "divelist.h" @@ -467,3 +468,12 @@ void QMLManager::setStartPageText(QString text) m_startPageText = text; emit startPageTextChanged(); } + +void QMLManager::showMap(QString location) +{ + if (!location.isEmpty()) { + QString link = QString("https://maps.googleapis.com/maps/api/staticmap?center=%1&zoom=15&size=600x400&maptype=satellite&markers=color:red|%2") + .arg(location).arg(location); + QDesktopServices::openUrl(link); + } +} diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h index e9b0d27e7..f6ed60aed 100644 --- a/qt-mobile/qmlmanager.h +++ b/qt-mobile/qmlmanager.h @@ -78,6 +78,7 @@ public slots: void sendGpsData(); void clearGpsData(); void finishSetup(); + void showMap(QString location); private: QString m_cloudUserName; |