From 909b8c9f70213f93b31bfd78260bd771d02a1f35 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 16 Apr 2019 01:31:38 +0200 Subject: [PATCH] hide new options if the core isn't new enough --- nymea-app/ui/magic/RuleActionDelegate.qml | 4 +--- nymea-app/ui/magic/SelectRuleActionParamsPage.qml | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nymea-app/ui/magic/RuleActionDelegate.qml b/nymea-app/ui/magic/RuleActionDelegate.qml index 79c56b4d..68fcf558 100644 --- a/nymea-app/ui/magic/RuleActionDelegate.qml +++ b/nymea-app/ui/magic/RuleActionDelegate.qml @@ -30,7 +30,6 @@ MeaListItemDelegate { var ruleActionParam = root.ruleAction.ruleActionParams.get(i) print("populating subtext:", ruleActionParam.eventTypeId, ruleActionParam.eventParamTypeId, ruleActionParam.stateDeviceId, ruleActionParam.stateTypeId, ruleActionParam.isValueBased, ruleActionParam.isEventParamBased, ruleActionParam.isStateValueBased) - var paramString = qsTr("%1: %2").arg(root.actionType.paramTypes.getParamType(ruleActionParam.paramTypeId).displayName) if (ruleActionParam.isValueBased) { paramString = paramString.arg(ruleActionParam.value) @@ -40,8 +39,7 @@ MeaListItemDelegate { var stateDevice = engine.deviceManager.devices.getDevice(ruleActionParam.stateDeviceId) var stateType = stateDevice.deviceClass.stateTypes.getStateType(ruleActionParam.stateTypeId) print("have state value based param:", stateDevice.name) - paramString = paramString.arg(stateDevice.name + "." + stateType.displayName) - + paramString = paramString.arg("{" + stateDevice.name + " - " + stateType.displayName + "}") } ret.push(paramString) diff --git a/nymea-app/ui/magic/SelectRuleActionParamsPage.qml b/nymea-app/ui/magic/SelectRuleActionParamsPage.qml index 9f609fbd..c192cf3c 100644 --- a/nymea-app/ui/magic/SelectRuleActionParamsPage.qml +++ b/nymea-app/ui/magic/SelectRuleActionParamsPage.qml @@ -70,6 +70,7 @@ Page { text: qsTr("Use static value as parameter") checked: true font.pixelSize: app.smallFont + visible: eventParamRadioButton.visible || stateValueRadioButton.visible } RadioButton { id: eventParamRadioButton @@ -81,9 +82,12 @@ Page { id: stateValueRadioButton text: qsTr("Use a thing's state value") font.pixelSize: app.smallFont + visible: engine.jsonRpcClient.ensureServerVersion("2.0") } - ThinDivider {} + ThinDivider { + visible: staticParamRadioButton.visible + } ParamDelegate { id: paramDelegate