mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
CURA-4341 add bi-directional signal to update topbar when monitoring
This commit is contained in:
parent
0fa3bdd68b
commit
b748bf2011
2 changed files with 18 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue