mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Show the uninstall button for packages which can be downgraded to the bundled version
Contributes to: CURA-8587
This commit is contained in:
parent
28b6bfb729
commit
1cc3d374a0
2 changed files with 16 additions and 3 deletions
|
@ -66,6 +66,7 @@ class PackageModel(QObject):
|
|||
self._can_update = False
|
||||
self._is_updating = False
|
||||
self._is_enabling = False
|
||||
self._can_downgrade = False
|
||||
self._section_title = section_title
|
||||
self.sdk_version = package_data.get("sdk_version_semver", "")
|
||||
# Note that there's a lot more info in the package_data than just these specified here.
|
||||
|
@ -323,7 +324,7 @@ class PackageModel(QObject):
|
|||
if self._is_recently_managed:
|
||||
return "hidden"
|
||||
if self._is_installed:
|
||||
if self._is_bundled:
|
||||
if self._is_bundled and not self._can_downgrade:
|
||||
return "hidden"
|
||||
else:
|
||||
return "secondary"
|
||||
|
@ -350,6 +351,16 @@ class PackageModel(QObject):
|
|||
self._is_installing = value
|
||||
self.stateManageButtonChanged.emit()
|
||||
|
||||
@property
|
||||
def can_downgrade(self) -> bool:
|
||||
return self._can_downgrade
|
||||
|
||||
@can_downgrade.setter
|
||||
def can_downgrade(self, value: bool) -> None:
|
||||
if value != self._can_downgrade:
|
||||
self._can_downgrade = value
|
||||
self.stateManageButtonChanged.emit()
|
||||
|
||||
# --- Updating ---
|
||||
|
||||
@pyqtProperty(str, notify = stateManageButtonChanged)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue