mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Only close connection if it's open when re-checking connections
This commit is contained in:
parent
4c7d235a0d
commit
bc50f0fa7c
1 changed files with 2 additions and 1 deletions
|
@ -44,7 +44,8 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
||||||
self._printers[key].connect()
|
self._printers[key].connect()
|
||||||
self._printers[key].connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
|
self._printers[key].connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
|
||||||
else:
|
else:
|
||||||
self._printers[key].close()
|
if self._printers[key].isConnected():
|
||||||
|
self._printers[key].close()
|
||||||
|
|
||||||
## 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):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue