diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2017-05-12 18:29:45 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-05-27 11:07:19 -0700 |
commit | 0e4c996f5189b3c364db73075ae009028a28c390 (patch) | |
tree | 8145cf8f78472b720c5d0d3aef61fdc60028ce1d /mobile-widgets | |
parent | f78fdf3d0fea3a426f07f24d0ce2d98a1cae0bf0 (diff) | |
download | subsurface-0e4c996f5189b3c364db73075ae009028a28c390.tar.gz |
QML UI: Fill the product list
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/DownloadFromDiveComputer.qml | 8 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 6 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.h | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 5788ab571..ecab94774 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -37,10 +37,16 @@ Kirigami.Page { columns: 2 Kirigami.Label { text: qsTr(" Vendor name: ") } ComboBox { + id: comboVendor Layout.fillWidth: true model: vendorList } - Kirigami.Label { text: qsTr(" Dive Computer:") } ComboBox { Layout.fillWidth: true } + Kirigami.Label { text: qsTr(" Dive Computer:") } + ComboBox { + id: comboProduct + Layout.fillWidth: true + model: manager.getDCListFromVendor(comboVendor.currentText) + } } ProgressBar { diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index b683bafae..4d2999049 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -24,6 +24,7 @@ #include "core/subsurface-qt/SettingsObjectWrapper.h" #include "core/membuffer.h" #include "qt-models/tankinfomodel.h" +#include "core/downloadfromdcthread.h" QMLManager *QMLManager::m_instance = NULL; @@ -1513,3 +1514,8 @@ void QMLManager::setShowPin(bool enable) m_showPin = enable; emit showPinChanged(); } + +QStringList QMLManager::getDCListFromVendor(const QString& vendor) +{ + return productList[vendor]; +} diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index fe9e930b6..db170704b 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -113,6 +113,7 @@ public: QStringList cylinderInit() const; bool showPin() const; void setShowPin(bool enable); + Q_INVOKABLE QStringList getDCListFromVendor(const QString& vendor); public slots: void applicationStateChanged(Qt::ApplicationState state); |