hide new options if the core isn't new enough

This commit is contained in:
Michael Zanetti 2019-04-16 01:31:38 +02:00
parent d7d06eb84a
commit 909b8c9f70
2 changed files with 6 additions and 4 deletions

View File

@ -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)

View File

@ -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