diff --git a/DiscoverUM3Action.py b/DiscoverUM3Action.py index 55afcd35fa..b492b79d8b 100644 --- a/DiscoverUM3Action.py +++ b/DiscoverUM3Action.py @@ -39,3 +39,7 @@ class DiscoverUM3Action(MachineAction): global_container_stack.setMetaDataEntry("key", key) else: global_container_stack.addMetaDataEntry("key", key) + + if self._network_plugin: + # Ensure that the connection states are refreshed. + self._network_plugin.reCheckConnections() diff --git a/NetworkPrinterOutputDevicePlugin.py b/NetworkPrinterOutputDevicePlugin.py index 6697e05bd9..ad41d984ae 100644 --- a/NetworkPrinterOutputDevicePlugin.py +++ b/NetworkPrinterOutputDevicePlugin.py @@ -19,7 +19,7 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin): # Because the model needs to be created in the same thread as the QMLEngine, we use a signal. self.addPrinterSignal.connect(self.addPrinter) - Application.getInstance().globalContainerStackChanged.connect(self._onGlobalStackChanged) + Application.getInstance().globalContainerStackChanged.connect(self.reCheckConnections) addPrinterSignal = Signal() @@ -34,7 +34,7 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin): def getPrinters(self): return self._printers - def _onGlobalStackChanged(self): + def reCheckConnections(self): active_machine = Application.getInstance().getGlobalContainerStack() if not active_machine: return