mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-23 10:51:16 -07: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
2 changed files with 11 additions and 3 deletions
|
|
@ -44,7 +44,7 @@ Column
|
||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
id: extrudersRepeater
|
id: extrudersRepeater
|
||||||
model: activePrinter!=null ? activePrinter.extruders : null
|
model: activePrinter != null ? activePrinter.extruders : null
|
||||||
|
|
||||||
ExtruderBox
|
ExtruderBox
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,19 @@ Item
|
||||||
implicitHeight: Math.floor(childrenRect.height + UM.Theme.getSize("default_margin").height * 2)
|
implicitHeight: Math.floor(childrenRect.height + UM.Theme.getSize("default_margin").height * 2)
|
||||||
property var outputDevice: null
|
property var outputDevice: null
|
||||||
|
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: Cura.MachineManager
|
||||||
|
onGlobalContainerChanged:
|
||||||
|
{
|
||||||
|
outputDevice = Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
color: UM.Theme.getColor("setting_category")
|
color: UM.Theme.getColor("setting_category")
|
||||||
property var activePrinter: outputDevice != null ? outputDevice.activePrinter : null
|
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
|
|
@ -28,7 +36,7 @@ Item
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||||
text: outputDevice != null ? activePrinter.name : ""
|
text: outputDevice != null ? outputDevice.activePrinter.name : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue