Small fixes so switching printers correctly connects / disconnects output devices

CURA-1036
This commit is contained in:
Jaime van Kessel 2016-06-15 14:17:59 +02:00
parent ac4dbe2304
commit 7d258485c8
2 changed files with 2 additions and 2 deletions

View file

@ -32,7 +32,6 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
self._zero_conf.close()
def _onGlobalStackChanged(self):
active_machine = Application.getInstance().getGlobalContainerStack()
if not active_machine:
return
@ -41,6 +40,7 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
if key == active_machine.getMetaDataEntry("key"):
self._printers[key].connect()
self._printers[key].connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
else:
self._printers[key].close()
## Because the model needs to be created in the same thread as the QMLEngine, we use a signal.