mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 06:45:09 -06:00
use resolveOrValue for adhesion_type. contributes to CURA-2232
This commit is contained in:
parent
f435dcd896
commit
03c66e6e62
3 changed files with 48 additions and 65 deletions
|
@ -143,9 +143,7 @@ class ExtruderManager(QObject):
|
|||
|
||||
# Make sure the next stack is a stack that contains only the machine definition
|
||||
if not extruder_train.getNextStack():
|
||||
shallow_stack = UM.Settings.ContainerStack(machine_id + "_shallow")
|
||||
shallow_stack.addContainer(machine_definition)
|
||||
extruder_train.setNextStack(shallow_stack)
|
||||
extruder_train.setNextStack(UM.Application.getInstance().getGlobalContainerStack())
|
||||
changed = True
|
||||
if changed:
|
||||
self.extrudersChanged.emit(machine_id)
|
||||
|
@ -264,9 +262,7 @@ class ExtruderManager(QObject):
|
|||
|
||||
# Make sure the next stack is a stack that contains only the machine definition
|
||||
if not container_stack.getNextStack():
|
||||
shallow_stack = UM.Settings.ContainerStack(machine_id + "_shallow")
|
||||
shallow_stack.addContainer(machine_definition)
|
||||
container_stack.setNextStack(shallow_stack)
|
||||
container_stack.setNextStack(UM.Application.getInstance().getGlobalContainerStack())
|
||||
|
||||
container_registry.addContainer(container_stack)
|
||||
|
||||
|
|
|
@ -245,20 +245,7 @@ class MachineManager(QObject):
|
|||
|
||||
def _onPropertyChanged(self, key, property_name):
|
||||
if property_name == "value":
|
||||
# If a setting is not settable per extruder, but "has enabled" or "value" relations that are settable per extruder
|
||||
# we need to copy the value to global, so that the front-end displays the right settings.
|
||||
if not self._active_container_stack.getProperty(key, "settable_per_extruder"):
|
||||
relations = self._global_container_stack.getBottom()._getDefinition(key).relations
|
||||
for relation in filter(lambda r: (r.role == "enabled" or r.role == "value") and r.type == RelationType.RequiredByTarget, relations):
|
||||
# Target setting is settable per extruder
|
||||
if self._active_container_stack.getProperty(relation.target.key, "settable_per_extruder"):
|
||||
new_value = self._global_container_stack.getProperty(key, "value")
|
||||
stacks = [stack for stack in ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId())]
|
||||
for extruder_stack in stacks:
|
||||
if extruder_stack.getProperty(key, "value") != new_value:
|
||||
extruder_stack.getTop().setProperty(key, "value", new_value)
|
||||
break
|
||||
|
||||
# Notify UI items, such as the "changed" star in profile pull down menu.
|
||||
self.activeStackValueChanged.emit()
|
||||
|
||||
if property_name == "validationState":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue