From a8173344a3f61f9a13c6e9f678810d2d783d1183 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 31 May 2018 14:45:57 +0200 Subject: [PATCH 01/10] Hidden materials --- plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml | 2 ++ plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml index e1ffc6326c..05186b961d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml @@ -12,6 +12,7 @@ Column height: childrenRect.height width: parent.width spacing: UM.Theme.getSize("default_margin").height + /* Hidden for 3.4 Label { id: heading @@ -20,6 +21,7 @@ Column color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") } + */ GridLayout { id: grid diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index 9d916182f6..bb0f6fe346 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -65,6 +65,7 @@ ScrollView } } } + /* Hidden in 3.4 Label { visible: toolbox.materialsInstalledModel.items.length > 0 @@ -102,5 +103,6 @@ ScrollView } } } + */ } } From 3fefdad14be57092abdae453e4685a9476f9995b Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 31 May 2018 15:22:49 +0200 Subject: [PATCH 02/10] Round margins CURA-5435 --- plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index 78c970659c..ebd4d979f6 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -40,9 +40,9 @@ Item Column { id: pluginInfo - topPadding: UM.Theme.getSize("default_margin").height / 2 + topPadding: Math.floor(UM.Theme.getSize("default_margin").height / 2) property var color: model.type === "plugin" && !isEnabled ? UM.Theme.getColor("lining") : UM.Theme.getColor("text") - width: tileRow.width - (authorInfo.width + pluginActions.width + 2 * tileRow.spacing + ((disableButton.visible) ? disableButton.width + tileRow.spacing : 0)) + width: Math.floor(tileRow.width - (authorInfo.width + pluginActions.width + 2 * tileRow.spacing + ((disableButton.visible) ? disableButton.width + tileRow.spacing : 0))) Label { text: model.name From 30cbdfed6952df393f2390cff1f42cc06ea7d7c2 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 31 May 2018 14:50:29 +0200 Subject: [PATCH 03/10] Make sure that file extensions are always lowered CURA-5367 --- cura/CuraApplication.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 34b6b5cde1..e416196775 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1572,10 +1572,11 @@ class CuraApplication(QtApplication): f = file.toLocalFile() extension = os.path.splitext(f)[1] + extension = extension.lower() filename = os.path.basename(f) if len(self._currently_loading_files) > 0: # If a non-slicable file is already being loaded, we prevent loading of any further non-slicable files - if extension.lower() in self._non_sliceable_extensions: + if extension in self._non_sliceable_extensions: message = Message( self._i18n_catalog.i18nc("@info:status", "Only one G-code file can be loaded at a time. Skipped importing {0}", @@ -1584,7 +1585,8 @@ class CuraApplication(QtApplication): return # If file being loaded is non-slicable file, then prevent loading of any other files extension = os.path.splitext(self._currently_loading_files[0])[1] - if extension.lower() in self._non_sliceable_extensions: + extension = extension.lower() + if extension in self._non_sliceable_extensions: message = Message( self._i18n_catalog.i18nc("@info:status", "Can't open any other file if G-code is loading. Skipped importing {0}", From bb313c45a9465d4097b3b4d3a31ed6f99ceca278 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 31 May 2018 16:25:56 +0200 Subject: [PATCH 04/10] Set job name to "unnamed" if user types in nothing CURA-5367 --- resources/qml/JobSpecs.qml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index f9ce286706..6cd9999db7 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -81,10 +81,9 @@ Item { text: PrintInformation.jobName horizontalAlignment: TextInput.AlignRight onEditingFinished: { - PrintInformation.setJobName(text, true); - if (printJobTextfield.text != ''){ - printJobTextfield.focus = false; - } + text = text == "" ? "unnamed" : text; + PrintInformation.setJobName(printJobTextfield.text, true); + printJobTextfield.focus = false; } validator: RegExpValidator { regExp: /^[^\\ \/ \*\?\|\[\]]*$/ From bc1fa5c3f9b361ca7f0c764eea5dab7b56fbb9df Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 1 Jun 2018 09:38:37 +0200 Subject: [PATCH 05/10] CURA-5435 Attempt to fix "wobbly" text --- plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index ebd4d979f6..b16564fdd2 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -16,7 +16,7 @@ Item { color: UM.Theme.getColor("lining") width: parent.width - height: UM.Theme.getSize("default_lining").height + height: Math.floor(UM.Theme.getSize("default_lining").height) anchors.bottom: parent.bottom } Row @@ -47,7 +47,7 @@ Item { text: model.name width: parent.width - height: UM.Theme.getSize("toolbox_property_label").height + height: Math.floor(UM.Theme.getSize("toolbox_property_label").height) wrapMode: Text.WordWrap font: UM.Theme.getFont("default_bold") color: pluginInfo.color @@ -81,7 +81,7 @@ Item } } width: parent.width - height: UM.Theme.getSize("toolbox_property_label").height + height: Math.floor(UM.Theme.getSize("toolbox_property_label").height) wrapMode: Text.WordWrap verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft From 9b5369a5b1b3b27bd9bdc5b393797980caa2a459 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 1 Jun 2018 09:38:45 +0200 Subject: [PATCH 06/10] Revert "CURA-5435 Attempt to fix "wobbly" text" This reverts commit bc1fa5c3f9b361ca7f0c764eea5dab7b56fbb9df. --- plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index b16564fdd2..ebd4d979f6 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -16,7 +16,7 @@ Item { color: UM.Theme.getColor("lining") width: parent.width - height: Math.floor(UM.Theme.getSize("default_lining").height) + height: UM.Theme.getSize("default_lining").height anchors.bottom: parent.bottom } Row @@ -47,7 +47,7 @@ Item { text: model.name width: parent.width - height: Math.floor(UM.Theme.getSize("toolbox_property_label").height) + height: UM.Theme.getSize("toolbox_property_label").height wrapMode: Text.WordWrap font: UM.Theme.getFont("default_bold") color: pluginInfo.color @@ -81,7 +81,7 @@ Item } } width: parent.width - height: Math.floor(UM.Theme.getSize("toolbox_property_label").height) + height: UM.Theme.getSize("toolbox_property_label").height wrapMode: Text.WordWrap verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft From cca51cb74b8befea5cab8d078587d06c1b952bcc Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 1 Jun 2018 09:39:04 +0200 Subject: [PATCH 07/10] Revert "Revert "CURA-5435 Attempt to fix "wobbly" text"" This reverts commit 9b5369a5b1b3b27bd9bdc5b393797980caa2a459. --- plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index ebd4d979f6..b16564fdd2 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -16,7 +16,7 @@ Item { color: UM.Theme.getColor("lining") width: parent.width - height: UM.Theme.getSize("default_lining").height + height: Math.floor(UM.Theme.getSize("default_lining").height) anchors.bottom: parent.bottom } Row @@ -47,7 +47,7 @@ Item { text: model.name width: parent.width - height: UM.Theme.getSize("toolbox_property_label").height + height: Math.floor(UM.Theme.getSize("toolbox_property_label").height) wrapMode: Text.WordWrap font: UM.Theme.getFont("default_bold") color: pluginInfo.color @@ -81,7 +81,7 @@ Item } } width: parent.width - height: UM.Theme.getSize("toolbox_property_label").height + height: Math.floor(UM.Theme.getSize("toolbox_property_label").height) wrapMode: Text.WordWrap verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft From a4b46be2c58ce6641b3ac2f21f400a32ae84efd9 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 1 Jun 2018 12:58:08 +0200 Subject: [PATCH 08/10] CURA-5427 Force the material models to update when the machine changes and so when the extruder stack changes. - What happen was that when the extruder model needed to update, the material model was not updated correctly and so when changing a material, the node was incorrect. --- cura/Machines/Models/BaseMaterialsModel.py | 6 +++++- resources/qml/Menus/MaterialMenu.qml | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cura/Machines/Models/BaseMaterialsModel.py b/cura/Machines/Models/BaseMaterialsModel.py index 0a1337feeb..4759c8b5b0 100644 --- a/cura/Machines/Models/BaseMaterialsModel.py +++ b/cura/Machines/Models/BaseMaterialsModel.py @@ -39,6 +39,8 @@ class BaseMaterialsModel(ListModel): self._extruder_position = 0 self._extruder_stack = None + # Update the stack and the model data when the machine changes + self._machine_manager.globalContainerChanged.connect(self._updateExtruderStack) def _updateExtruderStack(self): global_stack = self._machine_manager.activeMachine @@ -50,9 +52,11 @@ class BaseMaterialsModel(ListModel): self._extruder_stack = global_stack.extruders.get(str(self._extruder_position)) if self._extruder_stack is not None: self._extruder_stack.pyqtContainersChanged.connect(self._update) + # Force update the model when the extruder stack changes + self._update() def setExtruderPosition(self, position: int): - if self._extruder_position != position: + if self._extruder_stack is None or self._extruder_position != position: self._extruder_position = position self._updateExtruderStack() self.extruderPositionChanged.emit() diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index d81e0c86c3..64b3130724 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -63,8 +63,7 @@ Menu exclusiveGroup: group onTriggered: { - var activeExtruderIndex = Cura.ExtruderManager.activeExtruderIndex; - Cura.MachineManager.setMaterial(activeExtruderIndex, model.container_node); + Cura.MachineManager.setMaterial(extruderIndex, model.container_node); } } onObjectAdded: brandMaterialsMenu.insertItem(index, object) From 85560abca308dce140671e4c5a3364ea1507207c Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 1 Jun 2018 13:26:14 +0200 Subject: [PATCH 09/10] CURA-5439 Show the keep or discard changes dialog also when the user applies a configuration using the Sync button. --- cura/Settings/MachineManager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 5c87b6ffba..723bf91d0d 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1280,6 +1280,10 @@ class MachineManager(QObject): self._global_container_stack.variant = self._empty_variant_container self._updateQualityWithMaterial() + # See if we need to show the Discard or Keep changes screen + if self.hasUserSettings and Preferences.getInstance().getValue("cura/active_mode") == 1: + self._application.discardOrKeepProfileChanges() + ## Find all container stacks that has the pair 'key = value' in its metadata and replaces the value with 'new_value' def replaceContainersMetadata(self, key: str, value: str, new_value: str) -> None: machines = ContainerRegistry.getInstance().findContainerStacks(type = "machine") From a0263676e1305c2cc4b778ed5cfb7215e938705a Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 1 Jun 2018 13:36:50 +0200 Subject: [PATCH 10/10] The prepare button slices, so it should be a slice button --- resources/qml/SaveButton.qml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index 0369f492b4..77537b0af2 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -100,8 +100,8 @@ Item { if (saveToButton.enabled) { saveToButton.clicked(); } - // prepare button - if (prepareButton.enabled) { + // slice button + if (sliceButton.enabled) { sliceOrStopSlicing(); } } @@ -131,7 +131,7 @@ Item { Row { id: additionalComponentsRow anchors.top: parent.top - anchors.right: saveToButton.visible ? saveToButton.left : (prepareButton.visible ? prepareButton.left : parent.right) + anchors.right: saveToButton.visible ? saveToButton.left : (sliceButton.visible ? sliceButton.left : parent.right) anchors.rightMargin: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width @@ -159,14 +159,14 @@ Item { onPreferenceChanged: { var autoSlice = UM.Preferences.getValue("general/auto_slice"); - prepareButton.autoSlice = autoSlice; + sliceButton.autoSlice = autoSlice; saveToButton.autoSlice = autoSlice; } } - // Prepare button, only shows if auto_slice is off + // Slice button, only shows if auto_slice is off Button { - id: prepareButton + id: sliceButton tooltip: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@info:tooltip","Slice current printjob") : catalog.i18nc("@info:tooltip","Cancel slicing process") // 1 = not started, 2 = Processing @@ -180,7 +180,7 @@ Item { anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width // 1 = not started, 4 = error, 5 = disabled - text: [1, 4, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel") + text: [1, 4, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@label:Printjob", "Slice") : catalog.i18nc("@label:Printjob", "Cancel") onClicked: { sliceOrStopSlicing();