diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-08-06 06:24:51 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-11 11:14:22 -0700 |
commit | a3ddd823bbba8f72495c01e62e91639cc6b88694 (patch) | |
tree | f1b657f2ef5c7b1724f1164747b080d539594acb /mobile-widgets/qmlmanager.h | |
parent | 7cc9da63474f341ad990da3ecb9c36edcef5a71c (diff) | |
download | subsurface-a3ddd823bbba8f72495c01e62e91639cc6b88694.tar.gz |
QML UI: add property to pass detected device name to UI
If the user plugs in a device on Android we get a device string that
should allow us to figure out which dive computer was plugged in. Make
that string available to the QML UI.
Right now all we do is log it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.h')
-rw-r--r-- | mobile-widgets/qmlmanager.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index eff68c59b..c4ed27e7c 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -49,6 +49,7 @@ class QMLManager : public QObject { Q_PROPERTY(bool DC_createNewTrip READ DC_createNewTrip WRITE DC_setCreateNewTrip) Q_PROPERTY(bool DC_saveDump READ DC_saveDump WRITE DC_setSaveDump) Q_PROPERTY(int DC_deviceId READ DC_deviceId WRITE DC_setDeviceId) + Q_PROPERTY(QString pluggedInDeviceName MEMBER m_pluggedInDeviceName NOTIFY pluggedInDeviceNameChanged) public: QMLManager(); ~QMLManager(); @@ -86,7 +87,7 @@ public: Q_INVOKABLE int getMatchingAddress(const QString &vendor, const QString &product); Q_INVOKABLE int getDetectedVendorIndex(); Q_INVOKABLE int getDetectedProductIndex(const QString ¤tVendorText); -public: + static QMLManager *instance(); Q_INVOKABLE void registerError(QString error); QString consumeError(); @@ -226,6 +227,7 @@ private: QString m_progressMessage; bool m_btEnabled; void updateAllGlobalLists(); + QString m_pluggedInDeviceName; #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) QString appLogFileName; @@ -252,6 +254,7 @@ signals: void divemasterListChanged(); void locationListChanged(); void waitingForPositionChanged(); + void pluggedInDeviceNameChanged(); }; #endif |