mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Removed previous variants of the dismiss incompatible package functionality
CURA-7090
This commit is contained in:
parent
7ee8270b2e
commit
05e17843c6
3 changed files with 0 additions and 32 deletions
|
@ -125,26 +125,6 @@ UM.Dialog{
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
elide: Text.ElideRight
|
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,11 +28,6 @@ class DiscrepanciesPresenter(QObject):
|
||||||
assert self._dialog
|
assert self._dialog
|
||||||
self._dialog.accepted.connect(lambda: self._onConfirmClicked(model))
|
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:
|
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
|
||||||
|
|
|
@ -37,13 +37,6 @@ class SubscribedPackagesModel(ListModel):
|
||||||
return True
|
return True
|
||||||
return False
|
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:
|
def addDiscrepancies(self, discrepancy: List[str]) -> None:
|
||||||
self._discrepancies = discrepancy
|
self._discrepancies = discrepancy
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue