mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -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
|
||||
onShowPrintMonitor:
|
||||
{
|
||||
topbar.monitoringChanged(show)
|
||||
|
||||
if (show)
|
||||
{
|
||||
|
||||
topbar.startMonitoringPrint()
|
||||
}
|
||||
else
|
||||
|
@ -349,13 +352,17 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
function isMonitoringPrint () {
|
||||
return base.showPrintMonitor
|
||||
}
|
||||
|
||||
Topbar
|
||||
{
|
||||
id: topbar
|
||||
anchors.left:parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
monitoringPrint: base.showPrintMonitor
|
||||
monitoringPrint: isMonitoringPrint()
|
||||
onStartMonitoringPrint: base.showPrintMonitor = true
|
||||
onStopMonitoringPrint: base.showPrintMonitor = false
|
||||
}
|
||||
|
|
|
@ -22,7 +22,16 @@ Rectangle
|
|||
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
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 stopMonitoringPrint()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue