mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Prevent abstract machines from being deleted in the config menu
CURA-9277
This commit is contained in:
parent
8bb2671a28
commit
27fc11b840
2 changed files with 4 additions and 3 deletions
|
@ -172,6 +172,7 @@ class GlobalStacksModel(ListModel):
|
||||||
"metadata": container_stack.getMetaData().copy(),
|
"metadata": container_stack.getMetaData().copy(),
|
||||||
"discoverySource": section_name,
|
"discoverySource": section_name,
|
||||||
"removalWarning": removal_warning,
|
"removalWarning": removal_warning,
|
||||||
"isOnline": is_online})
|
"isOnline": is_online,
|
||||||
|
"isAbstractMachine": is_abstract_machine})
|
||||||
items.sort(key=lambda i: (not i["hasRemoteConnection"], i["name"]))
|
items.sort(key=lambda i: (not i["hasRemoteConnection"], i["name"]))
|
||||||
self.setItems(items)
|
self.setItems(items)
|
||||||
|
|
|
@ -17,7 +17,7 @@ UM.ManagementPage
|
||||||
title: catalog.i18nc("@title:tab", "Printers")
|
title: catalog.i18nc("@title:tab", "Printers")
|
||||||
detailsPlaneCaption: base.currentItem && base.currentItem.name ? base.currentItem.name : ""
|
detailsPlaneCaption: base.currentItem && base.currentItem.name ? base.currentItem.name : ""
|
||||||
|
|
||||||
model: Cura.GlobalStacksModel { filterAbstractMachines: false }
|
model: Cura.GlobalStacksModel { }
|
||||||
|
|
||||||
sectionRole: "discoverySource"
|
sectionRole: "discoverySource"
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ UM.ManagementPage
|
||||||
Cura.MenuItem
|
Cura.MenuItem
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:button", "Remove")
|
text: catalog.i18nc("@action:button", "Remove")
|
||||||
enabled: base.currentItem != null && model.count > 1
|
enabled: base.currentItem != null && model.count > 1 && !base.currentItem.isAbstractMachine
|
||||||
onTriggered: confirmDialog.open()
|
onTriggered: confirmDialog.open()
|
||||||
}
|
}
|
||||||
Cura.MenuItem
|
Cura.MenuItem
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue