From d0654aa4d04deefe66e0733467b3848d0b45e1f9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 26 Jul 2021 13:35:36 +0200 Subject: [PATCH 1/6] Add option to preference to switch between stable & beta for update checker CURA-7689 --- resources/qml/Preferences/GeneralPage.qml | 38 ++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 341b51c8b4..e35b8c22f0 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -118,6 +118,8 @@ UM.PreferencesPage sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info")) UM.Preferences.resetPreference("info/automatic_update_check") checkUpdatesCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_update_check")) + + UM.Preferences.resetPreference("info/latest_update_source") } ScrollView @@ -774,7 +776,7 @@ UM.PreferencesPage { width: childrenRect.width height: visible ? childrenRect.height : 0 - text: catalog.i18nc("@info:tooltip","Should Cura check for updates when the program is started?") + text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?") CheckBox { @@ -785,6 +787,40 @@ UM.PreferencesPage } } + ExclusiveGroup { id: curaUpdatesGroup } + UM.TooltipArea + { + width: childrenRect.width + height: visible ? childrenRect.height : 0 + text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.") + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + RadioButton + { + text: catalog.i18nc("@option:radio", "Stable releases only") + exclusiveGroup: curaUpdatesGroup + enabled: checkUpdatesCheckbox.checked + checked: UM.Preferences.getValue("info/latest_update_source") == "stable" + onClicked: UM.Preferences.setValue("info/latest_update_source", "stable") + } + } + UM.TooltipArea + { + width: childrenRect.width + height: visible ? childrenRect.height : 0 + text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.") + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + RadioButton + { + text: catalog.i18nc("@option:radio", "Stable and Beta releases") + exclusiveGroup: curaUpdatesGroup + enabled: checkUpdatesCheckbox.checked + checked: UM.Preferences.getValue("info/latest_update_source") == "beta" + onClicked: UM.Preferences.setValue("info/latest_update_source", "beta") + } + } + UM.TooltipArea { width: childrenRect.width From 358ba8c34a26db498a9d9367bb1e4b703c9f7648 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 29 Jul 2021 11:35:48 +0200 Subject: [PATCH 2/6] Update update message for firmware checker CURA-7689 --- plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerMessage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerMessage.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerMessage.py index ca253e3ec6..493784c6d1 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerMessage.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerMessage.py @@ -14,12 +14,12 @@ class FirmwareUpdateCheckerMessage(Message): def __init__(self, machine_id: int, machine_name: str, latest_version: str, download_url: str) -> None: super().__init__(i18n_catalog.i18nc( "@info Don't translate {machine_name}, since it gets replaced by a printer name!", - "New features or bug-fixes may be available for your {machine_name}! If not already at the latest version, " + "New features or bug-fixes may be available for your {machine_name}! If you haven't done so already, " "it is recommended to update the firmware on your printer to version {latest_version}.").format( machine_name = machine_name, latest_version = latest_version), title = i18n_catalog.i18nc( "@info:title The %s gets replaced with the printer name.", - "New %s firmware available") % machine_name) + "New %s stable firmware available") % machine_name) self._machine_id = machine_id self._download_url = download_url From 3436a2171e4f981f126d9d1362b40aa9ee5c9ea7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 29 Jul 2021 11:40:11 +0200 Subject: [PATCH 3/6] Remove unneeded () CURA-7689 --- plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index 2c869195bc..d726cc04a9 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -112,7 +112,7 @@ class FirmwareUpdateCheckerJob(Job): # The first time we want to store the current version, the notification will not be shown, # because the new version of Cura will be release before the firmware and we don't want to # notify the user when no new firmware version is available. - if (checked_version != "") and (checked_version != current_version): + if checked_version != "" and checked_version != current_version: Logger.log("i", "Showing firmware update message for new version: {version}".format(version = current_version)) message = FirmwareUpdateCheckerMessage(machine_id, self._machine_name, current_version, self._lookups.getRedirectUserUrl()) From 84b1aa39b7c7756ca8252d81b9106c5a28b0d470 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 29 Jul 2021 15:21:46 +0200 Subject: [PATCH 4/6] Update the update_url's for firmware updates CURA-7689 --- resources/definitions/ultimaker3.def.json | 2 +- resources/definitions/ultimaker3_extended.def.json | 2 +- resources/definitions/ultimaker_s3.def.json | 2 +- resources/definitions/ultimaker_s5.def.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index 2e49dda806..46ade6d85b 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -32,7 +32,7 @@ [ "https://software.ultimaker.com/releases/firmware/9066/stable/um-update.swu.version" ], - "update_url": "https://ultimaker.com/firmware" + "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" }, "bom_numbers": [ 9066 diff --git a/resources/definitions/ultimaker3_extended.def.json b/resources/definitions/ultimaker3_extended.def.json index ba9824896f..970d3a405d 100644 --- a/resources/definitions/ultimaker3_extended.def.json +++ b/resources/definitions/ultimaker3_extended.def.json @@ -29,7 +29,7 @@ [ "https://software.ultimaker.com/releases/firmware/9066/stable/um-update.swu.version" ], - "update_url": "https://ultimaker.com/firmware" + "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" }, "bom_numbers": [ 9511 diff --git a/resources/definitions/ultimaker_s3.def.json b/resources/definitions/ultimaker_s3.def.json index 962bff3fa0..8423af6f21 100644 --- a/resources/definitions/ultimaker_s3.def.json +++ b/resources/definitions/ultimaker_s3.def.json @@ -31,7 +31,7 @@ "firmware_update_info": { "id": 213482, "check_urls": ["https://software.ultimaker.com/releases/firmware/213482/stable/um-update.swu.version"], - "update_url": "https://ultimaker.com/firmware" + "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" }, "bom_numbers": [ 213482 diff --git a/resources/definitions/ultimaker_s5.def.json b/resources/definitions/ultimaker_s5.def.json index 8a9880c31a..9bd6fe66f7 100644 --- a/resources/definitions/ultimaker_s5.def.json +++ b/resources/definitions/ultimaker_s5.def.json @@ -32,7 +32,7 @@ "firmware_update_info": { "id": 9051, "check_urls": ["https://software.ultimaker.com/releases/firmware/9051/stable/um-update.swu.version"], - "update_url": "https://ultimaker.com/firmware" + "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" }, "bom_numbers": [ 9051, 214475 From be59e701f29ef9cad77e5c0f8680718f54f3d212 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 3 Aug 2021 13:07:11 +0200 Subject: [PATCH 5/6] Add seperate preference for plugin notifications check CURA-7689 --- plugins/Toolbox/src/Toolbox.py | 7 +++++-- resources/qml/Preferences/GeneralPage.qml | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 625289635a..c238d3f009 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -183,12 +183,15 @@ class Toolbox(QObject, Extension): self._application.getCuraAPI().account.loginStateChanged.connect(self._restart) + preferences = CuraApplication.getInstance().getPreferences() + + preferences.addPreference("info/automatic_plugin_update_check", True) + # On boot we check which packages have updates. - if CuraApplication.getInstance().getPreferences().getValue("info/automatic_update_check") and len(installed_package_ids_with_versions) > 0: + if preferences.getValue("info/automatic_plugin_update_check") and len(installed_package_ids_with_versions) > 0: # Request the latest and greatest! self._makeRequestByType("updates") - def _fetchPackageData(self) -> None: self._makeRequestByType("packages") self._makeRequestByType("authors") diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index e35b8c22f0..aa8339aa63 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -120,6 +120,8 @@ UM.PreferencesPage checkUpdatesCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_update_check")) UM.Preferences.resetPreference("info/latest_update_source") + UM.Preferences.resetPreference("info/automatic_plugin_update_check") + pluginNotificationsUpdateCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_plugin_update_check")) } ScrollView @@ -820,12 +822,25 @@ UM.PreferencesPage onClicked: UM.Preferences.setValue("info/latest_update_source", "beta") } } - UM.TooltipArea { width: childrenRect.width height: visible ? childrenRect.height : 0 - text: catalog.i18nc("@info:tooltip","Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") + text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!") + + CheckBox + { + id: pluginNotificationsUpdateCheckbox + text: catalog.i18nc("@option:check", "Get notifications for plugin updates") + checked: boolCheck(UM.Preferences.getValue("info/automatic_plugin_update_check")) + onCheckedChanged: UM.Preferences.setValue("info/automatic_plugin_update_check", checked) + } + } + UM.TooltipArea + { + width: childrenRect.width + height: visible ? childrenRect.height : 0 + text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") CheckBox { From 8c537fc4e6d4014b8a17698a4b2042f8c633f35e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 3 Aug 2021 13:09:19 +0200 Subject: [PATCH 6/6] Move update related preferences to their own category CURA-7689 --- resources/qml/Preferences/GeneralPage.qml | 65 ++++++++++++++--------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index aa8339aa63..5b28396188 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -770,8 +770,45 @@ UM.PreferencesPage Label { font.bold: true - visible: checkUpdatesCheckbox.visible || sendDataCheckbox.visible - text: catalog.i18nc("@label","Privacy") + text: catalog.i18nc("@label", "Privacy") + } + UM.TooltipArea + { + width: childrenRect.width + height: visible ? childrenRect.height : 0 + text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") + + CheckBox + { + id: sendDataCheckbox + text: catalog.i18nc("@option:check","Send (anonymous) print information") + checked: boolCheck(UM.Preferences.getValue("info/send_slice_info")) + onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked) + } + + Button + { + id: showMoreInfo + anchors.top: sendDataCheckbox.bottom + text: catalog.i18nc("@action:button", "More information") + onClicked: + { + CuraApplication.showMoreInformationDialogForAnonymousDataCollection(); + } + } + } + + Item + { + //: Spacer + height: UM.Theme.getSize("default_margin").height + width: UM.Theme.getSize("default_margin").height + } + + Label + { + font.bold: true + text: catalog.i18nc("@label", "Updates") } UM.TooltipArea @@ -836,31 +873,7 @@ UM.PreferencesPage onCheckedChanged: UM.Preferences.setValue("info/automatic_plugin_update_check", checked) } } - UM.TooltipArea - { - width: childrenRect.width - height: visible ? childrenRect.height : 0 - text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") - CheckBox - { - id: sendDataCheckbox - text: catalog.i18nc("@option:check","Send (anonymous) print information") - checked: boolCheck(UM.Preferences.getValue("info/send_slice_info")) - onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked) - } - - Button - { - id: showMoreInfo - anchors.top: sendDataCheckbox.bottom - text: catalog.i18nc("@action:button", "More information") - onClicked: - { - CuraApplication.showMoreInformationDialogForAnonymousDataCollection(); - } - } - } /* Multi-buildplate functionality is disabled because it's broken. See CURA-4975 for the ticket to remove it. Item