From 29151993679c7c06fb192388382ec185184f2ebd Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 11 Oct 2017 15:55:30 +0200 Subject: [PATCH] Avoid printer connection when the status is 'error' - CURA-3868 --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index f83c17569a..9dedc87df4 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/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