Browse Source

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

Diego Prado Gesto 7 years ago
parent
commit
2915199367
1 changed files with 5 additions and 0 deletions
  1. 5 0
      plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py

+ 5 - 0
plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py

@@ -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