Refactoring & exposing of properties

CURA-336
This commit is contained in:
Jaime van Kessel 2016-06-23 14:19:56 +02:00
parent 9a4fc0345c
commit 16fcf2208b

View file

@ -19,11 +19,11 @@ i18n_catalog = i18nCatalog("cura")
## Network connected (wifi / lan) printer that uses the Ultimaker API
@signalemitter
class NetworkPrinterOutputDevice(PrinterOutputDevice):
def __init__(self, key, address, info):
def __init__(self, key, address, properties):
super().__init__(key)
self._address = address
self._key = key
self._info = info
self._properties = properties # Properties dict as provided by zero conf
self._gcode = None
@ -41,7 +41,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
self._api_prefix = "/api/v" + self._api_version + "/"
self.setName(key)
self.setShortDescription(i18n_catalog.i18nc("@action:button", "Print with WIFI"))
self.setDescription(i18n_catalog.i18nc("@info:tooltip", "Print with WIFI"))
self.setDescription(i18n_catalog.i18nc("@properties:tooltip", "Print with WIFI"))
self.setIconName("print")
# QNetwork manager needs to be created in advance. If we don't it can happen that it doesn't correctly
@ -84,6 +84,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
self._camera_image = QImage()
def getProperties(self):
return self._properties
## Get the unique key of this machine
# \return key String containing the key of the machine.
def getKey(self):