summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index be4dc4ec3..6e5357cdc 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -733,6 +733,7 @@ void QMLManager::loadDivesWithValidCredentials()
appendTextToLog(QStringLiteral("%1 dives loaded after importing nocloud local storage").arg(dive_table.nr));
noCloudToCloud = false;
mark_divelist_changed(true);
+ emit syncStateChanged();
saveChangesLocal();
if (git_local_only == false) {
appendTextToLog(QStringLiteral("taking things back offline now that storage is synced"));
@@ -1292,6 +1293,7 @@ void QMLManager::changesNeedSaving()
// on iOS
// on all other platforms we just save the changes and be done with it
mark_divelist_changed(true);
+ emit syncStateChanged();
#if defined(Q_OS_IOS)
saveChangesLocal();
#else
@@ -2251,4 +2253,15 @@ QStringList QMLManager::cloudCacheList() const
void QMLManager::updateHaveLocalChanges(bool status)
{
localChanges = status;
+ emit syncStateChanged();
+}
+
+// show the state of the dive list
+QString QMLManager::getSyncState() const
+{
+ if (unsavedChanges())
+ return tr("(unsaved changes in memory)");
+ if (localChanges)
+ return tr("(changes synced locally)");
+ return tr("(synced with cloud)");
}