diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index de4c6e0681..72d19d65a1 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -242,6 +242,8 @@ class CuraApplication(QtApplication): def _onEngineCreated(self): self._engine.addImageProvider("camera", CameraImageProvider.CameraImageProvider()) + showPrintMonitor = pyqtSignal(bool, arguments = ["show"]) + ## Cura has multiple locations where instance containers need to be saved, so we need to handle this differently. # # Note that the AutoSave plugin also calls this method. diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 526002aa3a..0b545314aa 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -365,6 +365,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): self.onError.emit() def requestWrite(self, node, file_name = None, filter_by_machine = False): + Application.getInstance().showPrintMonitor.emit(True) self.startPrint() def _setEndstopState(self, endstop_key, value): @@ -516,6 +517,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): self._is_printing = False self._is_paused = False self._updateJobState("ready") + Application.getInstance().showPrintMonitor.emit(False) ## Check if the process did not encounter an error yet. def hasError(self): diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 822fdf8ca1..25931932d3 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -15,6 +15,11 @@ Rectangle property int currentModeIndex; property bool monitoringPrint: false + Connections + { + target: Printer + onShowPrintMonitor: base.monitoringPrint = show + } // Is there an output device for this printer? property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 @@ -83,7 +88,7 @@ Rectangle onClicked: monitoringPrint = false iconSource: UM.Theme.getIcon("tab_settings"); checkable: true - checked: true + checked: !monitoringPrint exclusiveGroup: sidebarHeaderBarGroup style: UM.Theme.styles.sidebar_header_tab @@ -104,6 +109,7 @@ Rectangle return UM.Theme.getIcon("tab_monitor_connected") } checkable: true + checked: monitoringPrint exclusiveGroup: sidebarHeaderBarGroup style: UM.Theme.styles.sidebar_header_tab