Merge pull request #10189 from Ultimaker/CURA-7689_beta_release_notifications

Allow update checking for BETA and stable releases
This commit is contained in:
Konstantinos Karmas 2021-08-04 15:59:08 +02:00 committed by GitHub
commit b86e6ddfe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 95 additions and 28 deletions

View File

@ -112,7 +112,7 @@ class FirmwareUpdateCheckerJob(Job):
# The first time we want to store the current version, the notification will not be shown, # 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 # 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. # 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)) Logger.log("i", "Showing firmware update message for new version: {version}".format(version = current_version))
message = FirmwareUpdateCheckerMessage(machine_id, self._machine_name, current_version, message = FirmwareUpdateCheckerMessage(machine_id, self._machine_name, current_version,
self._lookups.getRedirectUserUrl()) self._lookups.getRedirectUserUrl())

View File

@ -14,12 +14,12 @@ class FirmwareUpdateCheckerMessage(Message):
def __init__(self, machine_id: int, machine_name: str, latest_version: str, download_url: str) -> None: def __init__(self, machine_id: int, machine_name: str, latest_version: str, download_url: str) -> None:
super().__init__(i18n_catalog.i18nc( super().__init__(i18n_catalog.i18nc(
"@info Don't translate {machine_name}, since it gets replaced by a printer name!", "@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( "it is recommended to update the firmware on your printer to version {latest_version}.").format(
machine_name = machine_name, latest_version = latest_version), machine_name = machine_name, latest_version = latest_version),
title = i18n_catalog.i18nc( title = i18n_catalog.i18nc(
"@info:title The %s gets replaced with the printer name.", "@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._machine_id = machine_id
self._download_url = download_url self._download_url = download_url

View File

@ -183,12 +183,15 @@ class Toolbox(QObject, Extension):
self._application.getCuraAPI().account.loginStateChanged.connect(self._restart) 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. # 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! # Request the latest and greatest!
self._makeRequestByType("updates") self._makeRequestByType("updates")
def _fetchPackageData(self) -> None: def _fetchPackageData(self) -> None:
self._makeRequestByType("packages") self._makeRequestByType("packages")
self._makeRequestByType("authors") self._makeRequestByType("authors")

View File

@ -32,7 +32,7 @@
[ [
"https://software.ultimaker.com/releases/firmware/9066/stable/um-update.swu.version" "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": [ "bom_numbers": [
9066 9066

View File

@ -29,7 +29,7 @@
[ [
"https://software.ultimaker.com/releases/firmware/9066/stable/um-update.swu.version" "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": [ "bom_numbers": [
9511 9511

View File

@ -32,7 +32,7 @@
"firmware_update_info": { "firmware_update_info": {
"id": 213482, "id": 213482,
"check_urls": ["https://software.ultimaker.com/releases/firmware/213482/stable/um-update.swu.version"], "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": [ "bom_numbers": [
213482 213482

View File

@ -33,7 +33,7 @@
"firmware_update_info": { "firmware_update_info": {
"id": 9051, "id": 9051,
"check_urls": ["https://software.ultimaker.com/releases/firmware/9051/stable/um-update.swu.version"], "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": [ "bom_numbers": [
9051, 214475 9051, 214475

View File

@ -118,6 +118,10 @@ UM.PreferencesPage
sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info")) sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
UM.Preferences.resetPreference("info/automatic_update_check") UM.Preferences.resetPreference("info/automatic_update_check")
checkUpdatesCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_update_check")) 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 ScrollView
@ -766,30 +770,13 @@ UM.PreferencesPage
Label Label
{ {
font.bold: true font.bold: true
visible: checkUpdatesCheckbox.visible || sendDataCheckbox.visible text: catalog.i18nc("@label", "Privacy")
text: catalog.i18nc("@label","Privacy")
} }
UM.TooltipArea UM.TooltipArea
{ {
width: childrenRect.width width: childrenRect.width
height: visible ? childrenRect.height : 0 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 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: checkUpdatesCheckbox
text: catalog.i18nc("@option:check","Check for updates on start")
checked: boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
onCheckedChanged: UM.Preferences.setValue("info/automatic_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 CheckBox
{ {
@ -811,6 +798,83 @@ UM.PreferencesPage
} }
} }
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
{
width: childrenRect.width
height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?")
CheckBox
{
id: checkUpdatesCheckbox
text: catalog.i18nc("@option:check","Check for updates on start")
checked: boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
onCheckedChanged: UM.Preferences.setValue("info/automatic_update_check", checked)
}
}
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
height: visible ? childrenRect.height : 0
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)
}
}
/* Multi-buildplate functionality is disabled because it's broken. See CURA-4975 for the ticket to remove it. /* Multi-buildplate functionality is disabled because it's broken. See CURA-4975 for the ticket to remove it.
Item Item
{ {