Avoid replacing machine_settings and not settable_per_extruder settings

This commit is contained in:
Guillem 2018-03-19 14:21:45 +01:00
parent 1bb5b8ff3e
commit 18fba5b529

View file

@ -553,14 +553,15 @@ class MachineManager(QObject):
## Copy the value of all settings of the current extruder to all other extruders as well as the global container. ## Copy the value of all settings of the current extruder to all other extruders as well as the global container.
@pyqtSlot() @pyqtSlot()
def copyAllValuesToExtruders(self): def copyAllValuesToExtruders(self):
for key in self._active_container_stack.getAllKeys(): for key in self._active_container_stack.getAllKeys() - set([machine_setting.key for machine_setting in self._active_container_stack.getProperty("machine_settings", "children")]):
new_value = self._active_container_stack.getProperty(key, "value") if self._active_container_stack.getProperty(key, "settable_per_extruder"):
extruder_stacks = [stack for stack in ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId())] new_value = self._active_container_stack.getProperty(key, "value")
extruder_stacks = [stack for stack in ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId())]
# check in which stack the value has to be replaced # check in which stack the value has to be replaced
for extruder_stack in extruder_stacks: for extruder_stack in extruder_stacks:
if extruder_stack != self._active_container_stack and extruder_stack.getProperty(key, "value") != new_value: if extruder_stack != self._active_container_stack and extruder_stack.getProperty(key, "value") != new_value:
extruder_stack.userChanges.setProperty(key, "value", new_value) # TODO: nested property access, should be improved extruder_stack.userChanges.setProperty(key, "value", new_value) # TODO: nested property access, should be improved
@pyqtProperty(str, notify = activeVariantChanged) @pyqtProperty(str, notify = activeVariantChanged)
def activeVariantName(self) -> str: def activeVariantName(self) -> str: