mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-29 06:52:00 +08:00
Added connection state property
Cl-541
This commit is contained in:
parent
59e4d1af63
commit
03304003af
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user