QML UI: Fill the product list

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2017-05-12 18:29:45 +02:00 committed by Dirk Hohndel
parent f78fdf3d0f
commit 0e4c996f51
3 changed files with 14 additions and 1 deletions

View file

@ -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 {

View file

@ -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];
}

View file

@ -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);