mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 04:19:01 +08:00
CURA-4341 add bi-directional signal to update topbar when monitoring
This commit is contained in:
parent
0fa3bdd68b
commit
b748bf2011
@ -25,8 +25,11 @@ UM.MainWindow
|
|||||||
target: Printer
|
target: Printer
|
||||||
onShowPrintMonitor:
|
onShowPrintMonitor:
|
||||||
{
|
{
|
||||||
|
topbar.monitoringChanged(show)
|
||||||
|
|
||||||
if (show)
|
if (show)
|
||||||
{
|
{
|
||||||
|
|
||||||
topbar.startMonitoringPrint()
|
topbar.startMonitoringPrint()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -349,13 +352,17 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isMonitoringPrint () {
|
||||||
|
return base.showPrintMonitor
|
||||||
|
}
|
||||||
|
|
||||||
Topbar
|
Topbar
|
||||||
{
|
{
|
||||||
id: topbar
|
id: topbar
|
||||||
anchors.left:parent.left
|
anchors.left:parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
monitoringPrint: base.showPrintMonitor
|
monitoringPrint: isMonitoringPrint()
|
||||||
onStartMonitoringPrint: base.showPrintMonitor = true
|
onStartMonitoringPrint: base.showPrintMonitor = true
|
||||||
onStopMonitoringPrint: base.showPrintMonitor = false
|
onStopMonitoringPrint: base.showPrintMonitor = false
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,16 @@ Rectangle
|
|||||||
|
|
||||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||||
property bool monitoringPrint: false
|
|
||||||
|
// monitoring status
|
||||||
|
property bool monitoringPrint
|
||||||
|
|
||||||
|
// incoming signal
|
||||||
|
function monitoringChanged (isNowMonitoring) {
|
||||||
|
monitoringPrint = isNowMonitoring
|
||||||
|
}
|
||||||
|
|
||||||
|
// outgoing signal
|
||||||
signal startMonitoringPrint()
|
signal startMonitoringPrint()
|
||||||
signal stopMonitoringPrint()
|
signal stopMonitoringPrint()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user