mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Added check to reevaluate dismissed incompatible packages (in case the package gets updated and has the correct SDK version)
CURA-7090-addition
This commit is contained in:
parent
39780636a9
commit
365c30fadb
2 changed files with 10 additions and 11 deletions
|
@ -37,27 +37,22 @@ class SubscribedPackagesModel(ListModel):
|
|||
return True
|
||||
return False
|
||||
|
||||
# Sets the "is_compatible" to True for the given package, in memory
|
||||
|
||||
@pyqtSlot()
|
||||
def dismissPackage(self, package_id: str) -> None:
|
||||
package = self.find(key="package_id", value=package_id)
|
||||
if package != -1:
|
||||
if package != -1: # find() returns -1 if it doesn't finds what is looking for
|
||||
self.setProperty(package, property="is_dismissed", value=True)
|
||||
Logger.debug("Package {} has been dismissed".format(package_id))
|
||||
|
||||
def setMetadata(self, data: List[Dict[str, List[Any]]]) -> None:
|
||||
self._metadata = data
|
||||
|
||||
def addDiscrepancies(self, discrepancy: List[str]) -> None:
|
||||
self._discrepancies = discrepancy
|
||||
|
||||
def getCompatiblePackages(self):
|
||||
return [x for x in self._items if x["is_compatible"]]
|
||||
return [package for package in self._items if package["is_compatible"]]
|
||||
|
||||
def initialize(self) -> None:
|
||||
def initialize(self, json_data: List[Dict[str, List[Any]]]) -> None:
|
||||
self._items.clear()
|
||||
for item in self._metadata:
|
||||
for item in json_data:
|
||||
if item["package_id"] not in self._discrepancies:
|
||||
continue
|
||||
package = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue