From 2b1ffb3cc49566c8c138e1e536c8d1f25344e960 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 7 Jan 2016 21:37:36 -0800 Subject: QML UI: trigger download of GPS fixes Signed-off-by: Dirk Hohndel --- qt-mobile/qml/main.qml | 7 +++++++ qt-mobile/qmlmanager.cpp | 6 ++++++ qt-mobile/qmlmanager.h | 1 + 3 files changed, 14 insertions(+) diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml index c0d079106..b9a377c56 100644 --- a/qt-mobile/qml/main.qml +++ b/qt-mobile/qml/main.qml @@ -97,6 +97,13 @@ MobileComponents.ApplicationWindow { } } + Action { + text: "Download GPS data" + onTriggered: { + manager.downloadGpsData(); + } + } + Action { text: "Clear GPS cache" onTriggered: { diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 00f8b5d48..766498b17 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -501,6 +501,12 @@ void QMLManager::sendGpsData() locationProvider->uploadToServer(); } +void QMLManager::downloadGpsData() +{ + locationProvider->downloadFromServer(); + locationProvider->updateModel(); +} + void QMLManager::clearGpsData() { locationProvider->clearGpsData(); diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h index 24ca265e6..1dc13d669 100644 --- a/qt-mobile/qmlmanager.h +++ b/qt-mobile/qmlmanager.h @@ -77,6 +77,7 @@ public slots: QString addDive(); void applyGpsData(); void sendGpsData(); + void downloadGpsData(); void clearGpsData(); void finishSetup(); void showMap(QString location); -- cgit v1.2.3-70-g09d2