mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 03:54:01 -06:00
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.
This commit is contained in:
parent
ac708d54b6
commit
bafaf16fcb
1 changed files with 6 additions and 1 deletions
|
@ -366,6 +366,11 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
self._connection_state = connection_state
|
self._connection_state = connection_state
|
||||||
self.connectionStateChanged.emit(self._id)
|
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)
|
@pyqtProperty(str, notify = connectionTextChanged)
|
||||||
def connectionText(self):
|
def connectionText(self):
|
||||||
return self._connection_text
|
return self._connection_text
|
||||||
|
@ -535,4 +540,4 @@ class ConnectionState(IntEnum):
|
||||||
connecting = 1
|
connecting = 1
|
||||||
connected = 2
|
connected = 2
|
||||||
busy = 3
|
busy = 3
|
||||||
error = 4
|
error = 4
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue