hide new options if the core isn't new enough
This commit is contained in:
parent
d7d06eb84a
commit
909b8c9f70
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user