summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-09 15:07:16 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-09 15:07:44 -0700
commitfd96daca6a170bfd2ecac45b403c93c63b8473d2 (patch)
tree91b88f5f714cddfa7890dcb568b3ae3b1e5ed25b
parent8e5c211e2107ee8ac8e09bfd23a9a6e05676ae8c (diff)
downloadsubsurface-fd96daca6a170bfd2ecac45b403c93c63b8473d2.tar.gz
QML UI: add progress message variable
To be shared between C/C++ and QML code in order to show the updates and potential error messages from libdivecomputer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--mobile-widgets/qmlmanager.cpp11
-rw-r--r--mobile-widgets/qmlmanager.h6
2 files changed, 17 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index f0586bdf6..9e8ee226f 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1508,6 +1508,17 @@ void QMLManager::setShowPin(bool enable)
emit showPinChanged();
}
+QString QMLManager::progressMessage() const
+{
+ return m_progressMessage;
+}
+
+void QMLManager::setProgressMessage(QString text)
+{
+ m_progressMessage = text;
+ emit progressMessageChanged();
+}
+
#if defined (Q_OS_ANDROID)
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index f37389acd..3c450158e 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -40,6 +40,7 @@ class QMLManager : public QObject {
Q_PROPERTY(QStringList divemasterInit READ divemasterInit CONSTANT)
Q_PROPERTY(QStringList cylinderInit READ cylinderInit CONSTANT)
Q_PROPERTY(bool showPin READ showPin WRITE setShowPin NOTIFY showPinChanged)
+ Q_PROPERTY(QString progressMessage READ progressMessage WRITE setProgressMessage NOTIFY progressMessageChanged)
public:
QMLManager();
@@ -111,6 +112,9 @@ public:
int selectedDiveTimestamp() const;
void setSelectedDiveTimestamp(int when);
+ QString progressMessage() const;
+ void setProgressMessage(QString text);
+
typedef void (QMLManager::*execute_function_type)();
DiveListSortModel *dlSortModel;
@@ -203,6 +207,7 @@ private:
bool currentGitLocalOnly;
bool m_showPin;
DCDeviceData *m_device_data;
+ QString m_progressMessage;
signals:
void cloudUserNameChanged();
@@ -225,6 +230,7 @@ signals:
void selectedDiveTimestampChanged();
void showPinChanged();
void sendScreenChanged(QScreen *screen);
+ void progressMessageChanged();
};
#endif