Linking a key to a printer now re-checks connection

CURA-336
This commit is contained in:
Jaime van Kessel 2016-06-23 16:20:20 +02:00
parent bb9d3a47ef
commit a61ac82433
2 changed files with 6 additions and 2 deletions

View file

@ -39,3 +39,7 @@ class DiscoverUM3Action(MachineAction):
global_container_stack.setMetaDataEntry("key", key) global_container_stack.setMetaDataEntry("key", key)
else: else:
global_container_stack.addMetaDataEntry("key", key) global_container_stack.addMetaDataEntry("key", key)
if self._network_plugin:
# Ensure that the connection states are refreshed.
self._network_plugin.reCheckConnections()

View file

@ -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. # Because the model needs to be created in the same thread as the QMLEngine, we use a signal.
self.addPrinterSignal.connect(self.addPrinter) self.addPrinterSignal.connect(self.addPrinter)
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalStackChanged) Application.getInstance().globalContainerStackChanged.connect(self.reCheckConnections)
addPrinterSignal = Signal() addPrinterSignal = Signal()
@ -34,7 +34,7 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
def getPrinters(self): def getPrinters(self):
return self._printers return self._printers
def _onGlobalStackChanged(self): def reCheckConnections(self):
active_machine = Application.getInstance().getGlobalContainerStack() active_machine = Application.getInstance().getGlobalContainerStack()
if not active_machine: if not active_machine:
return return