Add warning icon when not all extruders have same intent

CURA-6601
This commit is contained in:
Jaime van Kessel 2019-09-26 16:26:55 +02:00
parent eced1fe907
commit b19e7cd027
No known key found for this signature in database
GPG key ID: 3710727397403C91
3 changed files with 67 additions and 1 deletions

View file

@ -627,6 +627,24 @@ class MachineManager(QObject):
intent_category = category
return intent_category
# Provies a list of extruder positions that have a different intent from the active one.
@pyqtProperty("QStringList", notify=activeIntentChanged)
def extruderPositionsWithNonActiveIntent(self):
global_container_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
if not global_container_stack:
return []
active_intent_category = self.activeIntentCategory
result = []
for extruder in global_container_stack.extruderList:
category = extruder.intent.getMetaDataEntry("intent_category", "default")
if category != active_intent_category:
result.append(str(int(extruder.getMetaDataEntry("position")) + 1))
return result
## Returns whether there is anything unsupported in the current set-up.
#
# The current set-up signifies the global stack and all extruder stacks,