From 2f73092bf53c3d2ad5959cdd8b03e9df7d7fb8b7 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 30 Aug 2021 23:13:29 +0200 Subject: [PATCH] Fix static value selection in state descriptor editor --- .../ui/magic/SelectStateDescriptorParamsPage.qml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/nymea-app/ui/magic/SelectStateDescriptorParamsPage.qml b/nymea-app/ui/magic/SelectStateDescriptorParamsPage.qml index 6a608ca5..709c0792 100644 --- a/nymea-app/ui/magic/SelectStateDescriptorParamsPage.qml +++ b/nymea-app/ui/magic/SelectStateDescriptorParamsPage.qml @@ -53,11 +53,6 @@ Page { onBackPressed: root.backPressed(); } - QtObject { - id: d - property var value: root.stateType.defaultValue - } - GroupBox { anchors { left: parent.left @@ -123,13 +118,14 @@ Page { ThinDivider { Layout.columnSpan: parent.columns } ParamDelegate { + id: staticValueParamDelegate Layout.fillWidth: true hoverEnabled: false padding: 0 paramType: root.thing.thingClass.eventTypes.getEventType(root.stateType.id).paramTypes.getParamType(root.stateType.id) enabled: staticValueRadioButton.checked nameVisible: false - value: d.value + value: root.stateType.defaultValue visible: staticValueRadioButton.checked placeholderText: qsTr("Insert value here") } @@ -172,9 +168,11 @@ Page { Layout.fillWidth: true Layout.margins: app.margins onClicked: { + print("saving") root.stateDescriptor.valueOperator = operatorComboBox.currentIndex if (staticValueRadioButton.checked) { - root.stateDescriptor.value = d.value + print("static value:", staticValueParamDelegate.value) + root.stateDescriptor.value = staticValueParamDelegate.value } else { root.stateDescriptor.valueThingId = statePickerDelegate.thingId root.stateDescriptor.valueStateTypeId = statePickerDelegate.stateTypeId