diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp index 012b24403..72f0bb557 100644 --- a/core/gpslocation.cpp +++ b/core/gpslocation.cpp @@ -321,6 +321,16 @@ void GpsLocation::loadFromStorage() } } +QString GpsLocation::getFixString() +{ + // only used for debugging + QString res; + struct gpsTracker gpsEntry; + foreach (gpsEntry, m_trackers.values()) + res += QString("%1: %2; %3 ; \"%4\"\n").arg(gpsEntry.when).arg(gpsEntry.location.lat.udeg).arg(gpsEntry.location.lon.udeg).arg(gpsEntry.name); + return res; +} + void GpsLocation::replaceFixToStorage(gpsTracker >) { if (!m_trackers.keys().contains(gt.when)) { diff --git a/core/gpslocation.h b/core/gpslocation.h index ea3373d3b..eb61fe7ef 100644 --- a/core/gpslocation.h +++ b/core/gpslocation.h @@ -37,7 +37,7 @@ class GpsLocation : public QObject { bool hasLocationsSource(); QString currentPosition(); void setLogCallBack(void (*showMsgCB)(const char *msg)); - + QString getFixString(); QMap currentGPSInfo() const; private: diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 7c04deddb..fe9d7ddb1 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -26,6 +26,7 @@ Kirigami.ScrollablePage { if (Backend.cloud_verification_status === Enums.CS_VERIFIED) { detailsWindow.endEditMode() manager.saveChangesCloud(true) + showPassiveNotification(qsTr("Completed manual sync with cloud\n") + manager.syncState) refreshing = false } else { manager.appendTextToLog("sync with cloud storage requested, but credentialStatus is " + Backend.cloud_verification_status) diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 2ef9a4332..f16e85808 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -361,6 +361,7 @@ Kirigami.ApplicationWindow { globalDrawer.close() detailsWindow.endEditMode() manager.saveChangesCloud(true); + showPassiveNotification(qsTr("Completed manual sync with cloud\n") + manager.syncState) globalDrawer.close() } } @@ -605,6 +606,15 @@ if you have network connectivity and want to sync your data to cloud storage."), } } + Kirigami.Action { + text: qsTr("Copy GPS to clipboard") + onTriggered: { + globalDrawer.close() + manager.copyGpsFixesToClipboard() + } + + } + /* disable for now Kirigami.Action { text: qsTr("Dive planner") diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index fddc61d3a..878d4618c 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -492,6 +492,16 @@ void QMLManager::copyAppLogToClipboard() QApplication::clipboard()->setText(getCombinedLogs(), QClipboard::Clipboard); } +void QMLManager::copyGpsFixesToClipboard() +{ + // This of course creates a potential privacy issue, so let's be clear about that + QString gpsWarning("Sending these GPS data to someone exposes your location history; "); + gpsWarning += "they can, however, be helpful when debugging problems with the app. "; + gpsWarning += "Please consider carefully where you are seninding these data.\n\n"; + gpsWarning += GpsLocation::instance()->getFixString(); + QApplication::clipboard()->setText(gpsWarning, QClipboard::Clipboard); +} + bool QMLManager::createSupportEmail() { QString mailToLink = "mailto:in-app-support@subsurface-divelog.org?subject=Subsurface-mobile support request"; diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 9db2f991c..e403a6f46 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -217,6 +217,7 @@ public slots: void clearGpsData(); QString getCombinedLogs(); void copyAppLogToClipboard(); + void copyGpsFixesToClipboard(); bool createSupportEmail(); void finishSetup(); QString getNumber(const QString& diveId);