diff options
author | Jelle Spijker <spijker.jelle@gmail.com> | 2021-12-07 14:23:04 +0300 |
---|---|---|
committer | Jelle Spijker <spijker.jelle@gmail.com> | 2021-12-07 14:23:04 +0300 |
commit | ca76bcc29cc573b777c72ace624e384f78eff3d6 (patch) | |
tree | 0ae0edfadfbf4fc1ddc0f053f3eecce2ea736e39 /plugins/Marketplace/resources | |
parent | 1c0e484069cfef1e6cd063684724d978506b95c6 (diff) |
Show a conformation message after a successful manage action
Contributes to: CURA-8587
Diffstat (limited to 'plugins/Marketplace/resources')
-rw-r--r-- | plugins/Marketplace/resources/qml/ManageButton.qml | 68 | ||||
-rw-r--r-- | plugins/Marketplace/resources/qml/PackageCard.qml | 11 |
2 files changed, 74 insertions, 5 deletions
diff --git a/plugins/Marketplace/resources/qml/ManageButton.qml b/plugins/Marketplace/resources/qml/ManageButton.qml index 39be04d386..67532bc9aa 100644 --- a/plugins/Marketplace/resources/qml/ManageButton.qml +++ b/plugins/Marketplace/resources/qml/ManageButton.qml @@ -15,6 +15,8 @@ RowLayout property alias secondaryText: secondaryButton.text property string busyPrimaryText: busyMessageText.text property string busySecondaryText: busyMessageText.text + property string confirmedPrimaryText: confirmedMessageText.text + property string confirmedSecondaryText: confirmedMessageText.text property bool enabled: true property bool busy: state == "busy" @@ -28,7 +30,8 @@ RowLayout onClicked: { - busyMessageText.text = manageButton.busyPrimaryText + busyMessage.text = manageButton.busyPrimaryText + confirmedMessage.text = manageButton.confirmedPrimaryText manageButton.clicked(true) } } @@ -41,7 +44,8 @@ RowLayout onClicked: { - busyMessageText.text = manageButton.busySecondaryText + busyMessage.text = manageButton.busySecondaryText + confirmedMessage.text = manageButton.confirmedSecondaryText manageButton.clicked(false) } } @@ -50,6 +54,7 @@ RowLayout { id: busyMessage visible: false + property alias text: busyMessageText.text height: UM.Theme.getSize("action_button").height width: childrenRect.width @@ -90,6 +95,26 @@ RowLayout } } + Item + { + id: confirmedMessage + property alias text: confirmedMessageText.text + + visible: false + height: UM.Theme.getSize("action_button").height + width: childrenRect.width + + Label + { + id: confirmedMessageText + visible: parent.visble + anchors.verticalCenter: parent.verticalCenter + + font: UM.Theme.getFont("medium_bold") + color: UM.Theme.getColor("primary") + } + } + states: [ State @@ -110,6 +135,11 @@ RowLayout target: busyMessage visible: false } + PropertyChanges + { + target: confirmedMessage + visible: false + } }, State { @@ -129,6 +159,11 @@ RowLayout target: busyMessage visible: false } + PropertyChanges + { + target: confirmedMessage + visible: false + } }, State { @@ -157,6 +192,35 @@ RowLayout target: busyMessage visible: manageButton.visible } + PropertyChanges + { + target: confirmedMessage + visible: false + } + }, + State + { + name: "confirmed" + PropertyChanges + { + target: primaryButton + visible: false + } + PropertyChanges + { + target: secondaryButton + visible: false + } + PropertyChanges + { + target: busyMessage + visible: false + } + PropertyChanges + { + target: confirmedMessage + visible: manageButton.visible + } } ] } diff --git a/plugins/Marketplace/resources/qml/PackageCard.qml b/plugins/Marketplace/resources/qml/PackageCard.qml index 326cf0583f..46e9214284 100644 --- a/plugins/Marketplace/resources/qml/PackageCard.qml +++ b/plugins/Marketplace/resources/qml/PackageCard.qml @@ -326,9 +326,11 @@ Rectangle state: packageData.stateManageEnableButton Layout.alignment: Qt.AlignTop primaryText: catalog.i18nc("@button", "Enable") - busyPrimaryText: catalog.i18nc("@button", "Inabling...") + busyPrimaryText: catalog.i18nc("@button", "Enabling...") + confirmedPrimaryText: catalog.i18nc("@button", "Enabled") secondaryText: catalog.i18nc("@button", "Disable") busySecondaryText: catalog.i18nc("@button", "Disabling...") + confirmedSecondaryText: catalog.i18nc("@button", "Disabled") enabled: !(installManageButton.busy || updateManageButton.busy) visible: root.manageableInListView || root.expanded @@ -351,10 +353,12 @@ Rectangle Layout.alignment: Qt.AlignTop primaryText: catalog.i18nc("@button", "Install") busyPrimaryText: catalog.i18nc("@button", "Installing...") + confirmedPrimaryText: catalog.i18nc("@button", "Installed") secondaryText: catalog.i18nc("@button", "Uninstall") busySecondaryText: catalog.i18nc("@button", "Uninstalling...") + confirmedSecondaryText: catalog.i18nc("@button", "Uninstalled") enabled: !(enableManageButton.busy || updateManageButton.busy) - visible: root.manageableInListView || root.expanded + visible: state == "confirmed" || root.manageableInListView || root.expanded onClicked: { @@ -375,7 +379,8 @@ Rectangle state: packageData.stateManageUpdateButton Layout.alignment: Qt.AlignTop primaryText: catalog.i18nc("@button", "Update") - busyPrimaryText: catalog.i18nc("@button", "updating...") + busyPrimaryText: catalog.i18nc("@button", "Updating...") + confirmedPrimaryText: catalog.i18nc("@button", "Updated") enabled: !(installManageButton.busy || enableManageButton.busy) visible: root.manageableInListView || root.expanded |