From c9ee7afcb8cc2f0fbc195e0eea90b489529b6804 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 13 Oct 2016 11:31:07 +0200 Subject: [PATCH 1/4] Remove superfluous if statement CURA-2600 --- cura/Settings/MachineManager.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 342ef8b450..1e7fc19c3e 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -148,8 +148,7 @@ class MachineManager(QObject): if matching_extruder and matching_extruder.findContainer({"type": "material"}).getMetaDataEntry("GUID") != material_id: # Save the material that needs to be changed. Multiple changes will be handled by the callback. - if matching_extruder: - variant_container = matching_extruder.findContainer({"type": "variant"}) + variant_container = matching_extruder.findContainer({"type": "variant"}) if self._global_container_stack.getBottom().getMetaDataEntry("has_variants") and variant_container: variant_id = self.getQualityVariantId(self._global_container_stack.getBottom(), variant_container) for container in containers: From fe60b2fab8845be3d904ceda160b7abcdb1f475d Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 13 Oct 2016 13:18:51 +0200 Subject: [PATCH 2/4] Add missing elide for "Print Setup" label And fix some code style --- resources/qml/Sidebar.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 036f1283cc..22815c8b66 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -186,20 +186,21 @@ Rectangle Label { id: settingsModeLabel - text: catalog.i18nc("@label:listbox","Print Setup"); + text: catalog.i18nc("@label:listbox", "Print Setup"); anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width; anchors.top: headerSeparator.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - width: parent.width/100*45 + width: parent.width * 0.45 - 2 * UM.Theme.getSize("default_margin").width font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") visible: !monitoringPrint + elide: Text.ElideRight } Rectangle { id: settingsModeSelection - width: parent.width/100*55 + width: parent.width * 0.55 height: UM.Theme.getSize("sidebar_header_mode_toggle").height anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("default_margin").width @@ -262,7 +263,7 @@ Rectangle anchors.leftMargin: UM.Theme.getSize("default_margin").width; anchors.top: headerSeparator.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - width: parent.width/100*45 + width: parent.width * 0.45 font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") visible: monitoringPrint From 79a62ec45f4a1ee1852b8f65dd92bed1597c677f Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Thu, 13 Oct 2016 13:48:15 +0200 Subject: [PATCH 3/4] Only reset the setting for the currently selected extruder. CURA-2640 Restore to default not per extruder --- cura/Settings/MachineManager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 1e7fc19c3e..bf51699300 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -387,7 +387,8 @@ class MachineManager(QObject): top_container.removeInstance(key, postpone_emit=True) send_emits_containers.append(top_container) - for stack in ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()): + stack = ExtruderManager.getInstance().getActiveExtruderStack() + if stack: container = stack.getTop() container.removeInstance(key, postpone_emit=True) send_emits_containers.append(container) From 8b487130d25a16def725e822d70523aef4296494 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Thu, 13 Oct 2016 14:33:29 +0200 Subject: [PATCH 4/4] Take 'linked' settings into account when reverting. CURA-2640 Restore to default not per extruder --- cura/Settings/MachineManager.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index bf51699300..0487f75de9 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -387,8 +387,16 @@ class MachineManager(QObject): top_container.removeInstance(key, postpone_emit=True) send_emits_containers.append(top_container) - stack = ExtruderManager.getInstance().getActiveExtruderStack() - if stack: + linked = not self._global_container_stack.getProperty(key, "settable_per_extruder") or \ + self._global_container_stack.getProperty(key, "limit_to_extruder") != "-1" + + if not linked: + stack = ExtruderManager.getInstance().getActiveExtruderStack() + stacks = [stack] + else: + stacks = ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()) + + for stack in stacks: container = stack.getTop() container.removeInstance(key, postpone_emit=True) send_emits_containers.append(container)