mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-28 23:04:34 +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
|
||||
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
|
||||
# --------------------------------------------------------------------------
|
||||
@pyqtSlot(str, result = bool)
|
||||
|
Loading…
x
Reference in New Issue
Block a user