Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelle Spijker <spijker.jelle@gmail.com>2021-12-09 11:56:41 +0300
committerJelle Spijker <spijker.jelle@gmail.com>2021-12-09 11:56:41 +0300
commit51a77f683dc0b227089825af9c3235d557a56ba4 (patch)
tree43f3c8f14ebca2f447f8d5601e106814bd29d685 /plugins/Marketplace/resources
parent59470814e2be076e10afa717190a4e39fe267a6e (diff)
Moved stateManageButton logic out of the packageModel
Contributes to: CURA-8587
Diffstat (limited to 'plugins/Marketplace/resources')
-rw-r--r--plugins/Marketplace/resources/qml/PackageCardHeader.qml12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Marketplace/resources/qml/PackageCardHeader.qml b/plugins/Marketplace/resources/qml/PackageCardHeader.qml
index 5859fbcd8e..4964338ab2 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.stateManageEnableButton
+ button_style: packageData.isInstalled && packageData.isActive
Layout.alignment: Qt.AlignTop
text: packageData.stateManageEnableButton ? catalog.i18nc("@button", "Enable") : catalog.i18nc("@button", "Disable")
@@ -213,23 +213,23 @@ Item
enabled: !packageData.isUpdating
busy: packageData.isInstalling
- confirmed: packageData.isRecentlyInstalled
+ confirmed: packageData.isRecentlyInstalled || packageData.isRecentlyUninstalled
- button_style: packageData.stateManageInstallButton
+ button_style: !packageData.isInstalled
Layout.alignment: Qt.AlignTop
text:
{
- if (packageData.stateManageInstallButton)
+ if (packageData.isRecentlyInstalled) { return catalog.i18nc("@button", "Installed"); }
+ if (packageData.isRecentlyUninstalled) { return catalog.i18nc("@button", "Uninstalled"); }
+ if (button_style)
{
if (packageData.isInstalling) { return catalog.i18nc("@button", "Installing..."); }
- else if (packageData.isRecentlyInstalled) { return catalog.i18nc("@button", "Installed"); }
else { return catalog.i18nc("@button", "Install"); }
}
else
{
if (packageData.isInstalling) { return catalog.i18nc("@button", "Uninstalling..."); }
- else if (packageData.isUninstalled) { return catalog.i18nc("@button", "Uninstalled"); }
else { return catalog.i18nc("@button", "Uninstall"); }
}
}