Ensure that enabling & disabling an extruder gets handled correctly

CURA-6775
This commit is contained in:
Jaime van Kessel 2019-09-19 14:54:58 +02:00
parent 3730ea247d
commit 3e474c1107
No known key found for this signature in database
GPG Key ID: 3710727397403C91
2 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class IntentModel(ListModel):
machine_manager = cura.CuraApplication.CuraApplication.getInstance().getMachineManager()
machine_manager.globalContainerChanged.connect(self._update)
machine_manager.extruderChanged.connect(self._update) # We also need to update if an extruder gets disabled
ContainerRegistry.getInstance().containerAdded.connect(self._onChanged)
ContainerRegistry.getInstance().containerRemoved.connect(self._onChanged)
self._layer_height_unit = "" # This is cached
@ -74,6 +75,8 @@ class IntentModel(ListModel):
active_extruder = None
for extruder in global_stack.extruderList:
if not extruder.isEnabled:
continue
if extruder.intent.getMetaDataEntry("intent_category", "default") == "default":
if active_extruder is None:
active_extruder = extruder # If there is no extruder found and the intent is default, use that.

View File

@ -1289,6 +1289,8 @@ class MachineManager(QObject):
category = "default"
for extruder in global_stack.extruderList:
if not extruder.isEnabled:
continue
current_category = extruder.intent.getMetaDataEntry("intent_category", "default")
if current_category != "default" and current_category != category:
category = current_category