From 27cb1d2d9f858f5c24d2363a5a1ca32baedabf33 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 8 Dec 2021 14:04:19 +0100 Subject: [PATCH] Also have/keep the uninstalled status displayed. 'isRecentlyInstalled' was both for installing _and_ uninstalling. Will add the rename to the refactor later on. part of CURA-8587 --- plugins/Marketplace/PackageModel.py | 5 +++-- plugins/Marketplace/resources/qml/PackageCard.qml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Marketplace/PackageModel.py b/plugins/Marketplace/PackageModel.py index c17769d6ef..b1b6db733d 100644 --- a/plugins/Marketplace/PackageModel.py +++ b/plugins/Marketplace/PackageModel.py @@ -7,6 +7,7 @@ from typing import Any, Dict, List, Optional from PyQt5.QtCore import pyqtProperty, QObject, pyqtSignal +from cura.CuraApplication import CuraApplication 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. @@ -371,8 +372,8 @@ class PackageModel(QObject): self.stateManageButtonChanged.emit() @pyqtProperty(bool, notify = stateManageButtonChanged) - def isRecentlyInstalled(self): - return self._is_recently_installed + def installationStatus(self): + return self._package_id in CuraApplication.getInstance().getPackageManager().getPackagesToInstall() @property def can_downgrade(self) -> bool: diff --git a/plugins/Marketplace/resources/qml/PackageCard.qml b/plugins/Marketplace/resources/qml/PackageCard.qml index b43ea580ba..f552bd8e69 100644 --- a/plugins/Marketplace/resources/qml/PackageCard.qml +++ b/plugins/Marketplace/resources/qml/PackageCard.qml @@ -361,7 +361,7 @@ Rectangle secondaryText: catalog.i18nc("@button", "Uninstall") busySecondaryText: catalog.i18nc("@button", "Uninstalling...") confirmedSecondaryText: catalog.i18nc("@button", "Uninstalled") - confirmedTextChoice: packageData.isRecentlyInstalled + confirmedTextChoice: packageData.installationStatus enabled: !(enableManageButton.busy || updateManageButton.busy) onClicked: