diff --git a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml index f5db5e1d..4809537f 100644 --- a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml +++ b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml @@ -59,12 +59,12 @@ Page { deviceMenu.addItem(menuEntryComponent.createObject(deviceMenu, {text: qsTr("Rename"), iconSource: "../images/edit.svg", functionName: "renameThing"})) // FIXME: This isn't entirely correct... we should have a way to know if a particular thing is in fact autocreated // This check might be wrong for thingClasses with multiple create methods... - if (!root.device.isChild || root.deviceClass.createMethods !== ["auto"]) { + if (!root.device.isChild || root.deviceClass.createMethods.indexOf("CreateMethodAuto") < 0) { deviceMenu.addItem(menuEntryComponent.createObject(deviceMenu, {text: qsTr("Delete"), iconSource: "../images/delete.svg", functionName: "deleteThing"})) } // FIXME: This isn't entirely correct... we should have a way to know if a particular thing is in fact autocreated // This check might be wrong for thingClasses with multiple create methods... - if (!root.device.isChild || root.deviceClass.createMethods !== ["auto"]) { + if (!root.device.isChild || root.deviceClass.createMethods.indexOf("CreateMethodAuto") < 0) { deviceMenu.addItem(menuEntryComponent.createObject(deviceMenu, {text: qsTr("Reconfigure"), iconSource: "../images/configure.svg", functionName: "reconfigureThing"})) } } diff --git a/nymea-app/ui/thingconfiguration/EditThingsPage.qml b/nymea-app/ui/thingconfiguration/EditThingsPage.qml index 0654650e..9ebf4a3f 100644 --- a/nymea-app/ui/thingconfiguration/EditThingsPage.qml +++ b/nymea-app/ui/thingconfiguration/EditThingsPage.qml @@ -106,10 +106,9 @@ Page { delegate: ThingDelegate { device: deviceProxy.getDevice(model.id) // FIXME: This isn't entirely correct... we should have a way to know if a particular thing is in fact autocreated - // This check might be wrong for thingClasses with multiple create methods... - canDelete: !device.isChild && device.deviceClass.createMethods === ["auto"] + // This check might be wrong for thingClasses with multiple create methods... + canDelete: !device.isChild || device.deviceClass.createMethods.indexOf("CreateMethodAuto") < 0 onClicked: { - print("clicked:", model.id) pageStack.push(Qt.resolvedUrl("ConfigureThingPage.qml"), {device: device}) } onDeleteClicked: {