Compare commits

...

2 Commits

Author SHA1 Message Date
Dirk Hohndel
1c5d83d3c9 mobile/UI: show result of manual sync
Since we no longer show the noisy git updates to the user, it has become
harder for them to know whether a sync to the cloud was successful.
Since a manual sync will never show the new 'what did you change and
here's how you undo it' notification, it seems easy enough to simply
show a status update.

This adds a passive notification with no action button after the user
either uses the main menu or pulling down on the dive list in order to
trigger a manual sync.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-23 10:57:11 -08:00
Dirk Hohndel
283aa082de 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 <dirk@hohndel.org>
2021-01-23 10:57:11 -08:00
6 changed files with 33 additions and 1 deletions

View File

@ -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 &gt)
{
if (!m_trackers.keys().contains(gt.when)) {

View File

@ -37,7 +37,7 @@ public:
bool hasLocationsSource();
QString currentPosition();
void setLogCallBack(void (*showMsgCB)(const char *msg));
QString getFixString();
QMap<qint64, gpsTracker> currentGPSInfo() const;
private:

View File

@ -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)

View File

@ -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")

View File

@ -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";

View File

@ -217,6 +217,7 @@ public slots:
void clearGpsData();
QString getCombinedLogs();
void copyAppLogToClipboard();
void copyGpsFixesToClipboard();
bool createSupportEmail();
void finishSetup();
QString getNumber(const QString& diveId);