mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 02:07:51 -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
|
LayerHeightRole = Qt.UserRole + 1001
|
||||||
LayerHeightWithoutUnitRole = Qt.UserRole + 1002
|
LayerHeightWithoutUnitRole = Qt.UserRole + 1002
|
||||||
AvailableRole = Qt.UserRole + 1003
|
AvailableRole = Qt.UserRole + 1003
|
||||||
|
NotSupportedRole = Qt.UserRole + 1004
|
||||||
|
|
||||||
def __init__(self, parent = None):
|
def __init__(self, parent = None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.addRoleName(self.LayerHeightRole, "layer_height")
|
self.addRoleName(self.LayerHeightRole, "layer_height")
|
||||||
self.addRoleName(self.LayerHeightWithoutUnitRole, "layer_height_without_unit")
|
self.addRoleName(self.LayerHeightWithoutUnitRole, "layer_height_without_unit")
|
||||||
self.addRoleName(self.AvailableRole, "available")
|
self.addRoleName(self.AvailableRole, "available")
|
||||||
|
self.addRoleName(self.NotSupportedRole, "not_supported")
|
||||||
|
|
||||||
Application.getInstance().globalContainerStackChanged.connect(self._update)
|
Application.getInstance().globalContainerStackChanged.connect(self._update)
|
||||||
|
|
||||||
|
@ -182,7 +184,8 @@ class ProfilesModel(InstanceContainersModel):
|
||||||
profile = container_registry.findContainers(id=item["id"])
|
profile = container_registry.findContainers(id=item["id"])
|
||||||
if not profile:
|
if not profile:
|
||||||
self._setItemLayerHeight(item, "", "")
|
self._setItemLayerHeight(item, "", "")
|
||||||
item["available"] = True
|
item["available"] = False
|
||||||
|
item["not_supported"] = True
|
||||||
yield item
|
yield item
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ Menu
|
||||||
checked: Cura.MachineManager.activeQualityChangesId == "" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
|
checked: Cura.MachineManager.activeQualityChangesId == "" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
|
||||||
exclusiveGroup: group
|
exclusiveGroup: group
|
||||||
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
||||||
visible: model.available
|
visible: model.available || model.not_supported
|
||||||
}
|
}
|
||||||
|
|
||||||
onObjectAdded: menu.insertItem(index, object);
|
onObjectAdded: menu.insertItem(index, object);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue