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 93c91d71bd more work
2018-02-25 05:48:36 +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"
import "../paramdelegates-ng"
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;
}
var popup = errorDialog.createObject(root, {text: "Remove device error: " + JSON.stringify(params.deviceError) })
popup.open();
}
}
ListView {
anchors.fill: parent
model: root.device.params
delegate: ParamDelegate {
width: parent.width
paramType: root.deviceClass.paramTypes.getParamType(model.id)
param: root.device.params.get(index)
writable: false
}
}
Component {
id: errorDialog
ErrorDialog { }
}
}