Browse Source

Add fallback in PrinterOutputDevice for getting address

The fallback gives a warning that it's not implemented.

Contributes to issue CURA-3161.
Ghostkeeper 8 years ago
parent
commit
e37d8b949e
2 changed files with 6 additions and 1 deletions
  1. 5 0
      cura/PrinterOutputDevice.py
  2. 1 1
      resources/qml/PrintMonitor.qml

+ 5 - 0
cura/PrinterOutputDevice.py

@@ -165,6 +165,11 @@ class PrinterOutputDevice(QObject, OutputDevice):
             self._job_name = name
             self.jobNameChanged.emit()
 
+    ##  Gives a human-readable address where the device can be found.
+    @pyqtProperty(str, constant = True)
+    def address(self):
+        Logger.log("w", "address is not implemented by this output device.")
+
     @pyqtProperty(str, notify = errorTextChanged)
     def errorText(self):
         return self._error_text

+ 1 - 1
resources/qml/PrintMonitor.qml

@@ -43,7 +43,7 @@ Column
         Label
         {
             id: connectedPrinterAddressLabel
-            text: printerConnected ? connectedPrinter.address : ""
+            text: (printerConnected && connectedPrinter.address != null) ? connectedPrinter.address : ""
             font: UM.Theme.getFont("small")
             color: UM.Theme.getColor("text_inactive")
             anchors.left: parent.left