mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06: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
1 changed files with 12 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue