mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 09:25:57 +08:00
Small fixes so switching printers correctly connects / disconnects output devices
CURA-1036
This commit is contained in:
parent
ac4dbe2304
commit
7d258485c8
@ -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):
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user