Rename AbstractStacksModel.py -> MachineListModel.py since this model includes both abstract machine stacks and regular machines

Add machineCount for displaying the number of machines of a type.

MachineSelectorButton is in use in other places, swapped it out for a new Component MachineListButton.

CURA-9514
This commit is contained in:
joeydelarago 2022-08-23 14:29:05 +02:00
parent bedb76d516
commit b18080c332
6 changed files with 104 additions and 11 deletions

View file

@ -10,8 +10,8 @@ import Cura 1.0 as Cura
ListView
{
id: listView
model: Cura.AbstractStacksModel {}
section.property: "hasRemoteConnection"
model: Cura.MachineListModel {}
section.property: "section"
property real contentHeight: childrenRect.height
ScrollBar.vertical: UM.ScrollBar
@ -29,13 +29,10 @@ ListView
color: UM.Theme.getColor("text_medium")
}
delegate: MachineSelectorButton
delegate: MachineListButton
{
text: model.name ? model.name : ""
width: listView.width - scrollBar.width
outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
checked: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.id == model.id : false
onClicked:
{