mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Emit propertiesChanged on the global stack from the extruder stack
But only when the setting that changed has a relation that is not settable per extruder. Fixes CURA-3521
This commit is contained in:
parent
458c9ac540
commit
95b825a4c5
1 changed files with 18 additions and 0 deletions
|
@ -25,6 +25,8 @@ class ExtruderStack(CuraContainerStack):
|
||||||
|
|
||||||
self.addMetaDataEntry("type", "extruder_train") # For backward compatibility
|
self.addMetaDataEntry("type", "extruder_train") # For backward compatibility
|
||||||
|
|
||||||
|
self.propertiesChanged.connect(self._onPropertiesChanged)
|
||||||
|
|
||||||
## Overridden from ContainerStack
|
## Overridden from ContainerStack
|
||||||
#
|
#
|
||||||
# This will set the next stack and ensure that we register this stack as an extruder.
|
# This will set the next stack and ensure that we register this stack as an extruder.
|
||||||
|
@ -85,6 +87,22 @@ class ExtruderStack(CuraContainerStack):
|
||||||
if stacks:
|
if stacks:
|
||||||
self.setNextStack(stacks[0])
|
self.setNextStack(stacks[0])
|
||||||
|
|
||||||
|
def _onPropertiesChanged(self, key, properties):
|
||||||
|
# When there is a setting that is not settable per extruder that depends on a value from a setting that is,
|
||||||
|
# we do not always get properly informed that we should re-evaluate the setting. So make sure to indicate
|
||||||
|
# something changed for those settings.
|
||||||
|
definitions = self.getNextStack().definition.findDefinitions(key = key)
|
||||||
|
if definitions:
|
||||||
|
has_global_dependencies = False
|
||||||
|
for relation in definitions[0].relations:
|
||||||
|
if not getattr(relation.target, "settable_per_extruder", True):
|
||||||
|
has_global_dependencies = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if has_global_dependencies:
|
||||||
|
self.getNextStack().propertiesChanged.emit(key, properties)
|
||||||
|
|
||||||
|
|
||||||
extruder_stack_mime = MimeType(
|
extruder_stack_mime = MimeType(
|
||||||
name = "application/x-cura-extruderstack",
|
name = "application/x-cura-extruderstack",
|
||||||
comment = "Cura Extruder Stack",
|
comment = "Cura Extruder Stack",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue