Persistent handled state across Package Lists

Contributes to: CURA-8587
This commit is contained in:
Jelle Spijker 2021-12-06 10:19:14 +01:00
parent 2d9c557a13
commit 325783ca46
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
5 changed files with 26 additions and 13 deletions

View file

@ -57,10 +57,13 @@ class LocalPackageList(PackageList):
def _makePackageModel(self, package_info: Dict[str, Any]) -> PackageModel:
""" Create a PackageModel from the package_info and determine its section_title"""
bundled_or_installed = "installed" if self._manager.isUserInstalledPackage(package_info["package_id"]) else "bundled"
bundled_or_installed = "bundled" if self._manager.isBundledPackage(package_info["package_id"]) else "installed"
package_type = package_info["package_type"]
section_title = self.PACKAGE_CATEGORIES[bundled_or_installed][package_type]
package = PackageModel(package_info, section_title = section_title, parent = self)
if package_info["package_id"] in self._manager.getPackagesToRemove() or package_info["package_id"] in self._manager.getPackagesToInstall():
package.is_recently_managed = True
self._connectManageButtonSignals(package)
return package