mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
CURA-5296 Added "canDowngrade" functionality
Shows "Downgrade" instead of "Uninstall" for bundled packages with an upgrade installed.
This commit is contained in:
parent
fea37b52be
commit
0b0fb4cd2f
3 changed files with 23 additions and 3 deletions
|
@ -8,6 +8,8 @@ import UM 1.1 as UM
|
|||
|
||||
Column
|
||||
{
|
||||
property bool canUpdate: false
|
||||
property bool canDowngrade: false
|
||||
width: UM.Theme.getSize("toolbox_action_button").width
|
||||
spacing: UM.Theme.getSize("narrow_margin").height
|
||||
|
||||
|
@ -36,7 +38,7 @@ Column
|
|||
Button
|
||||
{
|
||||
id: removeButton
|
||||
text: catalog.i18nc("@action:button", "Uninstall")
|
||||
text: canDowngrade ? catalog.i18nc("@action:button", "Downgrade") : catalog.i18nc("@action:button", "Uninstall")
|
||||
visible: !model.is_bundled
|
||||
enabled: !toolbox.isDownloading
|
||||
style: ButtonStyle
|
||||
|
@ -72,5 +74,11 @@ Column
|
|||
}
|
||||
}
|
||||
onClicked: toolbox.uninstall(model.id)
|
||||
Connections
|
||||
{
|
||||
target: toolbox
|
||||
onMetadataChanged: canUpdate = toolbox.canUpdate(model.id)
|
||||
onMetadataChanged: canDowngrade = toolbox.canDowngrade(model.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue