diff options
author | jan Iversen <jani@libreoffice.org> | 2018-06-09 13:14:54 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-06-09 21:19:46 +0200 |
commit | 682e1b63f5554e23d1fc295032635bfcb88d2c95 (patch) | |
tree | 1f72548e80d4534a391433160acc46ccc75e64f1 /mobile-widgets | |
parent | acc9784fd9d7bc5695cc862132d2bb0ee7f87f48 (diff) | |
download | subsurface-682e1b63f5554e23d1fc295032635bfcb88d2c95.tar.gz |
mobile: add DCDeviceData properties to qmlmanager
add DCDeviceData qml properties etc. to qmlmanager
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 135 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.h | 54 |
2 files changed, 188 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 33376656b..b6cf05850 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1723,3 +1723,138 @@ void QMLManager::setStatusbarColor(QColor) } #endif + +QString QMLManager::DC_vendor() const +{ + return m_device_data->vendor(); +} + +QString QMLManager::DC_product() const +{ + return m_device_data->product(); +} + +QString QMLManager::DC_devName() const +{ + return m_device_data->devName(); +} + +QString QMLManager::DC_devBluetoothName() const +{ + return m_device_data->devBluetoothName(); +} + +QString QMLManager::DC_descriptor() const +{ + return m_device_data->descriptor(); +} + +bool QMLManager::DC_forceDownload() const +{ + return m_device_data->forceDownload(); +} + +bool QMLManager::DC_bluetoothMode() const +{ + return m_device_data->bluetoothMode(); +} + +bool QMLManager::DC_createNewTrip() const +{ + return m_device_data->createNewTrip(); +} + +bool QMLManager::DC_saveDump() const +{ + return m_device_data->saveDump(); +} + +bool QMLManager::DC_saveLog() const +{ + return m_device_data->saveLog(); +} + +int QMLManager::DC_deviceId() const +{ + return m_device_data->deviceId(); +} + +int QMLManager::DC_diveId() const +{ + return m_device_data->diveId(); +} + +void QMLManager::DC_setDeviceId(int deviceId) +{ + m_device_data->setDeviceId(deviceId); +} + +void QMLManager::DC_setDiveId(int diveId) +{ + m_device_data->setDiveId(diveId); +} + +void QMLManager::DC_setVendor(const QString& vendor) +{ + m_device_data->setVendor(vendor); +} + +void QMLManager::DC_setProduct(const QString& product) +{ + m_device_data->setProduct(product); +} + +void QMLManager::DC_setDevName(const QString& devName) +{ + m_device_data->setDevName(devName); +} + +void QMLManager::DC_setDevBluetoothName(const QString& devBluetoothName) +{ + m_device_data->setDevBluetoothName(devBluetoothName); +} + +void QMLManager::DC_setBluetoothMode(bool mode) +{ + m_device_data->setBluetoothMode(mode); +} + +void QMLManager::DC_setForceDownload(bool force) +{ + m_device_data->setForceDownload(force); +} + +void QMLManager::DC_setCreateNewTrip(bool create) +{ + m_device_data->setCreateNewTrip(create); +} + +void QMLManager::DC_setSaveDump(bool dumpMode) +{ + m_device_data->setSaveDump(dumpMode); +} + +void QMLManager::DC_setSaveLog(bool saveLog) +{ + m_device_data->setSaveLog(saveLog); +} + +QStringList QMLManager::getProductListFromVendor(const QString &vendor) +{ + return m_device_data->getProductListFromVendor(vendor); +} + +int QMLManager::getMatchingAddress(const QString &vendor, const QString &product) +{ + return m_device_data->getMatchingAddress(vendor, product); +} + +int QMLManager::getDetectedVendorIndex() +{ + return m_device_data->getDetectedVendorIndex(); +} + +int QMLManager::getDetectedProductIndex(const QString ¤tVendorText) +{ + return m_device_data->getDetectedProductIndex(currentVendorText); +} diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index a8b5c1cdb..8ec0afb44 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -48,10 +48,62 @@ class QMLManager : public QObject { Q_PROPERTY(bool developer MEMBER m_developer WRITE setDeveloper NOTIFY developerChanged) Q_PROPERTY(bool btEnabled MEMBER m_btEnabled WRITE setBtEnabled NOTIFY btEnabledChanged) + Q_PROPERTY(QString DC_vendor READ DC_vendor WRITE DC_setVendor) + Q_PROPERTY(QString DC_product READ DC_product WRITE DC_setProduct) + Q_PROPERTY(QString DC_devName READ DC_devName WRITE DC_setDevName) + Q_PROPERTY(QString DC_devBluetoothName READ DC_devBluetoothName WRITE DC_setDevBluetoothName) + Q_PROPERTY(QString descriptor READ DC_descriptor) + Q_PROPERTY(bool DC_forceDownload READ DC_forceDownload WRITE DC_setForceDownload) + Q_PROPERTY(bool DC_bluetoothMode READ DC_bluetoothMode WRITE DC_setBluetoothMode) + Q_PROPERTY(bool DC_createNewTrip READ DC_createNewTrip WRITE DC_setCreateNewTrip) + Q_PROPERTY(bool DC_saveDump READ DC_saveDump WRITE DC_setSaveDump) + Q_PROPERTY(bool DC_saveLog READ DC_saveLog WRITE DC_setSaveLog) + Q_PROPERTY(int DC_deviceId READ DC_deviceId WRITE DC_setDeviceId) + Q_PROPERTY(int DC_diveId READ DC_diveId WRITE DC_setDiveId) public: QMLManager(); ~QMLManager(); + QString DC_vendor() const; + void DC_setVendor(const QString& vendor); + + QString DC_product() const; + void DC_setProduct(const QString& product); + + QString DC_devName() const; + void DC_setDevName(const QString& devName); + + QString DC_devBluetoothName() const; + void DC_setDevBluetoothName(const QString& devBluetoothName); + + QString DC_descriptor() const; + + bool DC_forceDownload() const; + void DC_setForceDownload(bool force); + + bool DC_bluetoothMode() const; + void DC_setBluetoothMode(bool mode); + + bool DC_createNewTrip() const; + void DC_setCreateNewTrip(bool create); + + bool DC_saveDump() const; + void DC_setSaveDump(bool dumpMode); + + bool DC_saveLog() const; + void DC_setSaveLog(bool saveLog); + + int DC_deviceId() const; + void DC_setDeviceId(int deviceId); + + int DC_diveId() const; + void DC_setDiveId(int diveId); + + Q_INVOKABLE QStringList getProductListFromVendor(const QString& vendor); + Q_INVOKABLE int getMatchingAddress(const QString &vendor, const QString &product); + Q_INVOKABLE int getDetectedVendorIndex(); + Q_INVOKABLE int getDetectedProductIndex(const QString ¤tVendorText); +public: enum cloud_status_qml { CS_UNKNOWN, CS_INCORRECT_USER_PASSWD, @@ -234,7 +286,7 @@ private: bool checkDepth(DiveObjectHelper *myDive, struct dive *d, QString depth); bool currentGitLocalOnly; bool m_showPin; - DCDeviceData *m_device_data; + Q_INVOKABLE DCDeviceData *m_device_data; QString m_progressMessage; bool m_developer; bool m_btEnabled; |