diff options
-rw-r--r-- | plugins/Marketplace/PackageList.py | 2 | ||||
-rw-r--r-- | plugins/Marketplace/PackageModel.py | 5 | ||||
-rw-r--r-- | plugins/Marketplace/resources/qml/PackageCardHeader.qml | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/plugins/Marketplace/PackageList.py b/plugins/Marketplace/PackageList.py index 4271166318..8ddd74ead9 100644 --- a/plugins/Marketplace/PackageList.py +++ b/plugins/Marketplace/PackageList.py @@ -267,8 +267,6 @@ class PackageList(ListModel): package.installPackageTriggered.connect(self.installPackage) package.uninstallPackageTriggered.connect(self.uninstallPackage) package.updatePackageTriggered.connect(self.updatePackage) - package.enablePackageTriggered.connect(self._plugin_registry.enablePlugin) - package.disablePackageTriggered.connect(self._plugin_registry.disablePlugin) def installPackage(self, package_id: str) -> None: """Install a package from the Marketplace diff --git a/plugins/Marketplace/PackageModel.py b/plugins/Marketplace/PackageModel.py index 14a71206d9..aa63d6da13 100644 --- a/plugins/Marketplace/PackageModel.py +++ b/plugins/Marketplace/PackageModel.py @@ -11,6 +11,7 @@ from cura.CuraApplication import CuraApplication from cura.CuraPackageManager import CuraPackageManager from cura.Settings.CuraContainerRegistry import CuraContainerRegistry # To get names of materials we're compatible with. from UM.i18n import i18nCatalog # To translate placeholder names if data is not present. +from UM.Logger import Logger from UM.PluginRegistry import PluginRegistry catalog = i18nCatalog("cura") @@ -93,6 +94,9 @@ class PackageModel(QObject): self.setIsInstalling(False) self._package_manager.installedPackagesChanged.connect(finished_installed) + self.enablePackageTriggered.connect(self._plugin_registry.enablePlugin) + self.disablePackageTriggered.connect(self._plugin_registry.disablePlugin) + self._plugin_registry.hasPluginsEnabledOrDisabledChanged.connect(self.stateManageButtonChanged) def __eq__(self, other: object): if isinstance(other, PackageModel): @@ -310,6 +314,7 @@ class PackageModel(QObject): @pyqtProperty(bool, notify = stateManageButtonChanged) def isActive(self): + Logger.debug(f"getDisabledPlugins = {self._plugin_registry.getDisabledPlugins()}") return not self._package_id in self._plugin_registry.getDisabledPlugins() def setIsInstalling(self, value: bool) -> None: diff --git a/plugins/Marketplace/resources/qml/PackageCardHeader.qml b/plugins/Marketplace/resources/qml/PackageCardHeader.qml index ff999c1ee6..5a693ece83 100644 --- a/plugins/Marketplace/resources/qml/PackageCardHeader.qml +++ b/plugins/Marketplace/resources/qml/PackageCardHeader.qml @@ -187,7 +187,7 @@ Item busy: false confirmed: false - button_style: packageData.isInstalled && !packageData.isActive + button_style: !packageData.isActive Layout.alignment: Qt.AlignTop text: button_style ? catalog.i18nc("@button", "Enable") : catalog.i18nc("@button", "Disable") |