To be removed packages are still listed for the current session

A user might still need to interact with a **to be removed** package and
it is also still being used in the current Cura session. But the current
package list doesn't list that package anymore.

Introduced a `getPackagesToRemove()` method in the Uranium PackageManager
to circumvent this issue.

Contributes to CURA-8558
This commit is contained in:
j.spijker@ultimaker.com 2021-11-03 12:04:10 +01:00 committed by Jelle Spijker
parent 8fad2e0f39
commit 080e3b9f27
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A

View file

@ -70,9 +70,11 @@ class LocalPackageList(PackageList):
def _allPackageInfo(self):
manager = self._application.getPackageManager()
for package_id in manager.getAllInstalledPackageIDs():
package_data = manager.getInstalledPackageInfo(package_id)
bundled_or_installed = "bundled" if package_data["is_bundled"] else "installed"
package_type = package_data["package_type"]
package_data["section_title"] = self.PACKAGE_SECTION_HEADER[bundled_or_installed][package_type]
yield package_data
for package_type, packages in manager.getAllInstalledPackagesInfo().items():
for package_data in packages:
bundled_or_installed = "installed" if manager.isUserInstalledPackage(package_data["package_id"]) else "bundled"
package_data["section_title"] = self.PACKAGE_SECTION_HEADER[bundled_or_installed][package_type]
yield package_data
for package_data in manager.getPackagesToRemove().values():
yield package_data["package_info"]