mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
Show a conformation message after a successful manage action
Contributes to: CURA-8587
This commit is contained in:
parent
1c0e484069
commit
ca76bcc29c
4 changed files with 91 additions and 22 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue