mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Added the mechanism to dismiss all Incompatible packages when the Compatibility Dialog is closed
CURA-7090
This commit is contained in:
parent
ae494110ba
commit
7ee8270b2e
2 changed files with 8 additions and 3 deletions
|
@ -36,5 +36,7 @@ class DiscrepanciesPresenter(QObject):
|
||||||
def _onConfirmClicked(self, model: SubscribedPackagesModel) -> None:
|
def _onConfirmClicked(self, model: SubscribedPackagesModel) -> None:
|
||||||
# For now, all compatible packages presented to the user should be installed.
|
# For now, all compatible packages presented to the user should be installed.
|
||||||
# Later, we might remove items for which the user unselected the package
|
# Later, we might remove items for which the user unselected the package
|
||||||
|
if model.getIncompatiblePackages():
|
||||||
|
self._package_manager.dismissAllIncompatiblePackages(model.getIncompatiblePackages())
|
||||||
model.setItems(model.getCompatiblePackages())
|
model.setItems(model.getCompatiblePackages())
|
||||||
self.packageMutations.emit(model)
|
self.packageMutations.emit(model) # #### proveri sho e ova???
|
||||||
|
|
|
@ -50,9 +50,12 @@ class SubscribedPackagesModel(ListModel):
|
||||||
def getCompatiblePackages(self) -> List[Dict[str, Any]]:
|
def getCompatiblePackages(self) -> List[Dict[str, Any]]:
|
||||||
return [package for package in self._items if package["is_compatible"]]
|
return [package for package in self._items if package["is_compatible"]]
|
||||||
|
|
||||||
def initialize(self, json_data: List[Dict[str, Any]]) -> None:
|
def getIncompatiblePackages(self) -> List[str]:
|
||||||
|
return [package["package_id"] for package in self._items if not package["is_compatible"]]
|
||||||
|
|
||||||
|
def initialize(self, subscribed_packages_payload: List[Dict[str, Any]]) -> None:
|
||||||
self._items.clear()
|
self._items.clear()
|
||||||
for item in json_data:
|
for item in subscribed_packages_payload:
|
||||||
if item["package_id"] not in self._discrepancies:
|
if item["package_id"] not in self._discrepancies:
|
||||||
continue
|
continue
|
||||||
package = {
|
package = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue