summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mobile-widgets/qmlmanager.cpp15
-rw-r--r--mobile-widgets/qmlmanager.h8
2 files changed, 22 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index b935a5bd8..01d9c0196 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -154,7 +154,8 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
m_selectedDiveTimestamp(0),
alreadySaving(false),
m_pluggedInDeviceName(""),
- m_showNonDiveComputers(false)
+ m_showNonDiveComputers(false),
+ m_oldStatus(qPrefCloudStorage::CS_UNKNOWN)
{
m_instance = this;
m_lastDevicePixelRatio = qApp->devicePixelRatio();
@@ -2196,3 +2197,15 @@ void QMLManager::uploadFinishSlot(bool success, const QString &text, const QByte
emit uploadFinish(success, text);
}
+qPrefCloudStorage::cloud_status QMLManager::oldStatus() const
+{
+ return m_oldStatus;
+}
+
+void QMLManager::setOldStatus(const qPrefCloudStorage::cloud_status value)
+{
+ if (m_oldStatus != value) {
+ m_oldStatus = value;
+ emit oldStatusChanged();
+ }
+}
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index 281d20778..a3fce0576 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -16,6 +16,7 @@
#include "qt-models/divelistmodel.h"
#include "qt-models/completionmodels.h"
#include "qt-models/divelocationmodel.h"
+#include "core/settings/qPrefCloudStorage.h"
#define NOCLOUD_LOCALSTORAGE format_string("%s/cloudstorage/localrepo[master]", system_default_directory())
@@ -49,6 +50,8 @@ class QMLManager : public QObject {
Q_PROPERTY(int DC_deviceId READ DC_deviceId WRITE DC_setDeviceId)
Q_PROPERTY(QString pluggedInDeviceName MEMBER m_pluggedInDeviceName NOTIFY pluggedInDeviceNameChanged)
Q_PROPERTY(bool showNonDiveComputers MEMBER m_showNonDiveComputers WRITE setShowNonDiveComputers NOTIFY showNonDiveComputersChanged)
+ Q_PROPERTY(qPrefCloudStorage::cloud_status oldStatus MEMBER m_oldStatus WRITE setOldStatus NOTIFY oldStatusChanged)
+
public:
QMLManager();
~QMLManager();
@@ -163,6 +166,8 @@ public:
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
void writeToAppLogFile(QString logText);
#endif
+ qPrefCloudStorage::cloud_status oldStatus() const;
+ void setOldStatus(const qPrefCloudStorage::cloud_status value);
public slots:
void appInitialized();
@@ -273,6 +278,7 @@ private:
QFile appLogFile;
bool appLogFileOpen;
#endif
+ qPrefCloudStorage::cloud_status m_oldStatus;
signals:
void locationServiceEnabledChanged();
@@ -295,11 +301,13 @@ signals:
void pluggedInDeviceNameChanged();
void showNonDiveComputersChanged();
void DC_ForceDownloadChanged();
+ void oldStatusChanged();
// From upload process
void uploadFinish(bool success, const QString &text);
void uploadProgress(qreal percentage);
+
private slots:
void uploadFinishSlot(bool success, const QString &text, const QByteArray &html);
};