summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qmlmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r--qt-mobile/qmlmanager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index ffd0a4e8c..d5a3c51ad 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -129,6 +129,7 @@ void QMLManager::loadDives()
DiveListModel::instance()->addDive(d);
}
appendTextToLog(QString("%1 dives loaded").arg(i));
+ setLoadFromCloud(true);
}
void QMLManager::commitChanges(QString diveId, QString suit, QString buddy, QString diveMaster, QString notes)
@@ -162,6 +163,10 @@ void QMLManager::commitChanges(QString diveId, QString suit, QString buddy, QStr
void QMLManager::saveChanges()
{
+ if (!loadFromCloud()) {
+ qmlUiShowMessage("Don't save dives without loading from the cloud, first.");
+ return;
+ }
qmlUiShowMessage("Saving dives.");
QString fileName;
if (getCloudURL(fileName)) {
@@ -287,3 +292,14 @@ void QMLManager::setTimeThreshold(int time)
m_timeThreshold = time;
emit timeThresholdChanged();
}
+
+bool QMLManager::loadFromCloud() const
+{
+ return m_loadFromCloud;
+}
+
+void QMLManager::setLoadFromCloud(bool done)
+{
+ m_loadFromCloud = done;
+ emit loadFromCloudChanged();
+}