mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Enable and disabled now toggle correctly
Contributes to: CURA-8587
This commit is contained in:
parent
9874b0c8ba
commit
1adae61f39
3 changed files with 6 additions and 3 deletions
|
@ -267,8 +267,6 @@ class PackageList(ListModel):
|
||||||
package.installPackageTriggered.connect(self.installPackage)
|
package.installPackageTriggered.connect(self.installPackage)
|
||||||
package.uninstallPackageTriggered.connect(self.uninstallPackage)
|
package.uninstallPackageTriggered.connect(self.uninstallPackage)
|
||||||
package.updatePackageTriggered.connect(self.updatePackage)
|
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:
|
def installPackage(self, package_id: str) -> None:
|
||||||
"""Install a package from the Marketplace
|
"""Install a package from the Marketplace
|
||||||
|
|
|
@ -11,6 +11,7 @@ from cura.CuraApplication import CuraApplication
|
||||||
from cura.CuraPackageManager import CuraPackageManager
|
from cura.CuraPackageManager import CuraPackageManager
|
||||||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry # To get names of materials we're compatible with.
|
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.i18n import i18nCatalog # To translate placeholder names if data is not present.
|
||||||
|
from UM.Logger import Logger
|
||||||
from UM.PluginRegistry import PluginRegistry
|
from UM.PluginRegistry import PluginRegistry
|
||||||
|
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
@ -93,6 +94,9 @@ class PackageModel(QObject):
|
||||||
self.setIsInstalling(False)
|
self.setIsInstalling(False)
|
||||||
|
|
||||||
self._package_manager.installedPackagesChanged.connect(finished_installed)
|
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):
|
def __eq__(self, other: object):
|
||||||
if isinstance(other, PackageModel):
|
if isinstance(other, PackageModel):
|
||||||
|
@ -310,6 +314,7 @@ class PackageModel(QObject):
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = stateManageButtonChanged)
|
@pyqtProperty(bool, notify = stateManageButtonChanged)
|
||||||
def isActive(self):
|
def isActive(self):
|
||||||
|
Logger.debug(f"getDisabledPlugins = {self._plugin_registry.getDisabledPlugins()}")
|
||||||
return not self._package_id in self._plugin_registry.getDisabledPlugins()
|
return not self._package_id in self._plugin_registry.getDisabledPlugins()
|
||||||
|
|
||||||
def setIsInstalling(self, value: bool) -> None:
|
def setIsInstalling(self, value: bool) -> None:
|
||||||
|
|
|
@ -187,7 +187,7 @@ Item
|
||||||
busy: false
|
busy: false
|
||||||
confirmed: false
|
confirmed: false
|
||||||
|
|
||||||
button_style: packageData.isInstalled && !packageData.isActive
|
button_style: !packageData.isActive
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|
||||||
text: button_style ? catalog.i18nc("@button", "Enable") : catalog.i18nc("@button", "Disable")
|
text: button_style ? catalog.i18nc("@button", "Enable") : catalog.i18nc("@button", "Disable")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue