mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06: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
1 changed files with 3 additions and 5 deletions
|
@ -12,11 +12,9 @@ UM.ManagementPage
|
|||
id: base;
|
||||
|
||||
title: catalog.i18nc("@title:tab", "Printers");
|
||||
property int numInstances: model.rowCount();
|
||||
model: UM.ContainerStacksModel
|
||||
{
|
||||
filter: {"type": "machine"}
|
||||
onDataChanged: numInstances = model.rowCount()
|
||||
}
|
||||
|
||||
onAddObject: Printer.requestAddPrinter()
|
||||
|
@ -24,9 +22,9 @@ UM.ManagementPage
|
|||
onRenameObject: renameDialog.open();
|
||||
onActivateObject: Cura.MachineManager.setActiveMachine(base.currentItem.id)
|
||||
|
||||
removeEnabled: base.currentItem != null && numInstances > 1
|
||||
renameEnabled: base.currentItem != null && numInstances > 0
|
||||
activateEnabled: base.currentItem != null
|
||||
removeEnabled: base.currentItem != null && model.rowCount() > 1
|
||||
renameEnabled: base.currentItem != null
|
||||
activateEnabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachineId
|
||||
|
||||
Flow
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue