diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-06-05 19:41:57 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-11 13:55:41 -0700 |
commit | b14a522f4f308aed41ab49b5529cc10c05168716 (patch) | |
tree | 2b3540e4aeefbe9c21ab9d3af1af2b07a4f503e0 /core/downloadfromdcthread.h | |
parent | 3b993fbaad0738efe54e797b60e4f49270951323 (diff) | |
download | subsurface-b14a522f4f308aed41ab49b5529cc10c05168716.tar.gz |
QML UI: move BT handling into core code
This shouldn't be part of the UI (qmlmanager), but part of our
overall handling of dive computers and BT devices.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/downloadfromdcthread.h')
-rw-r--r-- | core/downloadfromdcthread.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/downloadfromdcthread.h b/core/downloadfromdcthread.h index bf203a85f..13cca1438 100644 --- a/core/downloadfromdcthread.h +++ b/core/downloadfromdcthread.h @@ -4,9 +4,11 @@ #include <QThread> #include <QMap> #include <QHash> +#include <QLoggingCategory> #include "dive.h" #include "libdivecomputer.h" +#include "core/btdiscovery.h" /* Helper object for access of Device Data in QML */ class DCDeviceData : public QObject { @@ -25,6 +27,7 @@ class DCDeviceData : public QObject { public: DCDeviceData(QObject *parent = nullptr); + static DCDeviceData *instance(); QString vendor() const; QString product() const; @@ -41,6 +44,11 @@ public: /* this needs to be a pointer to make the C-API happy */ device_data_t* internalData(); + Q_INVOKABLE QStringList getProductListFromVendor(const QString& vendor); + Q_INVOKABLE int getDetectedVendorIndex(); + Q_INVOKABLE int getDetectedProductIndex(); + Q_INVOKABLE QString getDetectedDeviceAddress(); + public slots: void setVendor(const QString& vendor); void setProduct(const QString& product); @@ -53,6 +61,7 @@ public slots: void setSaveDump(bool dumpMode); void setSaveLog(bool saveLog); private: + static DCDeviceData *m_instance; device_data_t data; }; @@ -64,7 +73,7 @@ public: DownloadThread(); void run() override; - DCDeviceData *data(); + Q_INVOKABLE DCDeviceData *data(); QString error; private: |