mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Fixed order of close & disconnect
This would cause the state change caused by close to not be sent to the printer. Fixes CURA-3668
This commit is contained in:
parent
f5785662f2
commit
d02aa7f6a3
1 changed files with 2 additions and 2 deletions
|
@ -164,8 +164,8 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
||||||
else:
|
else:
|
||||||
if self._printers[key].isConnected():
|
if self._printers[key].isConnected():
|
||||||
Logger.log("d", "Closing connection [%s]..." % key)
|
Logger.log("d", "Closing connection [%s]..." % key)
|
||||||
self._printers[key].connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged)
|
|
||||||
self._printers[key].close()
|
self._printers[key].close()
|
||||||
|
self._printers[key].connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged)
|
||||||
|
|
||||||
## 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.
|
||||||
def addPrinter(self, name, address, properties):
|
def addPrinter(self, name, address, properties):
|
||||||
|
@ -183,9 +183,9 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
||||||
printer = self._printers.pop(name, None)
|
printer = self._printers.pop(name, None)
|
||||||
if printer:
|
if printer:
|
||||||
if printer.isConnected():
|
if printer.isConnected():
|
||||||
|
printer.disconnect()
|
||||||
printer.connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged)
|
printer.connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged)
|
||||||
Logger.log("d", "removePrinter, disconnecting [%s]..." % name)
|
Logger.log("d", "removePrinter, disconnecting [%s]..." % name)
|
||||||
printer.disconnect()
|
|
||||||
self.printerListChanged.emit()
|
self.printerListChanged.emit()
|
||||||
|
|
||||||
## Handler for when the connection state of one of the detected printers changes
|
## Handler for when the connection state of one of the detected printers changes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue