diff options
author | Thomas Karl Pietrowski <thopiekar@googlemail.com> | 2016-11-20 16:59:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-20 16:59:35 +0300 |
commit | bafaf16fcbba5867353d012509f27c1c3f1a8d8f (patch) | |
tree | a75d4f482fff3e2aaf54208f7362fabff9f2e448 /cura/PrinterOutputDevice.py | |
parent | ac708d54b696aa09598915942fc84efc9ae4dcba (diff) |
PrinterOutputDevice: Adding isConnectionState
Adding isConnectionState here to make direct comparisons, whether the current state is the correct one.
Looks better than `self._connection_state == <my_connection_state>` in my point of view.
Diffstat (limited to 'cura/PrinterOutputDevice.py')
-rw-r--r-- | cura/PrinterOutputDevice.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 6eae259e1e..156920e295 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -366,6 +366,11 @@ class PrinterOutputDevice(QObject, OutputDevice): self._connection_state = connection_state self.connectionStateChanged.emit(self._id) + ## Check the connection state of this output device. + # /param connection_state ConnectionState enum. + def isConnectionState(self, connection_state): + return self._connection_state == connection_state + @pyqtProperty(str, notify = connectionTextChanged) def connectionText(self): return self._connection_text @@ -535,4 +540,4 @@ class ConnectionState(IntEnum): connecting = 1 connected = 2 busy = 3 - error = 4
\ No newline at end of file + error = 4 |