summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qmlmanager.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-10 17:45:23 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-10 21:00:43 -0800
commite26e50f2e4a9ce78e345d06345d437d67aaa2451 (patch)
tree0936624f12547bdc9a5ad0208698d5c6cd7ace0a /qt-mobile/qmlmanager.h
parentb7e353b7f66f3a9eba923cd07a26dced2e512053 (diff)
downloadsubsurface-e26e50f2e4a9ce78e345d06345d437d67aaa2451.tar.gz
Better tracking of the status of the credentials
There are several parts of the UI that will do better if they know if the credentials that we have are incomplete (e.g., no password), invalid (server rejected them), valid (server accepted them) or potentially valid (we found a local cache for the email address, so that's likely correct, but because we are offline we cannot (or have not yet) verify the passord). So far this is specific for the mobile UI - it might make sense to try and use the same backend code and status tracking for desktop and mobile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.h')
-rw-r--r--qt-mobile/qmlmanager.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h
index 6cd468260..2d44bfc4e 100644
--- a/qt-mobile/qmlmanager.h
+++ b/qt-mobile/qmlmanager.h
@@ -9,6 +9,7 @@
class QMLManager : public QObject {
Q_OBJECT
+ Q_ENUMS(credentialStatus_t)
Q_PROPERTY(QString cloudUserName READ cloudUserName WRITE setCloudUserName NOTIFY cloudUserNameChanged)
Q_PROPERTY(QString cloudPassword READ cloudPassword WRITE setCloudPassword NOTIFY cloudPasswordChanged)
Q_PROPERTY(bool saveCloudPassword READ saveCloudPassword WRITE setSaveCloudPassword NOTIFY saveCloudPasswordChanged)
@@ -19,10 +20,19 @@ class QMLManager : public QObject {
Q_PROPERTY(bool loadFromCloud READ loadFromCloud WRITE setLoadFromCloud NOTIFY loadFromCloudChanged)
Q_PROPERTY(QString startPageText READ startPageText WRITE setStartPageText NOTIFY startPageTextChanged)
Q_PROPERTY(bool verboseEnabled READ verboseEnabled WRITE setVerboseEnabled NOTIFY verboseEnabledChanged)
+ Q_PROPERTY(credentialStatus_t credentialStatus READ credentialStatus WRITE setCredentialStatus NOTIFY credentialStatusChanged)
public:
QMLManager();
~QMLManager();
+ enum credentialStatus_t {
+ INCOMPLETE,
+ UNKNOWN,
+ INVALID,
+ VALID_EMAIL,
+ VALID
+ };
+
static QMLManager *instance();
QString cloudUserName() const;
@@ -53,6 +63,9 @@ public:
QString startPageText() const;
void setStartPageText(const QString& text);
+ credentialStatus_t credentialStatus() const;
+ void setCredentialStatus(const credentialStatus_t value);
+
QString logText() const;
void setLogText(const QString &logText);
void appendTextToLog(const QString &newText);
@@ -112,6 +125,8 @@ private:
QNetworkReply *reply;
QNetworkRequest request;
+ credentialStatus_t m_credentialStatus;
+
signals:
void cloudUserNameChanged();
void cloudPasswordChanged();
@@ -123,6 +138,7 @@ signals:
void distanceThresholdChanged();
void loadFromCloudChanged();
void startPageTextChanged();
+ void credentialStatusChanged();
};
#endif