Also show warning icon when the set-up on other extruders is unsupported

So I added a function that checks the support on all extruders and the global stack.

Contributes to issue CURA-4148.
This commit is contained in:
Ghostkeeper 2017-08-25 14:27:45 +02:00
parent 165665247f
commit 585c04dfaa
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
2 changed files with 18 additions and 1 deletions

View file

@ -659,6 +659,23 @@ class MachineManager(QObject):
return Util.parseBool(quality.getMetaDataEntry("supported", True))
return False
## Returns whether there is anything unsupported in the current set-up.
#
# The current set-up signifies the global stack and all extruder stacks,
# so this indicates whether there is any container in any of the container
# stacks that is not marked as supported.
@pyqtProperty(bool, notify = activeQualityChanged)
def isCurrentSetupSupported(self) -> bool:
if not self._global_container_stack:
return False
for stack in [self._global_container_stack] + list(self._global_container_stack.extruders.values()):
for container in stack.getContainers():
if not container:
return False
if not Util.parseBool(container.getMetaDataEntry("supported", True)):
return False
return True
## Get the Quality ID associated with the currently active extruder
# Note that this only returns the "quality", not the "quality_changes"
# \returns QualityID (string) if found, empty string otherwise