Added connection state property

Cl-541
This commit is contained in:
Jaime van Kessel 2017-11-20 15:12:11 +01:00
parent 59e4d1af63
commit 03304003af

View file

@ -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