summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-06-13 16:41:26 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-06-13 16:41:26 -0700
commit5fa965df54c1ab7f881271e0dad2b6dfa6f253ed (patch)
tree432403c86bf9f212af422b0f8138f8b186c0eb80 /mobile-widgets
parentd2f9803883ff1453e71a29e358fd5368f650fb62 (diff)
downloadsubsurface-5fa965df54c1ab7f881271e0dad2b6dfa6f253ed.tar.gz
QML UI: prepare to enter the cloud PIN on mobile UI
This just creates the properties to connect QML and C++ code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp23
-rw-r--r--mobile-widgets/qmlmanager.h12
2 files changed, 35 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index d527f53c2..3e19969b5 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -95,6 +95,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
qDebug() << QStringLiteral("build with Qt Version %1, runtime from Qt Version %2").arg(QT_VERSION_STR).arg(qVersion());
setStartPageText(tr("Starting..."));
setAccessingCloud(-1);
+ setShowPin(false);
// create location manager service
locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
connect(locationProvider, SIGNAL(haveSourceChanged()), this, SLOT(hasLocationSourceChanged()));
@@ -1183,6 +1184,17 @@ void QMLManager::setCloudPassword(const QString &cloudPassword)
emit cloudPasswordChanged();
}
+QString QMLManager::cloudPin() const
+{
+ return m_cloudPin;
+}
+
+void QMLManager::setCloudPin(const QString &cloudPin)
+{
+ m_cloudPin = cloudPin;
+ emit cloudPinChanged();
+}
+
QString QMLManager::cloudUserName() const
{
return m_cloudUserName;
@@ -1421,3 +1433,14 @@ QStringList QMLManager::divemasterInit() const
divemasters.sort();
return divemasters;
}
+
+bool QMLManager::showPin() const
+{
+ return m_showPin;
+}
+
+void QMLManager::setShowPin(bool enable)
+{
+ m_showPin = enable;
+ emit showPinChanged();
+}
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index 10ff0ba51..b7be359ed 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -15,6 +15,7 @@ class QMLManager : public QObject {
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(QString cloudPin READ cloudPin WRITE setCloudPin NOTIFY cloudPinChanged)
Q_PROPERTY(QString logText READ logText WRITE setLogText NOTIFY logTextChanged)
Q_PROPERTY(bool locationServiceEnabled READ locationServiceEnabled WRITE setLocationServiceEnabled NOTIFY locationServiceEnabledChanged)
Q_PROPERTY(bool locationServiceAvailable READ locationServiceAvailable WRITE setLocationServiceAvailable NOTIFY locationServiceAvailableChanged)
@@ -32,6 +33,7 @@ class QMLManager : public QObject {
Q_PROPERTY(QStringList suitInit READ suitInit CONSTANT)
Q_PROPERTY(QStringList buddyInit READ buddyInit CONSTANT)
Q_PROPERTY(QStringList divemasterInit READ divemasterInit CONSTANT)
+ Q_PROPERTY(bool showPin READ showPin WRITE setShowPin NOTIFY showPinChanged)
public:
QMLManager();
@@ -54,6 +56,9 @@ public:
QString cloudPassword() const;
void setCloudPassword(const QString &cloudPassword);
+ QString cloudPin() const;
+ void setCloudPin(const QString &cloudPin);
+
bool locationServiceEnabled() const;
void setLocationServiceEnabled(bool locationServiceEnable);
@@ -104,6 +109,9 @@ public:
QStringList buddyInit() const;
QStringList divemasterInit() const;
+ bool showPin() const;
+ void setShowPin(bool enable);
+
public slots:
void applicationStateChanged(Qt::ApplicationState state);
void savePreferences();
@@ -153,6 +161,7 @@ public slots:
private:
QString m_cloudUserName;
QString m_cloudPassword;
+ QString m_cloudPin;
QString m_ssrfGpsWebUserid;
QString m_startPageText;
QString m_logText;
@@ -182,10 +191,12 @@ private:
bool checkDuration(DiveObjectHelper *myDive, struct dive *d, QString duration);
bool checkDepth(DiveObjectHelper *myDive, struct dive *d, QString depth);
bool currentGitLocalOnly;
+ bool m_showPin;
signals:
void cloudUserNameChanged();
void cloudPasswordChanged();
+ void cloudPinChanged();
void locationServiceEnabledChanged();
void locationServiceAvailableChanged();
void verboseEnabledChanged();
@@ -200,6 +211,7 @@ signals:
void syncToCloudChanged();
void updateSelectedDiveChanged();
void selectedDiveTimestampChanged();
+ void showPinChanged();
void sendScreenChanged(QScreen *screen);
};