Fix selection for intents if only one of the extruders has an intent

CURA-6598
This commit is contained in:
Jaime van Kessel 2019-09-19 09:54:47 +02:00
parent 49276db073
commit 884a3ea819
No known key found for this signature in database
GPG key ID: 3710727397403C91
2 changed files with 22 additions and 3 deletions

View file

@ -615,10 +615,15 @@ class MachineManager(QObject):
@pyqtProperty(str, notify=activeIntentChanged)
def activeIntentCategory(self):
global_container_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
if not self._active_container_stack:
if not global_container_stack:
return ""
intent_category = self._active_container_stack.intent.getMetaDataEntry("intent_category", "default")
intent_category = "default"
for extruder in global_container_stack.extruderList:
category = extruder.intent.getMetaDataEntry("intent_category", "default")
if category != "default" and category != intent_category:
intent_category = category
return intent_category
## Returns whether there is anything unsupported in the current set-up.