Replace only user changed values

removed machine_settings and settable_per_extruder_check. Not needed.
This commit is contained in:
Guillem 2018-03-19 14:57:31 +01:00
parent 18fba5b529
commit faf8ed3ba6
2 changed files with 8 additions and 9 deletions

View file

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