This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-app/guh-control/ui/devicepages/ConfigureThingPage.qml
Michael Zanetti 834c7a43c5 moar work!
2017-11-10 15:11:49 +01:00

54 lines
1.4 KiB
QML

import QtQuick 2.8
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.2
import Guh 1.0
import "../components"
Page {
id: root
property var device: null
readonly property var deviceClass: Engine.deviceManager.deviceClasses.getDeviceClass(device.deviceClassId)
header: GuhHeader {
text: root.device.name
onBackPressed: pageStack.pop()
HeaderButton {
imageSource: "../images/delete.svg"
color: "red"
onClicked: {
Engine.deviceManager.removeDevice(root.device.id)
}
}
}
Connections {
target: Engine.deviceManager
onRemoveDeviceReply: {
if (params.deviceError === "DeviceErrorNoError") {
pageStack.pop();
return;
}
print("Remove device error!", params)
}
}
ListView {
anchors.fill: parent
model: root.device.params
delegate: ItemDelegate {
width: parent.width
contentItem: RowLayout {
Label {
text: root.deviceClass.paramTypes.getParamType(model.id).displayName
}
Label {
Layout.fillWidth: true
text: model.value
horizontalAlignment: Text.AlignRight
}
}
}
}
}