mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
When no globalcontainer is set, no check to connect is performed
CURA-49
This commit is contained in:
parent
bd413b9a2b
commit
486fc7f176
1 changed files with 3 additions and 2 deletions
|
@ -47,9 +47,10 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
||||||
def addPrinter(self, name, address, properties):
|
def addPrinter(self, name, address, properties):
|
||||||
printer = NetworkPrinterOutputDevice.NetworkPrinterOutputDevice(name, address, properties)
|
printer = NetworkPrinterOutputDevice.NetworkPrinterOutputDevice(name, address, properties)
|
||||||
self._printers[printer.getKey()] = printer
|
self._printers[printer.getKey()] = printer
|
||||||
if printer.getKey() == Application.getInstance().getGlobalContainerStack().getMetaDataEntry("key"):
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
|
if global_container_stack and printer.getKey() == global_container_stack.getMetaDataEntry("key"):
|
||||||
self._printers[printer.getKey()].connect()
|
self._printers[printer.getKey()].connect()
|
||||||
printer.connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
|
printer.connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
|
||||||
|
|
||||||
## Handler for when the connection state of one of the detected printers changes
|
## Handler for when the connection state of one of the detected printers changes
|
||||||
def _onPrinterConnectionStateChanged(self, key):
|
def _onPrinterConnectionStateChanged(self, key):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue