Separate name from address in properties

This way we can display them separately.

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-02 14:27:49 +01:00
parent 5c2f1a935a
commit cda5ee1dca
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
2 changed files with 22 additions and 6 deletions

View file

@ -1,4 +1,4 @@
# Copyright (c) 2016 Ultimaker B.V.
# Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.i18n import i18nCatalog
@ -100,7 +100,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
self.setPriority(2) # Make sure the output device gets selected above local file output
self.setName(key)
self.setShortDescription(i18n_catalog.i18nc("@action:button Preceded by 'Ready to'.", "Print over network"))
self.setShortDescription(i18n_catalog.i18nc("@action:button Preceded by 'Ready to'.", "print over network"))
self.setDescription(i18n_catalog.i18nc("@properties:tooltip", "Print over network"))
self.setIconName("print")
@ -220,6 +220,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
def getKey(self):
return self._key
## The IP address of the printer.
@pyqtProperty(str, constant = True)
def address(self):
return self._properties.get(b"address", b"0.0.0.0").decode("utf-8")
## Name of the printer (as returned from the zeroConf properties)
@pyqtProperty(str, constant = True)
def name(self):