Enable or disable a plugin functionality added

Contributes to: CURA-8587
This commit is contained in:
Jelle Spijker 2021-12-06 11:34:23 +01:00
parent ea85e59e50
commit 579cc7bdbc
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
2 changed files with 16 additions and 4 deletions

View file

@ -287,8 +287,6 @@ class PackageModel(QObject):
if self._is_recently_managed:
return "hidden"
if self._package_type == "material":
if self._is_bundled: # TODO: Check if a bundled material can/should be un-/install en-/disabled
return "secondary"
return "hidden"
if not self._is_installed:
return "hidden"
@ -306,6 +304,16 @@ class PackageModel(QObject):
self._is_enabling = value
self.stateManageButtonChanged.emit()
@property
def is_active(self) -> bool:
return self._is_active
@is_active.setter
def is_active(self, value: bool) -> None:
if value != self._is_active:
self._is_active = value
self.stateManageButtonChanged.emit()
# --- Installing ---
@pyqtProperty(str, notify = stateManageButtonChanged)