diff options
author | fieldOfView <aldo@fieldofview.com> | 2016-08-09 19:43:09 +0300 |
---|---|---|
committer | fieldOfView <aldo@fieldofview.com> | 2016-08-09 19:43:09 +0300 |
commit | e551898e0475d74899dee1d785934e645cbe3bdc (patch) | |
tree | c3bb65b4be2874a68d0dd14ffee8111a04d5b19a /cura/PrinterOutputDevice.py | |
parent | a0df0c76de80e956fffceda03e8d08029f8eca78 (diff) |
Add a connection string to the printmonitor
CURA-2091
Diffstat (limited to 'cura/PrinterOutputDevice.py')
-rw-r--r-- | cura/PrinterOutputDevice.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 153e5f7c42..b24fe11f18 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -31,6 +31,7 @@ class PrinterOutputDevice(QObject, OutputDevice): self._head_y = 0 self._head_z = 0 self._connection_state = ConnectionState.closed + self._connection_text = "" self._time_elapsed = 0 self._time_total = 0 self._job_state = "" @@ -71,6 +72,8 @@ class PrinterOutputDevice(QObject, OutputDevice): # it also sends it's own device_id (for convenience sake) connectionStateChanged = pyqtSignal(str) + connectionTextChanged = pyqtSignal() + timeElapsedChanged = pyqtSignal() timeTotalChanged = pyqtSignal() @@ -292,6 +295,16 @@ class PrinterOutputDevice(QObject, OutputDevice): self._connection_state = connection_state self.connectionStateChanged.emit(self._id) + @pyqtProperty(str, notify = connectionTextChanged) + def connectionText(self): + return self._connection_text + + ## Set a text that is shown on top of the print monitor tab + def setConnectionText(self, connection_text): + if self._connection_text != connection_text: + self._connection_text = connection_text + self.connectionTextChanged.emit() + ## Ensure that close gets called when object is destroyed def __del__(self): self.close() |