mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 00:07:51 -06:00
Show install, uninstall & disable buttons in packages list
This splits up the single show controls property into three seperate ones and no longer hides installed packages from the plugin & materials list CURA-8834
This commit is contained in:
parent
6cbcf09580
commit
095b8dc5dd
8 changed files with 28 additions and 16 deletions
|
@ -117,9 +117,6 @@ class RemotePackageList(PackageList):
|
||||||
return
|
return
|
||||||
|
|
||||||
for package_data in response_data["data"]:
|
for package_data in response_data["data"]:
|
||||||
package_id = package_data["package_id"]
|
|
||||||
if package_id in self._package_manager.local_packages_ids:
|
|
||||||
continue # We should only show packages which are not already installed
|
|
||||||
try:
|
try:
|
||||||
package = PackageModel(package_data, parent = self)
|
package = PackageModel(package_data, parent = self)
|
||||||
self._connectManageButtonSignals(package)
|
self._connectManageButtonSignals(package)
|
||||||
|
|
|
@ -19,7 +19,8 @@ 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
|
showUpdateButton: true
|
||||||
|
showInstallButton: true
|
||||||
|
showDisableButton: true
|
||||||
model: manager.LocalPackageList
|
model: manager.LocalPackageList
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,8 @@ 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
|
showUpdateButton: true
|
||||||
|
showInstallButton: true
|
||||||
|
|
||||||
model: manager.MaterialPackageList
|
model: manager.MaterialPackageList
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,9 @@ import Cura 1.6 as Cura
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
property alias packageData: packageCardHeader.packageData
|
property alias packageData: packageCardHeader.packageData
|
||||||
property alias manageableInListView: packageCardHeader.showManageButtons
|
property alias showUpdateButton: packageCardHeader.showUpdateButton
|
||||||
|
property alias showDisableButton: packageCardHeader.showDisableButton
|
||||||
|
property alias showInstallButton: packageCardHeader.showInstallButton
|
||||||
|
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
color: UM.Theme.getColor("main_background")
|
color: UM.Theme.getColor("main_background")
|
||||||
|
|
|
@ -12,10 +12,13 @@ import Cura 1.6 as Cura
|
||||||
// are combined into the reusable "PackageCardHeader" component
|
// are combined into the reusable "PackageCardHeader" component
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
default property alias contents: contentItem.children;
|
default property alias contents: contentItem.children
|
||||||
|
|
||||||
property var packageData
|
property var packageData
|
||||||
property bool showManageButtons: false
|
property bool showDisableButton: false
|
||||||
|
property bool showInstallButton: false
|
||||||
|
property bool showUpdateButton: false
|
||||||
|
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: UM.Theme.getSize("card").height
|
height: UM.Theme.getSize("card").height
|
||||||
|
@ -157,7 +160,7 @@ Item
|
||||||
ManageButton
|
ManageButton
|
||||||
{
|
{
|
||||||
id: enableManageButton
|
id: enableManageButton
|
||||||
visible: showManageButtons && packageData.isInstalled && !packageData.isToBeInstalled && packageData.packageType != "material"
|
visible: showDisableButton && packageData.isInstalled && !packageData.isToBeInstalled && packageData.packageType != "material"
|
||||||
enabled: !packageData.busy
|
enabled: !packageData.busy
|
||||||
|
|
||||||
button_style: !packageData.isActive
|
button_style: !packageData.isActive
|
||||||
|
@ -171,7 +174,7 @@ Item
|
||||||
ManageButton
|
ManageButton
|
||||||
{
|
{
|
||||||
id: installManageButton
|
id: installManageButton
|
||||||
visible: showManageButtons && (packageData.canDowngrade || !packageData.isBundled)
|
visible: showInstallButton && (packageData.canDowngrade || !packageData.isBundled)
|
||||||
enabled: !packageData.busy
|
enabled: !packageData.busy
|
||||||
busy: packageData.busy
|
busy: packageData.busy
|
||||||
button_style: !(packageData.isInstalled || packageData.isToBeInstalled)
|
button_style: !(packageData.isInstalled || packageData.isToBeInstalled)
|
||||||
|
@ -201,7 +204,7 @@ Item
|
||||||
ManageButton
|
ManageButton
|
||||||
{
|
{
|
||||||
id: updateManageButton
|
id: updateManageButton
|
||||||
visible: showManageButtons && packageData.canUpdate
|
visible: showUpdateButton && packageData.canUpdate
|
||||||
enabled: !packageData.busy
|
enabled: !packageData.busy
|
||||||
busy: packageData.busy
|
busy: packageData.busy
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|
|
@ -31,7 +31,9 @@ Rectangle
|
||||||
PackageCardHeader
|
PackageCardHeader
|
||||||
{
|
{
|
||||||
id: packageCardHeader
|
id: packageCardHeader
|
||||||
showManageButtons: true
|
showUpdateButton: true
|
||||||
|
showInstallButton: true
|
||||||
|
showDisableButton: true
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,10 @@ ListView
|
||||||
property string bannerText
|
property string bannerText
|
||||||
property string bannerReadMoreUrl
|
property string bannerReadMoreUrl
|
||||||
property var onRemoveBanner
|
property var onRemoveBanner
|
||||||
property bool packagesManageableInListView
|
|
||||||
|
property bool showUpdateButton
|
||||||
|
property bool showDisableButton
|
||||||
|
property bool showInstallButton
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
|
@ -81,7 +84,9 @@ ListView
|
||||||
|
|
||||||
PackageCard
|
PackageCard
|
||||||
{
|
{
|
||||||
manageableInListView: packages.packagesManageableInListView
|
showUpdateButton: packages.showUpdateButton
|
||||||
|
showDisableButton: packages.showDisableButton
|
||||||
|
showInstallButton: packages.showInstallButton
|
||||||
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")
|
||||||
|
|
|
@ -16,7 +16,8 @@ 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
|
showUpdateButton: true
|
||||||
|
showInstallButton: true
|
||||||
|
|
||||||
model: manager.PluginPackageList
|
model: manager.PluginPackageList
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue