Browse Source

Block sending several files now works even if there is a mismatching - CURA-4398

Diego Prado Gesto 7 years ago
parent
commit
c9e8f7c743
1 changed files with 12 additions and 11 deletions
  1. 12 11
      plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py

+ 12 - 11
plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py

@@ -753,17 +753,6 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
                                                  )
             return
 
-        # Check if we're already writing
-        if not self._write_finished:
-            self._error_message = Message(
-                i18n_catalog.i18nc("@info:status",
-                                   "Sending new jobs (temporarily) blocked, still sending the previous print job."))
-            self._error_message.show()
-            return
-
-        # Indicate we're starting a new write action, is set back to True in the startPrint() method
-        self._write_finished = False
-
         self.startPrint()
 
     def _configurationMismatchMessageCallback(self, button):
@@ -854,6 +843,18 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
     #   This function can fail to actually start a print due to not being authenticated or another print already
     #   being in progress.
     def startPrint(self):
+
+        # Check if we're already writing
+        if not self._write_finished:
+            self._error_message = Message(
+                i18n_catalog.i18nc("@info:status",
+                                   "Sending new jobs (temporarily) blocked, still sending the previous print job."))
+            self._error_message.show()
+            return
+
+        # Indicate we're starting a new write action, is set back to True at the end of this method
+        self._write_finished = False
+
         try:
             self._send_gcode_start = time()
             self._progress_message = Message(i18n_catalog.i18nc("@info:status", "Sending data to printer"), 0, False, -1, i18n_catalog.i18nc("@info:title", "Sending Data"))