From 3adf7d49d017bd16b26de0f6cc1c41cf32260642 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 5 Apr 2019 10:51:06 +0200 Subject: [PATCH 1/5] Switch to the first enabled extruder after setActiveMachine CURA-5930 --- cura/Settings/MachineManager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 3cee636d1d..87f16888cf 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -362,7 +362,6 @@ class MachineManager(QObject): # Mark global stack as invalid ConfigurationErrorMessage.getInstance().addFaultyContainers(global_stack.getId()) return # We're done here - ExtruderManager.getInstance().setActiveExtruderIndex(0) # Switch to first extruder self._global_container_stack = global_stack self._application.setGlobalContainerStack(global_stack) @@ -370,6 +369,11 @@ class MachineManager(QObject): self._initMachineState(global_stack) self._onGlobalContainerChanged() + # Switch to the first enabled extruder + self.updateDefaultExtruder() + default_extruder_position = int(self.defaultExtruderPosition) + ExtruderManager.getInstance().setActiveExtruderIndex(default_extruder_position) + self.__emitChangedSignals() ## Given a definition id, return the machine with this id. From 8fb3a73c3a460f2db87a8fc703223213a12f17e2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 8 Apr 2019 09:40:38 +0200 Subject: [PATCH 2/5] Use boundingBoxChanged signal to recompute convex hull The boundingbox is the signal we should be listening for, since it does the same as the previous ones (and more!). This also fixes the issue that group nodes didn't get their convex hull set correctly on first creation CURA-6416 --- cura/Scene/ConvexHullDecorator.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py index da71f6920e..1aae97942a 100644 --- a/cura/Scene/ConvexHullDecorator.py +++ b/cura/Scene/ConvexHullDecorator.py @@ -60,13 +60,11 @@ class ConvexHullDecorator(SceneNodeDecorator): previous_node = self._node # Disconnect from previous node signals if previous_node is not None and node is not previous_node: - previous_node.transformationChanged.disconnect(self._onChanged) - previous_node.parentChanged.disconnect(self._onChanged) + previous_node.boundingBoxChanged.disconnect(self._onChanged) super().setNode(node) - # Mypy doesn't understand that self._node is no longer optional, so just use the node. - node.transformationChanged.connect(self._onChanged) - node.parentChanged.connect(self._onChanged) + + node.boundingBoxChanged.connect(self._onChanged) self._onChanged() From 0bad57259c866c2e5abc1e05a3e4398df3760822 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 8 Apr 2019 13:27:30 +0200 Subject: [PATCH 3/5] Increased the font size of notification icon to make it more readable CURA-6151 --- resources/qml/Widgets/NotificationIcon.qml | 8 ++++++-- resources/themes/cura-light/theme.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/qml/Widgets/NotificationIcon.qml b/resources/qml/Widgets/NotificationIcon.qml index d06d9f16be..5cf4d17777 100644 --- a/resources/qml/Widgets/NotificationIcon.qml +++ b/resources/qml/Widgets/NotificationIcon.qml @@ -25,12 +25,16 @@ Rectangle Label { id: notificationLabel - anchors.centerIn: parent anchors.fill: parent color: UM.Theme.getColor("primary_text") horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("small") + font: UM.Theme.getFont("default") renderType: Text.NativeRendering + + // This is a bit of a hack, but we don't really have enough room for 2 characters (eg 9+). The default font + // does have a tad bit to much spacing. So instead of adding a whole new font, we just modify it a bit for this + // specific instance. + Component.onCompleted: font.letterSpacing = -1 } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index f287e60310..4b2f92e6e5 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -604,7 +604,7 @@ "toolbox_action_button": [8.0, 2.5], "toolbox_loader": [2.0, 2.0], - "notification_icon": [1.4, 1.4], + "notification_icon": [1.5, 1.5], "avatar_image": [6.8, 6.8], From cbfe10a748ae6caf2abb2da19d7c7351587e7c04 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 8 Apr 2019 13:36:48 +0200 Subject: [PATCH 4/5] Prevent a zeroDivision error from crashing the usb printing This fixes #5592 --- plugins/USBPrinting/USBPrinterOutputDevice.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 0c195e9017..667a969e87 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -371,10 +371,17 @@ class USBPrinterOutputDevice(PrinterOutputDevice): self._sendCommand("N%d%s*%d" % (self._gcode_position, line, checksum)) - progress = (self._gcode_position / len(self._gcode)) + print_job = self._printers[0].activePrintJob + try: + progress = self._gcode_position / len(self._gcode) + except ZeroDivisionError: + # There is nothing to send! + if print_job is not None: + print_job.updateState("error") + return elapsed_time = int(time() - self._print_start_time) - print_job = self._printers[0].activePrintJob + if print_job is None: controller = GenericOutputController(self) controller.setCanUpdateFirmware(True) From 2a7df3ceddbc568404e2b9c387f24fa6c66b1756 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 8 Apr 2019 13:45:09 +0200 Subject: [PATCH 5/5] Fix untranslated string Contributes to CL-1302 --- plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index 8c63e1ef1a..aa4893b3b9 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -140,7 +140,7 @@ Item { id: printerConfiguration anchors.verticalCenter: parent.verticalCenter - buildplate: printer ? "Glass" : null // 'Glass' as a default + buildplate: printer ? catalog.i18nc("@label", "Glass") : null // 'Glass' as a default configurations: { var configs = []