From 64dea827bdeddf6b6c2e59295bd7bd69c9a147e4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 22 Jan 2021 17:09:18 -0800 Subject: mobile/debugging: copy GPS fixes to clipboard The goal is to enable a user experiencing crashes when applying GPS data to their dive log to make all necessary data available to the developers. Hopefully the clipboard is large enough to hold all the data. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/main.qml | 9 +++++++++ mobile-widgets/qmlmanager.cpp | 10 ++++++++++ mobile-widgets/qmlmanager.h | 1 + 3 files changed, 20 insertions(+) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 2ef9a4332..3dc6cbd85 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -605,6 +605,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); -- cgit v1.2.3-70-g09d2