mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-24 13:39:05 +08:00
Prevent abstract machines from being deleted in the config menu
CURA-9277
This commit is contained in:
parent
8bb2671a28
commit
27fc11b840
@ -172,6 +172,7 @@ class GlobalStacksModel(ListModel):
|
||||
"metadata": container_stack.getMetaData().copy(),
|
||||
"discoverySource": section_name,
|
||||
"removalWarning": removal_warning,
|
||||
"isOnline": is_online})
|
||||
"isOnline": is_online,
|
||||
"isAbstractMachine": is_abstract_machine})
|
||||
items.sort(key=lambda i: (not i["hasRemoteConnection"], i["name"]))
|
||||
self.setItems(items)
|
||||
|
@ -17,7 +17,7 @@ UM.ManagementPage
|
||||
title: catalog.i18nc("@title:tab", "Printers")
|
||||
detailsPlaneCaption: base.currentItem && base.currentItem.name ? base.currentItem.name : ""
|
||||
|
||||
model: Cura.GlobalStacksModel { filterAbstractMachines: false }
|
||||
model: Cura.GlobalStacksModel { }
|
||||
|
||||
sectionRole: "discoverySource"
|
||||
|
||||
@ -139,7 +139,7 @@ UM.ManagementPage
|
||||
Cura.MenuItem
|
||||
{
|
||||
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()
|
||||
}
|
||||
Cura.MenuItem
|
||||
|
Loading…
x
Reference in New Issue
Block a user