diff options
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/main.qml | 5 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 3 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.h | 5 |
3 files changed, 11 insertions, 2 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 03d7238c3..f74b28b71 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -25,6 +25,7 @@ Kirigami.ApplicationWindow { property alias notificationText: manager.notificationText property alias syncToCloud: manager.syncToCloud property alias locationServiceEnabled: manager.locationServiceEnabled + property alias pluggedInDeviceName: manager.pluggedInDeviceName property alias showPin: prefs.showPin onNotificationTextChanged: { if (notificationText != "") { @@ -610,6 +611,10 @@ if you have network connectivity and want to sync your data to cloud storage."), visible: false } + onPluggedInDeviceNameChanged: { + console.log("Show download page for device " + pluggedInDeviceName); + } + Component.onCompleted: { rootItem.visible = true diveList.opacity = 1 diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 82d94eb70..3495468db 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -139,7 +139,8 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), m_updateSelectedDive(-1), m_selectedDiveTimestamp(0), alreadySaving(false), - m_device_data(new DCDeviceData) + m_device_data(new DCDeviceData), + m_pluggedInDeviceName("") { LOG_STP("qmlmgr starting"); m_instance = this; 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 |