Only show manage buttons in manage tab or detail view

Contributes to: CURA-8587
This commit is contained in:
Jelle Spijker 2021-12-07 11:25:16 +01:00
parent f6966c25fb
commit 1c0e484069
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
5 changed files with 12 additions and 0 deletions

View file

@ -20,6 +20,7 @@ Packages
bannerVisible = false; bannerVisible = false;
} }
searchInBrowserUrl: "https://marketplace.ultimaker.com/app/cura/plugins?utm_source=cura&utm_medium=software&utm_campaign=marketplace-search-plugins-browser" searchInBrowserUrl: "https://marketplace.ultimaker.com/app/cura/plugins?utm_source=cura&utm_medium=software&utm_campaign=marketplace-search-plugins-browser"
packagesManageableInListView: true
model: Marketplace.LocalPackageList model: Marketplace.LocalPackageList
{ {

View file

@ -17,6 +17,7 @@ Packages
bannerVisible = false; bannerVisible = false;
} }
searchInBrowserUrl: "https://marketplace.ultimaker.com/app/cura/materials?utm_source=cura&utm_medium=software&utm_campaign=marketplace-search-materials-browser" searchInBrowserUrl: "https://marketplace.ultimaker.com/app/cura/materials?utm_source=cura&utm_medium=software&utm_campaign=marketplace-search-materials-browser"
packagesManageableInListView: false
model: Marketplace.RemotePackageList model: Marketplace.RemotePackageList
{ {

View file

@ -10,8 +10,10 @@ import Cura 1.6 as Cura
Rectangle Rectangle
{ {
id: root
property var packageData property var packageData
property bool expanded: false property bool expanded: false
property bool manageableInListView
height: childrenRect.height height: childrenRect.height
color: UM.Theme.getColor("main_background") color: UM.Theme.getColor("main_background")
@ -328,6 +330,7 @@ Rectangle
secondaryText: catalog.i18nc("@button", "Disable") secondaryText: catalog.i18nc("@button", "Disable")
busySecondaryText: catalog.i18nc("@button", "Disabling...") busySecondaryText: catalog.i18nc("@button", "Disabling...")
enabled: !(installManageButton.busy || updateManageButton.busy) enabled: !(installManageButton.busy || updateManageButton.busy)
visible: root.manageableInListView || root.expanded
onClicked: { onClicked: {
if (primary_action) if (primary_action)
@ -351,6 +354,8 @@ Rectangle
secondaryText: catalog.i18nc("@button", "Uninstall") secondaryText: catalog.i18nc("@button", "Uninstall")
busySecondaryText: catalog.i18nc("@button", "Uninstalling...") busySecondaryText: catalog.i18nc("@button", "Uninstalling...")
enabled: !(enableManageButton.busy || updateManageButton.busy) enabled: !(enableManageButton.busy || updateManageButton.busy)
visible: root.manageableInListView || root.expanded
onClicked: onClicked:
{ {
if (primary_action) if (primary_action)
@ -372,6 +377,8 @@ Rectangle
primaryText: catalog.i18nc("@button", "Update") primaryText: catalog.i18nc("@button", "Update")
busyPrimaryText: catalog.i18nc("@button", "updating...") busyPrimaryText: catalog.i18nc("@button", "updating...")
enabled: !(installManageButton.busy || enableManageButton.busy) enabled: !(installManageButton.busy || enableManageButton.busy)
visible: root.manageableInListView || root.expanded
onClicked: packageData.updatePackageTriggered(packageData.packageId) onClicked: packageData.updatePackageTriggered(packageData.packageId)
} }
} }

View file

@ -19,6 +19,7 @@ ListView
property string bannerText property string bannerText
property string bannerReadMoreUrl property string bannerReadMoreUrl
property var onRemoveBanner property var onRemoveBanner
property bool packagesManageableInListView
clip: true clip: true
@ -80,6 +81,7 @@ ListView
PackageCard PackageCard
{ {
manageableInListView: packages.packagesManageableInListView
packageData: model.package packageData: model.package
width: parent.width - UM.Theme.getSize("default_margin").width - UM.Theme.getSize("narrow_margin").width width: parent.width - UM.Theme.getSize("default_margin").width - UM.Theme.getSize("narrow_margin").width
color: cardMouseArea.containsMouse ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("main_background") color: cardMouseArea.containsMouse ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("main_background")

View file

@ -17,6 +17,7 @@ Packages
bannerVisible = false; bannerVisible = false;
} }
searchInBrowserUrl: "https://marketplace.ultimaker.com/app/cura/plugins?utm_source=cura&utm_medium=software&utm_campaign=marketplace-search-plugins-browser" searchInBrowserUrl: "https://marketplace.ultimaker.com/app/cura/plugins?utm_source=cura&utm_medium=software&utm_campaign=marketplace-search-plugins-browser"
packagesManageableInListView: false
model: Marketplace.RemotePackageList model: Marketplace.RemotePackageList
{ {