From 0e4c996f5189b3c364db73075ae009028a28c390 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 12 May 2017 18:29:45 +0200 Subject: QML UI: Fill the product list Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 8 +++++++- mobile-widgets/qmlmanager.cpp | 6 ++++++ mobile-widgets/qmlmanager.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'mobile-widgets') 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); -- cgit v1.2.3-70-g09d2