From fb22a04d4dbff7efbb1ed8e974ad2ca79433646a Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 8 Apr 2022 20:34:42 +0200 Subject: [PATCH 01/11] Add search path for the pyinstaller locations Contributes to CURA-8640 --- cura/CuraApplication.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 0c174f75ed..aead7d8a4e 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -350,6 +350,7 @@ class CuraApplication(QtApplication): app_root = os.path.abspath(os.path.join(os.path.dirname(sys.executable))) Resources.addSearchPath(os.path.join(app_root, "share", "cura", "resources")) + Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "share", "cura", "resources")) Resources.addSearchPath(os.path.join(self._app_install_dir, "share", "cura", "resources")) if not hasattr(sys, "frozen"): From c4baece3acd4ed2af1866353ae635b9658c52136 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 11 Apr 2022 09:52:33 +0200 Subject: [PATCH 02/11] Remove reference to nonexistent property source size in UM.ColorImage which was causing add printer page to be empty CURA-9098 --- resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml index 5ca48bafc7..badd87326b 100644 --- a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml @@ -208,7 +208,6 @@ Item anchors.verticalCenter: parent.verticalCenter height: troubleshootingLabel.height width: height - sourceSize.height: width color: UM.Theme.getColor("text_link") source: UM.Theme.getIcon("LinkExternal") } From 0deac84ec2852ae0e7a3c9d4fb8c1ed91fc901d7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 11 Apr 2022 10:00:09 +0200 Subject: [PATCH 03/11] NetworkError is an enum, no longer comparable as int With the Qt6 upgrade, we have to treat enums as full enums, within their normal class namespace and such. They are no longer just integer-globals static in the QtCore.Qt class. They are no longer treated as integers by PyQt. Other places that checked for such errors were already doing it like this. Contributes to issue CURA-9100. --- plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py b/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py index b3df000f7b..773e2b5902 100644 --- a/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py +++ b/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py @@ -176,7 +176,7 @@ class ClusterApiClient: if reply.attribute(QNetworkRequest.Attribute.HttpStatusCodeAttribute) is None: return - if reply.error() > 0: + if reply.error() != QNetworkReply.NetworkError.NoError: self._on_error(reply.errorString()) return From 17e7c263df4ad009fc3ad7e06fe090a13db7f93a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 11 Apr 2022 10:37:15 +0200 Subject: [PATCH 04/11] Remove fill from extruderColor icon --- resources/themes/cura-light/icons/medium/ExtruderColor.svg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resources/themes/cura-light/icons/medium/ExtruderColor.svg b/resources/themes/cura-light/icons/medium/ExtruderColor.svg index cd4452b246..b438cf805b 100644 --- a/resources/themes/cura-light/icons/medium/ExtruderColor.svg +++ b/resources/themes/cura-light/icons/medium/ExtruderColor.svg @@ -2,9 +2,7 @@ - + From 279719099d0c6da2200c9760cdda17d210f2390c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 11 Apr 2022 10:39:48 +0200 Subject: [PATCH 05/11] Also remove fill from default extruderCOlor icon --- resources/themes/cura-light/icons/default/ExtruderColor.svg | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/themes/cura-light/icons/default/ExtruderColor.svg b/resources/themes/cura-light/icons/default/ExtruderColor.svg index ff202e7296..8c6063ce13 100644 --- a/resources/themes/cura-light/icons/default/ExtruderColor.svg +++ b/resources/themes/cura-light/icons/default/ExtruderColor.svg @@ -2,9 +2,6 @@ - From e076779293699d3fe5d9961cb133336e370ba970 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 11 Apr 2022 10:56:17 +0200 Subject: [PATCH 06/11] Remove fill from Check.svg which was overriding attempts to recolor image. CURA-9101 --- resources/themes/cura-light/icons/low/Check.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/themes/cura-light/icons/low/Check.svg b/resources/themes/cura-light/icons/low/Check.svg index 9630b70052..022df8c696 100644 --- a/resources/themes/cura-light/icons/low/Check.svg +++ b/resources/themes/cura-light/icons/low/Check.svg @@ -1,3 +1,3 @@ - - + + From 5bec905cb931cccd4603aa69eb038407c8089dfd Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 11 Apr 2022 11:40:04 +0200 Subject: [PATCH 07/11] Remove fill from multiple SVG's --- plugins/Marketplace/resources/images/Plugin.svg | 4 ++-- plugins/Marketplace/resources/images/Spool.svg | 4 ++-- resources/themes/cura-light/icons/default/BlockGrid.svg | 4 ++-- resources/themes/cura-light/icons/default/CircleOutline.svg | 2 +- resources/themes/cura-light/icons/default/Settings.svg | 2 +- resources/themes/cura-light/icons/low/CheckBoxFill.svg | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/Marketplace/resources/images/Plugin.svg b/plugins/Marketplace/resources/images/Plugin.svg index 51356d842c..b7616b5876 100644 --- a/plugins/Marketplace/resources/images/Plugin.svg +++ b/plugins/Marketplace/resources/images/Plugin.svg @@ -1,3 +1,3 @@ - - + + diff --git a/plugins/Marketplace/resources/images/Spool.svg b/plugins/Marketplace/resources/images/Spool.svg index dae9b43030..3faffb7a52 100644 --- a/plugins/Marketplace/resources/images/Spool.svg +++ b/plugins/Marketplace/resources/images/Spool.svg @@ -1,3 +1,3 @@ - - + + diff --git a/resources/themes/cura-light/icons/default/BlockGrid.svg b/resources/themes/cura-light/icons/default/BlockGrid.svg index 207171b8f7..3fb368e7c8 100644 --- a/resources/themes/cura-light/icons/default/BlockGrid.svg +++ b/resources/themes/cura-light/icons/default/BlockGrid.svg @@ -1,3 +1,3 @@ - - + + diff --git a/resources/themes/cura-light/icons/default/CircleOutline.svg b/resources/themes/cura-light/icons/default/CircleOutline.svg index 6f7cd6aca0..5c4584e49f 100644 --- a/resources/themes/cura-light/icons/default/CircleOutline.svg +++ b/resources/themes/cura-light/icons/default/CircleOutline.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/resources/themes/cura-light/icons/default/Settings.svg b/resources/themes/cura-light/icons/default/Settings.svg index feb0ab0cc8..204f2a5b6f 100644 --- a/resources/themes/cura-light/icons/default/Settings.svg +++ b/resources/themes/cura-light/icons/default/Settings.svg @@ -1,3 +1,3 @@ - + diff --git a/resources/themes/cura-light/icons/low/CheckBoxFill.svg b/resources/themes/cura-light/icons/low/CheckBoxFill.svg index bfbb6d87f2..acaf3ed5aa 100644 --- a/resources/themes/cura-light/icons/low/CheckBoxFill.svg +++ b/resources/themes/cura-light/icons/low/CheckBoxFill.svg @@ -1,4 +1,4 @@ - - - + + + From 70fdffb1c99008859018cc652ae163b3787ef1b2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 11 Apr 2022 11:49:17 +0200 Subject: [PATCH 08/11] Allow redirects when talking with printer API Because newer firmware will redirect this API call. Contributes to issue CURA-9119. --- plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py b/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py index 773e2b5902..e0b156dc08 100644 --- a/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py +++ b/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py @@ -118,7 +118,6 @@ class ClusterApiClient: """ url = QUrl("http://" + self._address + path) request = QNetworkRequest(url) - request.setAttribute(QNetworkRequest.Attribute.RedirectPolicyAttribute, QNetworkRequest.RedirectPolicy.ManualRedirectPolicy) if content_type: request.setHeader(QNetworkRequest.KnownHeaders.ContentTypeHeader, content_type) return request From d1d45b4f41d8a0d5fd0735c39188f2bf4445d505 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 11 Apr 2022 13:22:32 +0200 Subject: [PATCH 09/11] Fix enum to FormDataType Stupid enum change... Contributes to issue CURA-9119. --- cura/PrinterOutput/NetworkedPrinterOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py index dae24767db..0fc387a53f 100644 --- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py +++ b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py @@ -290,7 +290,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): on_progress: Optional[Callable[[int, int], None]] = None) -> QNetworkReply: self._validateManager() request = self._createEmptyRequest(target, content_type=None) - multi_post_part = QHttpMultiPart(QHttpMultiPart.FormDataType) + multi_post_part = QHttpMultiPart(QHttpMultiPart.ContentType.FormDataType) for part in parts: multi_post_part.append(part) From 94e5a4e1dbc88b78e0960c9c140e0a40574c2d9b Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 11 Apr 2022 14:10:27 +0200 Subject: [PATCH 10/11] Masking is not avaliable after the QT6 upgrade, this does a kind of primitive masking by placing a rectangle with a circular hole in it over the image. CURA-9104 --- resources/qml/Account/AccountWidget.qml | 1 + resources/qml/Account/AvatarImage.qml | 39 ++++++++++--------- resources/qml/Account/UserOperations.qml | 1 + .../cura-light/icons/default/CircleMask.svg | 4 ++ .../icons/default/CircleOutline.svg | 2 +- 5 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 resources/themes/cura-light/icons/default/CircleMask.svg diff --git a/resources/qml/Account/AccountWidget.qml b/resources/qml/Account/AccountWidget.qml index cf681477d4..84a0caede1 100644 --- a/resources/qml/Account/AccountWidget.qml +++ b/resources/qml/Account/AccountWidget.qml @@ -81,6 +81,7 @@ Item source: (loggedIn && profile["profile_image_url"]) ? profile["profile_image_url"] : "" outlineColor: loggedIn ? UM.Theme.getColor("account_widget_outline_active") : UM.Theme.getColor("lining") + maskColor: UM.Theme.getColor("main_window_header_background") } contentItem: Item diff --git a/resources/qml/Account/AvatarImage.qml b/resources/qml/Account/AvatarImage.qml index 7afd1b8180..6a60e993d8 100644 --- a/resources/qml/Account/AvatarImage.qml +++ b/resources/qml/Account/AvatarImage.qml @@ -15,43 +15,44 @@ Item property alias source: profileImage.source property alias outlineColor: profileImageOutline.color + + // This should be set to the color behind the image + // It fills the space around a rectangular avatar to make the image under it look circular + property alias maskColor: profileImageMask.color property bool hasAvatar: source != "" + Rectangle + { + id: profileImageBackground + anchors.fill: parent + radius: width + color: "white" + } + Image { id: profileImage anchors.fill: parent fillMode: Image.PreserveAspectCrop - visible: false + visible: hasAvatar mipmap: true } - Rectangle + UM.ColorImage { + // This image is a rectangle with a hole in the middle. + // Since we don't have access to proper masking in QT6 yet this is used as a primitive masking replacement id: profileImageMask anchors.fill: parent - radius: width - color: hasAvatar ? "white" : "transparent" + source: UM.Theme.getIcon("CircleMask") } - /* - TODO: Reimplement this without OpacityMask. - OpacityMask - { - anchors.fill: parent - source: profileImage - maskSource: profileImageMask - visible: hasAvatar - cached: true - }*/ - UM.ColorImage { + // This creates the circle outline around the image id: profileImageOutline - anchors.centerIn: parent - // Make it a bit bigger than it has to, otherwise it sometimes shows a white border. - width: parent.width + 2 - height: parent.height + 2 + anchors.fill: parent + anchors.margins: .25 visible: hasAvatar source: UM.Theme.getIcon("CircleOutline") color: UM.Theme.getColor("account_widget_outline_active") diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index be858df993..d7677264fb 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -30,6 +30,7 @@ Column height: UM.Theme.getSize("main_window_header").height source: profile["profile_image_url"] ? profile["profile_image_url"] : "" + maskColor: UM.Theme.getColor("main_background") outlineColor: UM.Theme.getColor("main_background") } Rectangle diff --git a/resources/themes/cura-light/icons/default/CircleMask.svg b/resources/themes/cura-light/icons/default/CircleMask.svg new file mode 100644 index 0000000000..d3a2e9a81c --- /dev/null +++ b/resources/themes/cura-light/icons/default/CircleMask.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/themes/cura-light/icons/default/CircleOutline.svg b/resources/themes/cura-light/icons/default/CircleOutline.svg index 5c4584e49f..6f7cd6aca0 100644 --- a/resources/themes/cura-light/icons/default/CircleOutline.svg +++ b/resources/themes/cura-light/icons/default/CircleOutline.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file From 3674af01b7e528013e7b56b1d3f7d5ef1dd0bbc3 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 12 Apr 2022 10:21:34 +0200 Subject: [PATCH 11/11] selectExisting is replaced with using fileMode:FileDialog.OpenFile in QT6. This forces selecting an existing file. This is also the default value in QT6 so this line can be removed without changing the functionality --- plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml | 1 - resources/qml/Preferences/Materials/MaterialsSyncDialog.qml | 1 - 2 files changed, 2 deletions(-) diff --git a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml index b667e5c3a9..0e2fcb7d28 100644 --- a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml +++ b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml @@ -92,7 +92,6 @@ Cura.MachineAction id: customFirmwareDialog title: catalog.i18nc("@title:window", "Select custom firmware") nameFilters: "Firmware image files (*.hex)" - selectExisting: true onAccepted: { updateProgressDialog.visible = true; diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index 361f3efbd2..4fb8d78b2f 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -732,7 +732,6 @@ Window property variant exportUsbDialog: FileDialog { title: catalog.i18nc("@title:window", "Export All Materials") - selectExisting: false nameFilters: ["Material archives (*.umm)", "All files (*)"] onAccepted: {