aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile/qmlmanager.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-03 18:33:40 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-04 14:18:41 -0700
commitbb74144860b14d23f26ebd3dd72e4654342282ae (patch)
treeb61f9b3406452e2722f9fc77cecfb642ed819e73 /qt-mobile/qmlmanager.h
parent616842c8c00654718ba3390b055eb946aaa4cff4 (diff)
downloadsubsurface-bb74144860b14d23f26ebd3dd72e4654342282ae.tar.gz
QML UI: allow user to disable automatic cloud sync
This is useful if you are in an area with slow or spotty network and if you are fine with just saving to the phone. In order to sync to the cloud you either have to manually sync via the menu or turn this back on and hide the application. The commit also removes the old refresh from the Manage dives menu as the semantic of that was possibly destructive now that we no longer immediately save changes to git - those could be thrown away by selecting refresh before the app had a chance to save them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.h')
-rw-r--r--qt-mobile/qmlmanager.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h
index 15954e9ec..7c56119d5 100644
--- a/qt-mobile/qmlmanager.h
+++ b/qt-mobile/qmlmanager.h
@@ -23,6 +23,7 @@ class QMLManager : public QObject {
Q_PROPERTY(bool verboseEnabled READ verboseEnabled WRITE setVerboseEnabled NOTIFY verboseEnabledChanged)
Q_PROPERTY(credentialStatus_t credentialStatus READ credentialStatus WRITE setCredentialStatus NOTIFY credentialStatusChanged)
Q_PROPERTY(int accessingCloud READ accessingCloud WRITE setAccessingCloud NOTIFY accessingCloudChanged)
+ Q_PROPERTY(bool syncToCloud READ syncToCloud WRITE setSyncToCloud NOTIFY syncToCloudChanged)
public:
QMLManager();
@@ -72,6 +73,9 @@ public:
int accessingCloud() const;
void setAccessingCloud(int status);
+ bool syncToCloud() const;
+ void setSyncToCloud(bool status);
+
typedef void (QMLManager::*execute_function_type)();
public slots:
@@ -83,7 +87,6 @@ public slots:
void handleError(QNetworkReply::NetworkError nError);
void handleSslErrors(const QList<QSslError> &errors);
void retrieveUserid();
- void loadDives();
void loadDivesWithValidCredentials();
void loadDiveProgress(int percent);
void provideAuth(QNetworkReply *reply, QAuthenticator *auth);
@@ -134,6 +137,7 @@ private:
struct dive *deletedDive;
struct dive_trip *deletedTrip;
int m_accessingCloud;
+ bool m_syncToCloud;
credentialStatus_t m_credentialStatus;
qreal m_lastDevicePixelRatio;
QElapsedTimer timer;
@@ -151,6 +155,7 @@ signals:
void startPageTextChanged();
void credentialStatusChanged();
void accessingCloudChanged();
+ void syncToCloudChanged();
void sendScreenChanged(QScreen *screen);
};