Add not supported role to profiles model

This commit is contained in:
ChrisTerBeke 2017-10-24 10:25:53 +02:00
parent 35684e0aa4
commit b50f027c83
2 changed files with 5 additions and 2 deletions

View file

@ -20,12 +20,14 @@ class ProfilesModel(InstanceContainersModel):
LayerHeightRole = Qt.UserRole + 1001
LayerHeightWithoutUnitRole = Qt.UserRole + 1002
AvailableRole = Qt.UserRole + 1003
NotSupportedRole = Qt.UserRole + 1004
def __init__(self, parent = None):
super().__init__(parent)
self.addRoleName(self.LayerHeightRole, "layer_height")
self.addRoleName(self.LayerHeightWithoutUnitRole, "layer_height_without_unit")
self.addRoleName(self.AvailableRole, "available")
self.addRoleName(self.NotSupportedRole, "not_supported")
Application.getInstance().globalContainerStackChanged.connect(self._update)
@ -182,7 +184,8 @@ class ProfilesModel(InstanceContainersModel):
profile = container_registry.findContainers(id=item["id"])
if not profile:
self._setItemLayerHeight(item, "", "")
item["available"] = True
item["available"] = False
item["not_supported"] = True
yield item
continue