mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 04:05:53 +08:00
Update documentation
CURA-8587
This commit is contained in:
parent
8df204b327
commit
afef4f761b
@ -35,7 +35,6 @@ class LocalPackageList(PackageList):
|
|||||||
}
|
}
|
||||||
} # The section headers to be used for the different package categories
|
} # The section headers to be used for the different package categories
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, parent: Optional["QObject"] = None) -> None:
|
def __init__(self, parent: Optional["QObject"] = None) -> None:
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self._has_footer = False
|
self._has_footer = False
|
||||||
@ -47,9 +46,15 @@ class LocalPackageList(PackageList):
|
|||||||
section_order = dict(zip([i for k, v in self.PACKAGE_CATEGORIES.items() for i in self.PACKAGE_CATEGORIES[k].values()], ["a", "b", "c", "d"]))
|
section_order = dict(zip([i for k, v in self.PACKAGE_CATEGORIES.items() for i in self.PACKAGE_CATEGORIES[k].values()], ["a", "b", "c", "d"]))
|
||||||
self.sort(lambda model: (section_order[model.sectionTitle], model.canUpdate, model.displayName.lower()), key = "package")
|
self.sort(lambda model: (section_order[model.sectionTitle], model.canUpdate, model.displayName.lower()), key = "package")
|
||||||
|
|
||||||
def _removePackageModel(self, package_id):
|
def _removePackageModel(self, package_id: str) -> None:
|
||||||
|
"""
|
||||||
|
Cleanup function to remove the package model from the list. Note that this is only done if the package can't
|
||||||
|
be updated, it is in the to remove list and isn't in the to be installed list
|
||||||
|
"""
|
||||||
package = self.getPackageModel(package_id)
|
package = self.getPackageModel(package_id)
|
||||||
if not package.canUpdate and package_id in self._package_manager.getToRemovePackageIDs() and package_id not in self._package_manager.getPackagesToInstall():
|
if not package.canUpdate and \
|
||||||
|
package_id in self._package_manager.getToRemovePackageIDs() and \
|
||||||
|
package_id not in self._package_manager.getPackagesToInstall():
|
||||||
index = self.find("package", package_id)
|
index = self.find("package", package_id)
|
||||||
if index < 0:
|
if index < 0:
|
||||||
Logger.error(f"Could not find card in Listview corresponding with {package_id}")
|
Logger.error(f"Could not find card in Listview corresponding with {package_id}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user