mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 07:14:24 +08:00
Add a property that lists all ID's that have an update available
CURA-6151
This commit is contained in:
parent
fd015c0381
commit
86f4fd65c3
@ -461,6 +461,18 @@ class Toolbox(QObject, Extension):
|
|||||||
break
|
break
|
||||||
return remote_package
|
return remote_package
|
||||||
|
|
||||||
|
# Give a list of package ids that have an update available.
|
||||||
|
@pyqtProperty(bool, notify=metadataChanged)
|
||||||
|
def packagesWithUpdateAvailable(self) -> List[str]:
|
||||||
|
all_installed_packages = self._package_manager.getAllInstalledPackageIDs()
|
||||||
|
|
||||||
|
packages_with_update_available = []
|
||||||
|
for package_id in all_installed_packages:
|
||||||
|
if self.canUpdate(package_id):
|
||||||
|
packages_with_update_available.append(package_id)
|
||||||
|
|
||||||
|
return packages_with_update_available
|
||||||
|
|
||||||
# Checks
|
# Checks
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
@pyqtSlot(str, result = bool)
|
@pyqtSlot(str, result = bool)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user