diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 54abaca86e..c25b58fbcf 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -597,6 +597,18 @@ class MachineManager(QObject): 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 + ## Copy the value of all manually changed settings of the current extruder to all other extruders. + @pyqtSlot() + def copyAllValuesToExtruders(self): + extruder_stacks = list(self._global_container_stack.extruders.values()) + for extruder_stack in extruder_stacks: + if extruder_stack != self._active_container_stack: + for key in self._active_container_stack.userChanges.getAllKeys(): + new_value = self._active_container_stack.getProperty(key, "value") + + # check if the value has to be replaced + extruder_stack.userChanges.setProperty(key, "value", new_value) + @pyqtProperty(str, notify = activeVariantChanged) def activeVariantName(self) -> str: if self._active_container_stack: diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 199db1bbaa..4a919ab9bd 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -533,6 +533,15 @@ Item onTriggered: Cura.MachineManager.copyValueToExtruders(contextMenu.key) } + MenuItem + { + //: Settings context menu action + text: catalog.i18nc("@action:menu", "Copy all changed values to all extruders") + visible: machineExtruderCount.properties.value > 1 + enabled: contextMenu.provider != undefined + onTriggered: Cura.MachineManager.copyAllValuesToExtruders() + } + MenuSeparator { visible: machineExtruderCount.properties.value > 1