diff --git a/NetworkPrinterOutputDevice.py b/NetworkPrinterOutputDevice.py index 712c48a865..efc34ecf52 100644 --- a/NetworkPrinterOutputDevice.py +++ b/NetworkPrinterOutputDevice.py @@ -109,7 +109,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self._updateHeadPosition(head_x, head_y, head_z) def close(self): - self._connection_state == ConnectionState.closed + self.setConnectionState(ConnectionState.closed) self._update_timer.stop() def requestWrite(self, node, file_name = None, filter_by_machine = False): diff --git a/NetworkPrinterOutputDevicePlugin.py b/NetworkPrinterOutputDevicePlugin.py index 9c187e5065..fed761b772 100644 --- a/NetworkPrinterOutputDevicePlugin.py +++ b/NetworkPrinterOutputDevicePlugin.py @@ -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.