mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Show latest version nr. available in firmware-update-checker-message.
This commit is contained in:
parent
fd2a7689cc
commit
670f1df6c7
2 changed files with 7 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2020 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
|
@ -114,7 +114,7 @@ class FirmwareUpdateCheckerJob(Job):
|
||||||
# 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,
|
message = FirmwareUpdateCheckerMessage(machine_id, self._machine_name, current_version,
|
||||||
self._lookups.getRedirectUserUrl())
|
self._lookups.getRedirectUserUrl())
|
||||||
message.actionTriggered.connect(self._callback)
|
message.actionTriggered.connect(self._callback)
|
||||||
message.show()
|
message.show()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2020 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
|
@ -11,11 +11,12 @@ i18n_catalog = i18nCatalog("cura")
|
||||||
class FirmwareUpdateCheckerMessage(Message):
|
class FirmwareUpdateCheckerMessage(Message):
|
||||||
STR_ACTION_DOWNLOAD = "download"
|
STR_ACTION_DOWNLOAD = "download"
|
||||||
|
|
||||||
def __init__(self, machine_id: int, machine_name: 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 are available for your {machine_name}! It is recommended to update the firmware on your printer.").format(
|
"New features or bug-fixes may be available for your {machine_name}! If not already at the latest version, "
|
||||||
machine_name = machine_name),
|
"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(
|
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 firmware available") % machine_name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue