mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 21:05:54 +08:00
Update outputDevice when the global container changed
And directly link the active printer name to it, so that that also gets updated. With the property var it just gets evaluated upon creating the rectangle. Contributes to issue CURA-5749.
This commit is contained in:
parent
99fc372b32
commit
9e4fcd820e
@ -14,11 +14,19 @@ Item
|
||||
implicitHeight: Math.floor(childrenRect.height + UM.Theme.getSize("default_margin").height * 2)
|
||||
property var outputDevice: null
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged:
|
||||
{
|
||||
outputDevice = Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null;
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
height: childrenRect.height
|
||||
color: UM.Theme.getColor("setting_category")
|
||||
property var activePrinter: outputDevice != null ? outputDevice.activePrinter : null
|
||||
|
||||
Label
|
||||
{
|
||||
@ -28,7 +36,7 @@ Item
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
text: outputDevice != null ? activePrinter.name : ""
|
||||
text: outputDevice != null ? outputDevice.activePrinter.name : ""
|
||||
}
|
||||
|
||||
Label
|
||||
|
Loading…
x
Reference in New Issue
Block a user