Avoid printer connection when the status is 'error' - CURA-3868

This commit is contained in:
Diego Prado Gesto 2017-10-11 15:55:30 +02:00
parent e97bdc526b
commit 2915199367

View file

@ -775,6 +775,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
## Start requesting data from printer
def connect(self):
# Don't allow to connect to a printer with a faulty connection state.
# For instance when switching printers but the printer is disconnected from the network
if self._connection_state == ConnectionState.error:
return
if self.isConnected():
self.close() # Close previous connection