mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Expose quality changes id and quality type and make the profile menu work correctly
Contributes to CURA-2006
This commit is contained in:
parent
450dcac394
commit
6de7d0170a
2 changed files with 18 additions and 2 deletions
|
@ -417,6 +417,22 @@ class MachineManager(QObject):
|
|||
return quality.getId()
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = activeQualityChanged)
|
||||
def activeQualityType(self):
|
||||
if self._global_container_stack:
|
||||
quality = self._global_container_stack.findContainer(type = "quality")
|
||||
if quality:
|
||||
return quality.getMetaDataEntry("quality_type")
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = activeQualityChanged)
|
||||
def activeQualityChangesId(self):
|
||||
if self._global_container_stack:
|
||||
changes = self._global_container_stack.findContainer(type = "quality_changes")
|
||||
if changes:
|
||||
return changes.getId()
|
||||
return ""
|
||||
|
||||
## Check if a container is read_only
|
||||
@pyqtSlot(str, result = bool)
|
||||
def isReadOnly(self, container_id):
|
||||
|
|
|
@ -22,7 +22,7 @@ Menu
|
|||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeQualityId == model.id
|
||||
checked: Cura.MachineManager.activeQualityChangesId == "empty_quality_changes" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ Menu
|
|||
id: customProfileInstantiator
|
||||
model: UM.InstanceContainersModel
|
||||
{
|
||||
filter: menu.getFilter({ "type": "quality_changes", "extruder": null });
|
||||
filter: { "type": "quality_changes", "extruder": null, "definition": Cura.MachineManager.filterQualityByMachine ? Cura.MachineManager.activeDefinitionId : "fdmprinter" };
|
||||
onModelReset: customSeparator.visible = rowCount() > 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue