diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 35ca6b7cbb..1071cfeebd 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -24,6 +24,7 @@ class PrinterOutputDevice(QObject, OutputDevice): def __init__(self, device_id, parent = None): super().__init__(device_id = device_id, parent = parent) + self._container_registry = UM.Settings.ContainerRegistry.getInstance() self._target_bed_temperature = 0 self._bed_temperature = 0 self._num_extruders = 1 @@ -276,6 +277,21 @@ class PrinterOutputDevice(QObject, OutputDevice): def materialIds(self): return self._material_ids + @pyqtProperty("QVariantList", notify = materialIdChanged) + def materialNames(self): + result = [] + for material_id in self._material_ids: + if material_id is None: + result.append(i18n_catalog.i18nc("@item:material", "No material loaded")) + continue + + containers = self._container_registry.findInstanceContainers(type = "material", guid = material_id) + if containers: + result.append(containers[0].getName()) + else: + result.append(i18n_catalog.i18nc("@item:material", "Unknown material")) + return result + ## Protected setter for the current material id. # /param index Index of the extruder # /param material_id id of the material diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 1324f3ab60..f2967c7797 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -361,6 +361,18 @@ class MachineManager(QObject): return False + ## Delete a user setting from the global stack and all extruder stacks. + # \param key \type{str} the name of the key to delete + @pyqtSlot(str) + def clearUserSettingAllCurrentStacks(self, key): + if not self._global_container_stack: + return + + self._global_container_stack.getTop().removeInstance(key) + + for stack in ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()): + stack.getTop().removeInstance(key) + ## Check if the global profile does not contain error states # Note that the _active_stack_valid is cached due to performance issues # Calling _checkStackForErrors on every change is simply too expensive diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 801f4797dd..555b7cf8a7 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -15,6 +15,7 @@ from UM.Logger import Logger from UM.Scene.SceneNode import SceneNode from UM.View.RenderBatch import RenderBatch from UM.View.GL.OpenGL import OpenGL +from UM.Message import Message from cura.ConvexHullNode import ConvexHullNode @@ -54,6 +55,8 @@ class LayerView(View): self._only_show_top_layers = bool(Preferences.getInstance().getValue("view/only_show_top_layers")) self._busy = False + self.wireprint_warning_message = Message(catalog.i18nc("@info:status", "Cura does not accurately display layers when Wire Printing is enabled")) + def getActivity(self): return self._activity diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index cdc557a089..671f35f782 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -179,8 +179,8 @@ Item { iconSource: UM.Theme.getIcon("reset") onClicked: { - revertButton.focus = true - propertyProvider.removeFromContainer(0) + revertButton.focus = true; + Cura.MachineManager.clearUserSettingAllCurrentStacks(propertyProvider.key); } onEntered: { hoverTimer.stop(); base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile.")) }