Merge branch 'CURA-8587_disable_update_install_and_uninstall' into cura-8587_disable_update_install_and_update/licence_agreement

# Conflicts:
#	plugins/Marketplace/PackageList.py
This commit is contained in:
casper 2021-12-06 15:49:21 +01:00
commit ec58cd2d0e
8 changed files with 144 additions and 156 deletions

View file

@ -15,9 +15,8 @@ RowLayout
property alias secondaryText: secondaryButton.text
property string busyPrimaryText: busyMessageText.text
property string busySecondaryText: busyMessageText.text
property string mainState: "primary"
property bool enabled: true
property bool busy
property bool busy: state == "busy"
signal clicked(bool primary_action)
@ -77,7 +76,7 @@ RowLayout
{
id: busyMessageText
visible: parent.visible
text: manageButton.mainState == "primary" ? manageButton.busyPrimaryText : manageButton.busySecondaryText
text: manageButton.state == "primary" ? manageButton.busyPrimaryText : manageButton.busySecondaryText
anchors.left: busyIndicator.right
anchors.verticalCenter: parent.verticalCenter

View file

@ -106,9 +106,8 @@ Window
height: UM.Theme.getSize("button_icon").height + UM.Theme.getSize("default_margin").height
spacing: UM.Theme.getSize("thin_margin").width
Rectangle
Item
{
color: "transparent"
Layout.preferredHeight: parent.height
Layout.preferredWidth: searchBar.visible ? UM.Theme.getSize("thin_margin").width : 0
Layout.fillWidth: ! searchBar.visible
@ -228,4 +227,51 @@ Window
}
}
}
Rectangle
{
height: quitButton.height + 2 * UM.Theme.getSize("default_margin").width
color: UM.Theme.getColor("primary")
visible: false // TODO: enable this when restart is required
anchors
{
left: parent.left
right: parent.right
bottom: parent.bottom
}
RowLayout
{
anchors
{
left: parent.left
right: parent.right
verticalCenter: parent.verticalCenter
margins: UM.Theme.getSize("default_margin").width
}
spacing: UM.Theme.getSize("default_margin").width
UM.RecolorImage
{
id: bannerIcon
source: UM.Theme.getIcon("Plugin")
color: UM.Theme.getColor("primary_button_text")
implicitWidth: UM.Theme.getSize("banner_icon_size").width
implicitHeight: UM.Theme.getSize("banner_icon_size").height
}
Text
{
color: UM.Theme.getColor("primary_button_text")
text: catalog.i18nc("@button", "In order to use the package you will need to restart Cura")
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
Layout.fillWidth: true
}
Cura.SecondaryButton
{
id: quitButton
text: catalog.i18nc("@button", "Quit Ultimaker Cura")
}
}
}
}

View file

@ -94,7 +94,7 @@ Rectangle
left: packageItem.right
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("thick_margin").width
rightMargin: UM.Theme.getSize("default_margin").width
top: parent.top
topMargin: UM.Theme.getSize("narrow_margin").height
}
@ -114,47 +114,13 @@ Rectangle
color: UM.Theme.getColor("text")
verticalAlignment: Text.AlignTop
}
Control
VerifiedIcon
{
Layout.preferredWidth: UM.Theme.getSize("card_tiny_icon").width
Layout.preferredHeight: UM.Theme.getSize("card_tiny_icon").height
enabled: packageData.isCheckedByUltimaker
visible: packageData.isCheckedByUltimaker
Cura.ToolTip
{
tooltipText:
{
switch(packageData.packageType)
{
case "plugin": return catalog.i18nc("@info", "Ultimaker Verified Plug-in");
case "material": return catalog.i18nc("@info", "Ultimaker Certified Material");
default: return catalog.i18nc("@info", "Ultimaker Verified Package");
}
}
visible: parent.hovered
targetPoint: Qt.point(0, Math.round(parent.y + parent.height / 4))
}
Rectangle
{
anchors.fill: parent
color: UM.Theme.getColor("action_button_hovered")
radius: width
UM.RecolorImage
{
anchors.fill: parent
color: UM.Theme.getColor("primary")
source: packageData.packageType == "plugin" ? UM.Theme.getIcon("CheckCircle") : UM.Theme.getIcon("Certified")
}
}
//NOTE: Can we link to something here? (Probably a static link explaining what verified is):
// onClicked: Qt.openUrlExternally( XXXXXX )
}
Control
{
Layout.preferredWidth: UM.Theme.getSize("card_tiny_icon").width
@ -362,12 +328,8 @@ Rectangle
secondaryText: catalog.i18nc("@button", "Disable")
busySecondaryText: catalog.i18nc("@button", "disabling...")
enabled: !(installManageButton.busy || updateManageButton.busy)
}
Connections
{
target: enableManageButton
function onClicked(primary_action)
{
onClicked: {
if (primary_action)
{
packageData.enablePackageTriggered(packageData.packageId)
@ -389,11 +351,7 @@ Rectangle
secondaryText: catalog.i18nc("@button", "Uninstall")
busySecondaryText: catalog.i18nc("@button", "uninstalling...")
enabled: !(enableManageButton.busy || updateManageButton.busy)
}
Connections
{
target: installManageButton
function onClicked(primary_action)
onClicked:
{
if (primary_action)
{
@ -414,14 +372,7 @@ Rectangle
primaryText: catalog.i18nc("@button", "Update")
busyPrimaryText: catalog.i18nc("@button", "updating...")
enabled: !(installManageButton.busy || enableManageButton.busy)
}
Connections
{
target: updateManageButton
function onClicked(primary_action)
{
packageData.updatePackageTriggered(packageData.packageId)
}
onClicked: packageData.updatePackageTriggered(packageData.packageId)
}
}
}

View file

@ -0,0 +1,45 @@
// Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1
import UM 1.6 as UM
import Cura 1.6 as Cura
Control
{
implicitWidth: UM.Theme.getSize("card_tiny_icon").width
implicitHeight: UM.Theme.getSize("card_tiny_icon").height
Cura.ToolTip
{
tooltipText:
{
switch(packageData.packageType)
{
case "plugin": return catalog.i18nc("@info", "Ultimaker Verified Plug-in");
case "material": return catalog.i18nc("@info", "Ultimaker Certified Material");
default: return catalog.i18nc("@info", "Ultimaker Verified Package");
}
}
visible: parent.hovered
targetPoint: Qt.point(0, Math.round(parent.y + parent.height / 4))
}
Rectangle
{
anchors.fill: parent
color: UM.Theme.getColor("action_button_hovered")
radius: width
UM.RecolorImage
{
anchors.fill: parent
color: UM.Theme.getColor("primary")
source: packageData.packageType == "plugin" ? UM.Theme.getIcon("CheckCircle") : UM.Theme.getIcon("Certified")
}
}
//NOTE: Can we link to something here? (Probably a static link explaining what verified is):
// onClicked: Qt.openUrlExternally( XXXXXX )
}