diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index bbf35da6f8..f90566c30b 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -134,6 +134,20 @@ class PrinterOutputDevice(QObject, OutputDevice): def _setJobState(self, job_state): Logger.log("w", "_setJobState is not implemented by this output device") + @pyqtSlot() + def startCamera(self): + self._startCamera() + + def _startCamera(self, job_state): + Logger.log("w", "_startCamera is not implemented by this output device") + + @pyqtSlot() + def stopCamera(self): + self._stopCamera() + + def _stopCamera(self, job_state): + Logger.log("w", "_stopCamera is not implemented by this output device") + @pyqtProperty(str, notify = jobNameChanged) def jobName(self): return self._job_name diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 5c56abcc12..77a383ab0d 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -402,6 +402,16 @@ UM.MainWindow anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenterOffset: - UM.Theme.getSize("sidebar").width / 2 visible: base.monitoringPrint + onVisibleChanged: + { + if(visible) + { + Cura.MachineManager.printerOutputDevices[0].startCamera() + } else + { + Cura.MachineManager.printerOutputDevices[0].stopCamera() + } + } source: { if(!base.monitoringPrint)