From 03304003af90c2d3566eb3e5cc504ca8e22ff96f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 20 Nov 2017 15:12:11 +0100 Subject: [PATCH] Added connection state property Cl-541 --- cura/PrinterOutputDevice.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 9db0a26e55..573fe63158 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -27,6 +27,7 @@ i18n_catalog = i18nCatalog("cura") @signalemitter class PrinterOutputDevice(QObject, OutputDevice): printersChanged = pyqtSignal() + connectionStateChanged = pyqtSignal() def __init__(self, device_id, parent = None): super().__init__(device_id = device_id, parent = parent) @@ -48,6 +49,11 @@ class PrinterOutputDevice(QObject, OutputDevice): self._update_timer.setSingleShot(False) self._update_timer.timeout.connect(self._update) + self._connection_state = ConnectionState.closed + + def isConnected(self): + return self._connection_state != ConnectionState.closed and self._connection_state != ConnectionState.error + def _update(self): pass