From 6cd3a5fe3d627f877652fe45b35079f91acfae82 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 31 Jan 2019 15:05:27 +0100 Subject: [PATCH 01/12] Show correct printer name in selector-header on disconnect. [CURA-6153] --- cura/Settings/MachineManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index ae74d76734..5684e8d847 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -512,7 +512,7 @@ class MachineManager(QObject): @pyqtProperty(str, notify = globalContainerChanged) def activeMachineName(self) -> str: if self._global_container_stack: - return self._global_container_stack.getName() + return self._global_container_stack.getMetaDataEntry("connect_group_name", self._global_container_stack.getName()) return "" @pyqtProperty(str, notify = globalContainerChanged) From 954fdb20ad0eddef7b216642924b5f47471ab09d Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 31 Jan 2019 20:21:42 +0100 Subject: [PATCH 02/12] Rename 'connect_group_name' to 'group_name'. [CURA-6153] --- cura/GlobalStacksModel.py | 2 +- cura/Machines/Models/MachineManagementModel.py | 4 ++-- cura/Settings/MachineManager.py | 8 ++++---- plugins/3MFReader/ThreeMFWorkspaceReader.py | 2 +- plugins/UM3NetworkPrinting/src/DiscoverUM3Action.py | 10 +++++----- resources/qml/Menus/NetworkPrinterMenu.qml | 4 ++-- resources/qml/PrinterSelector/MachineSelectorList.qml | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cura/GlobalStacksModel.py b/cura/GlobalStacksModel.py index 406e7b6bb3..72144140b2 100644 --- a/cura/GlobalStacksModel.py +++ b/cura/GlobalStacksModel.py @@ -54,7 +54,7 @@ class GlobalStacksModel(ListModel): continue # TODO: Remove reference to connect group name. - items.append({"name": container_stack.getMetaDataEntry("connect_group_name", container_stack.getName()), + items.append({"name": container_stack.getMetaDataEntry("group_name", container_stack.getName()), "id": container_stack.getId(), "hasRemoteConnection": has_remote_connection, "metadata": container_stack.getMetaData().copy()}) diff --git a/cura/Machines/Models/MachineManagementModel.py b/cura/Machines/Models/MachineManagementModel.py index 7dc51f07f7..36f324dab7 100644 --- a/cura/Machines/Models/MachineManagementModel.py +++ b/cura/Machines/Models/MachineManagementModel.py @@ -52,14 +52,14 @@ class MachineManagementModel(ListModel): "um_network_key": "*", "hidden": "False"} self._network_container_stacks = ContainerRegistry.getInstance().findContainerStacks(**network_filter_printers) - self._network_container_stacks.sort(key = lambda i: i.getMetaDataEntry("connect_group_name")) + self._network_container_stacks.sort(key = lambda i: i.getMetaDataEntry("group_name")) for container in self._network_container_stacks: metadata = container.getMetaData().copy() if container.getBottom(): metadata["definition_name"] = container.getBottom().getName() - items.append({"name": metadata["connect_group_name"], + items.append({"name": metadata["group_name"], "id": container.getId(), "metadata": metadata, "group": catalog.i18nc("@info:title", "Network enabled printers")}) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 5684e8d847..b3bf3982e4 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -512,7 +512,7 @@ class MachineManager(QObject): @pyqtProperty(str, notify = globalContainerChanged) def activeMachineName(self) -> str: if self._global_container_stack: - return self._global_container_stack.getMetaDataEntry("connect_group_name", self._global_container_stack.getName()) + return self._global_container_stack.getMetaDataEntry("group_name", self._global_container_stack.getName()) return "" @pyqtProperty(str, notify = globalContainerChanged) @@ -558,7 +558,7 @@ class MachineManager(QObject): @pyqtProperty(str, notify = printerConnectedStatusChanged) def activeMachineNetworkGroupName(self) -> str: if self._global_container_stack: - return self._global_container_stack.getMetaDataEntry("connect_group_name", "") + return self._global_container_stack.getMetaDataEntry("group_name", "") return "" @pyqtProperty(QObject, notify = globalContainerChanged) @@ -1350,7 +1350,7 @@ class MachineManager(QObject): if not new_machine: return new_machine.setMetaDataEntry("um_network_key", self.activeMachineNetworkKey()) - new_machine.setMetaDataEntry("connect_group_name", self.activeMachineNetworkGroupName) + new_machine.setMetaDataEntry("group_name", self.activeMachineNetworkGroupName) new_machine.setMetaDataEntry("hidden", False) new_machine.setMetaDataEntry("connection_type", self._global_container_stack.getMetaDataEntry("connection_type")) else: @@ -1420,7 +1420,7 @@ class MachineManager(QObject): metadata_filter = {"um_network_key": self.activeMachineNetworkKey()} containers = CuraContainerRegistry.getInstance().findContainerStacks(type = "machine", **metadata_filter) for container in containers: - container.setMetaDataEntry("connect_group_name", group_name) + container.setMetaDataEntry("group_name", group_name) ## This method checks if there is an instance connected to the given network_key def existNetworkInstances(self, network_key: str) -> bool: diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 55296979b5..bf190f7e39 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -500,7 +500,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader): is_printer_group = False if machine_conflict: - group_name = existing_global_stack.getMetaDataEntry("connect_group_name") + group_name = existing_global_stack.getMetaDataEntry("group_name") if group_name is not None: is_printer_group = True machine_name = group_name diff --git a/plugins/UM3NetworkPrinting/src/DiscoverUM3Action.py b/plugins/UM3NetworkPrinting/src/DiscoverUM3Action.py index 7072aef4cc..ecc89b3948 100644 --- a/plugins/UM3NetworkPrinting/src/DiscoverUM3Action.py +++ b/plugins/UM3NetworkPrinting/src/DiscoverUM3Action.py @@ -106,13 +106,13 @@ class DiscoverUM3Action(MachineAction): global_container_stack = CuraApplication.getInstance().getGlobalContainerStack() if global_container_stack: meta_data = global_container_stack.getMetaData() - if "connect_group_name" in meta_data: - previous_connect_group_name = meta_data["connect_group_name"] - global_container_stack.setMetaDataEntry("connect_group_name", group_name) + if "group_name" in meta_data: + previous_connect_group_name = meta_data["group_name"] + global_container_stack.setMetaDataEntry("group_name", group_name) # Find all the places where there is the same group name and change it accordingly - CuraApplication.getInstance().getMachineManager().replaceContainersMetadata(key = "connect_group_name", value = previous_connect_group_name, new_value = group_name) + CuraApplication.getInstance().getMachineManager().replaceContainersMetadata(key = "group_name", value = previous_connect_group_name, new_value = group_name) else: - global_container_stack.setMetaDataEntry("connect_group_name", group_name) + global_container_stack.setMetaDataEntry("group_name", group_name) # Set the default value for "hidden", which is used when you have a group with multiple types of printers global_container_stack.setMetaDataEntry("hidden", False) diff --git a/resources/qml/Menus/NetworkPrinterMenu.qml b/resources/qml/Menus/NetworkPrinterMenu.qml index 41f3054e92..845159f3b2 100644 --- a/resources/qml/Menus/NetworkPrinterMenu.qml +++ b/resources/qml/Menus/NetworkPrinterMenu.qml @@ -14,9 +14,9 @@ Instantiator { property string connectGroupName: { - if("connect_group_name" in model.metadata) + if("group_name" in model.metadata) { - return model.metadata["connect_group_name"] + return model.metadata["group_name"] } return "" } diff --git a/resources/qml/PrinterSelector/MachineSelectorList.qml b/resources/qml/PrinterSelector/MachineSelectorList.qml index 5fd3515cd3..49d9d31f2b 100644 --- a/resources/qml/PrinterSelector/MachineSelectorList.qml +++ b/resources/qml/PrinterSelector/MachineSelectorList.qml @@ -38,7 +38,7 @@ ListView var result = Cura.MachineManager.activeMachineId == model.id if (Cura.MachineManager.activeMachineHasRemoteConnection) { - result |= Cura.MachineManager.activeMachineNetworkGroupName == model.metadata["connect_group_name"] + result |= Cura.MachineManager.activeMachineNetworkGroupName == model.metadata["group_name"] } return result } From 435c8deded9b824837dd5978c766489025b6115b Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 31 Jan 2019 20:25:21 +0100 Subject: [PATCH 03/12] Add 'connect_group_name' to 'group_name' rename to version-upgrade. [CURA-6153] --- .../VersionUpgrade35to40/VersionUpgrade35to40.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py b/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py index 52cd7cf3cb..1e665d8137 100644 --- a/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py +++ b/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py @@ -4,6 +4,7 @@ import io from UM.VersionUpgrade import VersionUpgrade from cura.PrinterOutputDevice import ConnectionType deleted_settings = {"bridge_wall_max_overhang"} # type: Set[str] +renamed_configurations = {"connect_group_name": "group_name"} # type: Dict[str, str] class VersionUpgrade35to40(VersionUpgrade): @@ -20,6 +21,13 @@ class VersionUpgrade35to40(VersionUpgrade): # Set the connection type if um_network_key or the octoprint key is set. parser["metadata"]["connection_type"] = str(ConnectionType.NetworkConnection.value) + if "metadata" in parser: + for old_name, new_name in renamed_configurations.items(): + if old_name not in parser["metadata"]: + continue + parser["metadata"][new_name] = parser["metadata"][old_name] + del parser["metadata"][old_name] + result = io.StringIO() parser.write(result) return [filename], [result.getvalue()] From 7e11345f141b7dce47b4c68acd14c00b84cd8337 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 31 Jan 2019 20:30:57 +0100 Subject: [PATCH 04/12] Remove checked off TODO-comment. [CURA-6153] --- cura/GlobalStacksModel.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cura/GlobalStacksModel.py b/cura/GlobalStacksModel.py index 72144140b2..ea8a9c7961 100644 --- a/cura/GlobalStacksModel.py +++ b/cura/GlobalStacksModel.py @@ -53,7 +53,6 @@ class GlobalStacksModel(ListModel): if container_stack.getMetaDataEntry("hidden", False) in ["True", True]: continue - # TODO: Remove reference to connect group name. items.append({"name": container_stack.getMetaDataEntry("group_name", container_stack.getName()), "id": container_stack.getId(), "hasRemoteConnection": has_remote_connection, From 18cec8dbe841372574965fc2154800a79cc35e85 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 1 Feb 2019 10:20:13 +0100 Subject: [PATCH 05/12] Fix typing CURA-6153 --- .../VersionUpgrade35to40/VersionUpgrade35to40.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py b/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py index 1e665d8137..900c0a7396 100644 --- a/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py +++ b/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py @@ -1,8 +1,10 @@ import configparser -from typing import Tuple, List, Set +from typing import Tuple, List, Set, Dict import io + from UM.VersionUpgrade import VersionUpgrade from cura.PrinterOutputDevice import ConnectionType + deleted_settings = {"bridge_wall_max_overhang"} # type: Set[str] renamed_configurations = {"connect_group_name": "group_name"} # type: Dict[str, str] @@ -31,7 +33,6 @@ class VersionUpgrade35to40(VersionUpgrade): result = io.StringIO() parser.write(result) return [filename], [result.getvalue()] - pass def getCfgVersion(self, serialised: str) -> int: parser = configparser.ConfigParser(interpolation = None) @@ -73,4 +74,4 @@ class VersionUpgrade35to40(VersionUpgrade): result = io.StringIO() parser.write(result) - return [filename], [result.getvalue()] \ No newline at end of file + return [filename], [result.getvalue()] From 60a4fb315127dbe3c7a5f3e8085ef688a46cde5a Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 1 Feb 2019 10:23:49 +0100 Subject: [PATCH 06/12] Fix missing "group_name" renaming CURA-6153 --- resources/qml/Preferences/MachinesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index f9c1a9b0a0..6f214a7efb 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -56,7 +56,7 @@ UM.ManagementPage { text: catalog.i18nc("@action:button", "Rename"); iconName: "edit-rename"; - enabled: base.currentItem != null && base.currentItem.metadata.connect_group_name == null + enabled: base.currentItem != null && base.currentItem.metadata.group_name == null onClicked: renameDialog.open(); } ] From 203f699d0aeb5fdf7b4fe0ed4432e2307d782886 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 1 Feb 2019 11:24:50 +0100 Subject: [PATCH 07/12] Override message-box bg-color in dark theme. [CURA-6169] --- resources/themes/cura-dark/theme.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 79ee929d6f..41033e7e75 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -6,6 +6,7 @@ "colors": { "main_background": [39, 44, 48, 255], + "message_background": [39, 44, 48, 255], "wide_lining": [31, 36, 39, 255], "thick_lining": [255, 255, 255, 30], "lining": [64, 69, 72, 255], From 5600d5407c3475486f58c31abe34769445c21853 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 1 Feb 2019 12:02:59 +0100 Subject: [PATCH 08/12] Add default if group_name is not set. Otherwise we get a crash. CURA-6153 --- cura/Machines/Models/MachineManagementModel.py | 4 ++-- cura/Settings/MachineManager.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cura/Machines/Models/MachineManagementModel.py b/cura/Machines/Models/MachineManagementModel.py index 36f324dab7..3297b8a467 100644 --- a/cura/Machines/Models/MachineManagementModel.py +++ b/cura/Machines/Models/MachineManagementModel.py @@ -52,14 +52,14 @@ class MachineManagementModel(ListModel): "um_network_key": "*", "hidden": "False"} self._network_container_stacks = ContainerRegistry.getInstance().findContainerStacks(**network_filter_printers) - self._network_container_stacks.sort(key = lambda i: i.getMetaDataEntry("group_name")) + self._network_container_stacks.sort(key = lambda i: i.getMetaDataEntry("group_name", "")) for container in self._network_container_stacks: metadata = container.getMetaData().copy() if container.getBottom(): metadata["definition_name"] = container.getBottom().getName() - items.append({"name": metadata["group_name"], + items.append({"name": metadata.get("group_name", ""), "id": container.getId(), "metadata": metadata, "group": catalog.i18nc("@info:title", "Network enabled printers")}) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 0cf63462a2..ccc6a5e4ca 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1456,7 +1456,7 @@ class MachineManager(QObject): # then all the container stacks are updated, both the current and the hidden ones. def checkCorrectGroupName(self, device_id: str, group_name: str) -> None: if self._global_container_stack and device_id == self.activeMachineNetworkKey(): - # Check if the connect_group_name is correct. If not, update all the containers connected to the same printer + # Check if the group_name is correct. If not, update all the containers connected to the same printer if self.activeMachineNetworkGroupName != group_name: metadata_filter = {"um_network_key": self.activeMachineNetworkKey()} containers = CuraContainerRegistry.getInstance().findContainerStacks(type = "machine", **metadata_filter) From f7765189c88bb8e703eae5c7af39bfb7192dd8a4 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 1 Feb 2019 13:36:08 +0100 Subject: [PATCH 09/12] Show Extruder 1,2,3,... in message CURA-5693 --- 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 ccc6a5e4ca..e07cacaa9d 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1400,7 +1400,8 @@ class MachineManager(QObject): self._global_container_stack.extruders[position].setEnabled(False) need_to_show_message = True - disabled_used_extruder_position_set.add(int(position)) + # In message, we need to show Extruder 1, 2, 3 instead of 0, 1, 2 + disabled_used_extruder_position_set.add(int(position) + 1) else: variant_container_node = self._variant_manager.getVariantNode(self._global_container_stack.definition.getId(), From 42ca21fc1ad3be3cae94618b68a9467e94bc76db Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 1 Feb 2019 16:46:09 +0100 Subject: [PATCH 10/12] Fix typo in comment --- cura/ApplicationMetadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/ApplicationMetadata.py b/cura/ApplicationMetadata.py index e2ac4453eb..a5ecfd6f46 100644 --- a/cura/ApplicationMetadata.py +++ b/cura/ApplicationMetadata.py @@ -2,7 +2,7 @@ # Cura is released under the terms of the LGPLv3 or higher. # --------- -# Genearl constants used in Cura +# General constants used in Cura # --------- DEFAULT_CURA_DISPLAY_NAME = "Ultimaker Cura" DEFAULT_CURA_VERSION = "master" From 66ed42838fe2c4988b245f3ab649f129066f8600 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 4 Feb 2019 11:53:24 +0100 Subject: [PATCH 11/12] Stop using depreciated API call --- plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index 052dd0b979..e2215c85e7 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -355,8 +355,8 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): def sendJobToTop(self, print_job_uuid: str) -> None: # This function is part of the output device (and not of the printjob output model) as this type of operation # is a modification of the cluster queue and not of the actual job. - data = "{\"to_position\": 0}" - self.put("print_jobs/{uuid}/move_to_position".format(uuid = print_job_uuid), data, on_finished=None) + data = "{\"list\": \"queued\",\"to_position\": 0}" + self.post("print_jobs/{uuid}/action/move".format(uuid = print_job_uuid), data, on_finished=None) @pyqtSlot(str) def deleteJobFromQueue(self, print_job_uuid: str) -> None: From 7d871e5a183d2967fb6e3a3d05cd5cf1425cc230 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 4 Feb 2019 13:06:06 +0100 Subject: [PATCH 12/12] Update text for pre-login screen This is a new text that we got from marketing. --- .../UM3NetworkPrinting/src/UM3OutputDevicePlugin.py | 4 ++-- resources/qml/Account/GeneralOperations.qml | 13 ++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py index 74d2d87b3b..7a7670d64c 100644 --- a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Ultimaker B.V. +# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import json from queue import Queue @@ -245,7 +245,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): properties = device.getProperties().copy() if b"incomplete" in properties: del properties[b"incomplete"] - properties[b'cluster_size'] = len(cluster_printers_list) + properties[b"cluster_size"] = len(cluster_printers_list) self._onRemoveDevice(instance_name) self._onAddDevice(instance_name, address, properties) diff --git a/resources/qml/Account/GeneralOperations.qml b/resources/qml/Account/GeneralOperations.qml index 73b8f0b9bc..f073f5616e 100644 --- a/resources/qml/Account/GeneralOperations.qml +++ b/resources/qml/Account/GeneralOperations.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -37,8 +37,8 @@ Column anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter renderType: Text.NativeRendering - text: catalog.i18nc("@label", "Enjoy a more powerful 3D printing experience.") - font: UM.Theme.getFont("default") + text: catalog.i18nc("@label", "The next generation 3D printing workflow") + font: UM.Theme.getFont("default_bold") color: UM.Theme.getColor("text") } @@ -48,12 +48,7 @@ Column anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignLeft renderType: Text.NativeRendering - text: { - var t = " - Send prints to your Ultimaker printer from anywhere\n" - + " - Access your Ultimaker Cura Settings worldwide\n" - + " - Enhance your workflow with advanced material profiles" - return catalog.i18nc("@label", t) - } + text: catalog.i18nc("@text", "- Send print jobs to your Ultimaker printers outside your local network\n- Store your Ultimaker Cura settings in the cloud for use anywhere\n- Get exclusive access to material profiles from leading brands") lineHeight: 1.4 font: UM.Theme.getFont("default") color: UM.Theme.getColor("text")