QML UI: show the connection choices in Download UI

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-07-16 21:50:28 -07:00
parent a4f045abaa
commit 40223c8a5f
2 changed files with 14 additions and 1 deletions

View file

@ -26,7 +26,7 @@ Kirigami.Page {
deviceData.product : comboProduct.currentText deviceData.product : comboProduct.currentText
//TODO: make this dynamic? //TODO: make this dynamic?
deviceData.devName : "/tmp/ttyS1" deviceData.devName : comboConnection.currentText
//TODO: Make this the default on the C++ //TODO: Make this the default on the C++
deviceData.bluetoothMode : isBluetooth.checked deviceData.bluetoothMode : isBluetooth.checked
@ -82,10 +82,22 @@ Kirigami.Page {
Layout.fillWidth: true Layout.fillWidth: true
model: null model: null
currentIndex: productidx currentIndex: productidx
onCurrentTextChanged: {
comboConnection.currentIndex = downloadThread.data().getMatchingAddress(comboVendor.currentText, currentText)
}
onModelChanged: { onModelChanged: {
currentIndex = productidx currentIndex = productidx
} }
} }
Kirigami.Label { text: qsTr(" Connection:") }
ComboBox {
id: comboConnection
Layout.fillWidth: true
model: connectionListModel
currentIndex: -1
}
Kirigami.Label { text: btEnabled ? qsTr("Bluetooth download:") : qsTr("No Bluetooth support detected")} Kirigami.Label { text: btEnabled ? qsTr("Bluetooth download:") : qsTr("No Bluetooth support detected")}
CheckBox { CheckBox {
id: isBluetooth id: isBluetooth

View file

@ -75,6 +75,7 @@ void run_ui()
ctxt->setContextProperty("diveModel", sortModel); ctxt->setContextProperty("diveModel", sortModel);
ctxt->setContextProperty("gpsModel", gpsSortModel); ctxt->setContextProperty("gpsModel", gpsSortModel);
ctxt->setContextProperty("vendorList", vendorList); ctxt->setContextProperty("vendorList", vendorList);
ctxt->setContextProperty("connectionListModel", &connectionListModel);
ctxt->setContextProperty("logModel", MessageHandlerModel::self()); ctxt->setContextProperty("logModel", MessageHandlerModel::self());
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml"))); engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));