From 37520b26b878f678e0d7227d175ed1d3c092d6fd Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 28 Mar 2018 14:28:07 +0200 Subject: [PATCH] CURA-5170 When the connection status of a printer output device changes, only add it to the list if the device belongs to the current printer. --- plugins/UM3NetworkPrinting/UM3OutputDevicePlugin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/UM3OutputDevicePlugin.py b/plugins/UM3NetworkPrinting/UM3OutputDevicePlugin.py index 089b9038f7..5a0d5fa275 100644 --- a/plugins/UM3NetworkPrinting/UM3OutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/UM3OutputDevicePlugin.py @@ -107,6 +107,8 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): Logger.log("d", "Attempting to connect with [%s]" % key) self._discovered_devices[key].connect() self._discovered_devices[key].connectionStateChanged.connect(self._onDeviceConnectionStateChanged) + else: + self._onDeviceConnectionStateChanged(key) else: if self._discovered_devices[key].isConnected(): Logger.log("d", "Attempting to close connection with [%s]" % key) @@ -117,7 +119,10 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): if key not in self._discovered_devices: return if self._discovered_devices[key].isConnected(): - self.getOutputDeviceManager().addOutputDevice(self._discovered_devices[key]) + # Sometimes the status changes after changing the global container and maybe the device doesn't belong to this machine + um_network_key = Application.getInstance().getGlobalContainerStack().getMetaDataEntry("um_network_key") + if key == um_network_key: + self.getOutputDeviceManager().addOutputDevice(self._discovered_devices[key]) else: self.getOutputDeviceManager().removeOutputDevice(key)