mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:45:52 +08:00
Prevent removing the last printer, disable Activate button for current active printer
Fixes CURA-1631
This commit is contained in:
parent
3638890138
commit
21e8dd151e
@ -12,11 +12,9 @@ UM.ManagementPage
|
|||||||
id: base;
|
id: base;
|
||||||
|
|
||||||
title: catalog.i18nc("@title:tab", "Printers");
|
title: catalog.i18nc("@title:tab", "Printers");
|
||||||
property int numInstances: model.rowCount();
|
|
||||||
model: UM.ContainerStacksModel
|
model: UM.ContainerStacksModel
|
||||||
{
|
{
|
||||||
filter: {"type": "machine"}
|
filter: {"type": "machine"}
|
||||||
onDataChanged: numInstances = model.rowCount()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onAddObject: Printer.requestAddPrinter()
|
onAddObject: Printer.requestAddPrinter()
|
||||||
@ -24,9 +22,9 @@ UM.ManagementPage
|
|||||||
onRenameObject: renameDialog.open();
|
onRenameObject: renameDialog.open();
|
||||||
onActivateObject: Cura.MachineManager.setActiveMachine(base.currentItem.id)
|
onActivateObject: Cura.MachineManager.setActiveMachine(base.currentItem.id)
|
||||||
|
|
||||||
removeEnabled: base.currentItem != null && numInstances > 1
|
removeEnabled: base.currentItem != null && model.rowCount() > 1
|
||||||
renameEnabled: base.currentItem != null && numInstances > 0
|
renameEnabled: base.currentItem != null
|
||||||
activateEnabled: base.currentItem != null
|
activateEnabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachineId
|
||||||
|
|
||||||
Flow
|
Flow
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user