mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 17:57:55 -06:00
Add not supported role to profiles model
This commit is contained in:
parent
35684e0aa4
commit
b50f027c83
2 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ Menu
|
|||
checked: Cura.MachineManager.activeQualityChangesId == "" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
||||
visible: model.available
|
||||
visible: model.available || model.not_supported
|
||||
}
|
||||
|
||||
onObjectAdded: menu.insertItem(index, object);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue