mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 10:18:59 +08:00
CURA-4870 Make the machine selection toolbutton react to changes in the
output devices
This commit is contained in:
parent
fe2a08a46b
commit
16a5b652f4
@ -11,9 +11,10 @@ import Cura 1.0 as Cura
|
|||||||
import "Menus"
|
import "Menus"
|
||||||
|
|
||||||
ToolButton {
|
ToolButton {
|
||||||
property var isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey ? true : false
|
id: base
|
||||||
|
property var isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != ""
|
||||||
property var printerStatus: Cura.MachineManager.printerOutputDevices.length != 0 ? "connected" : "unknown"
|
property var printerStatus: Cura.MachineManager.printerOutputDevices.length != 0 ? "connected" : "unknown"
|
||||||
text: Cura.MachineManager.activeMachineName
|
text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
|
||||||
|
|
||||||
tooltip: Cura.MachineManager.activeMachineName
|
tooltip: Cura.MachineManager.activeMachineName
|
||||||
|
|
||||||
@ -73,4 +74,14 @@ ToolButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
menu: PrinterMenu { }
|
menu: PrinterMenu { }
|
||||||
|
|
||||||
|
// Make the toolbutton react when the outputdevice changes
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: Cura.MachineManager
|
||||||
|
onOutputDevicesChanged:
|
||||||
|
{
|
||||||
|
base.isNetworkPrinter = Cura.MachineManager.activeMachineNetworkKey != ""
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user