Add fallback in PrinterOutputDevice for getting address

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

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-09 10:31:35 +01:00
parent c5655d4d8c
commit e37d8b949e
No known key found for this signature in database
GPG Key ID: C5F96EE2BC0F7E75
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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