Removed previous variants of the dismiss incompatible package functionality

CURA-7090
This commit is contained in:
Dimitriovski 2020-01-24 13:56:59 +01:00
parent 7ee8270b2e
commit 05e17843c6
No known key found for this signature in database
GPG key ID: 4E62757E2B0D304D
3 changed files with 0 additions and 32 deletions

View file

@ -125,26 +125,6 @@ UM.Dialog{
color: UM.Theme.getColor("text")
elide: Text.ElideRight
}
UM.TooltipArea
{
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip", "Dismisses the package and won't be shown in this dialog anymore")
anchors.right: parent.right
anchors.verticalCenter: packageIcon.verticalCenter
Label
{
text: "(Dismiss)"
font: UM.Theme.getFont("small")
color: UM.Theme.getColor("text")
MouseArea
{
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: handler.dismissIncompatiblePackage(subscribedPackagesModel, model.package_id)
}
}
}
}
}
}

View file

@ -28,11 +28,6 @@ class DiscrepanciesPresenter(QObject):
assert self._dialog
self._dialog.accepted.connect(lambda: self._onConfirmClicked(model))
@pyqtSlot("QVariant", str)
def dismissIncompatiblePackage(self, model: SubscribedPackagesModel, package_id: str) -> None:
model.dismissPackage(package_id) # update the model to update the view
self._package_manager.dismissPackage(package_id) # adds this package_id as dismissed in the user config file
def _onConfirmClicked(self, model: SubscribedPackagesModel) -> None:
# For now, all compatible packages presented to the user should be installed.
# Later, we might remove items for which the user unselected the package

View file

@ -37,13 +37,6 @@ class SubscribedPackagesModel(ListModel):
return True
return False
@pyqtSlot()
def dismissPackage(self, package_id: str) -> None:
package = self.find(key="package_id", value=package_id)
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 addDiscrepancies(self, discrepancy: List[str]) -> None:
self._discrepancies = discrepancy