Browse Source

Enable progress bar for USB printing

CL-541
Jaime van Kessel 7 years ago
parent
commit
6bdce54e1d

+ 1 - 0
plugins/USBPrinting/USBPrinterOutputDevice.py

@@ -217,6 +217,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
         print_job = self._printers[0].activePrintJob
         print_job = self._printers[0].activePrintJob
         if print_job is None:
         if print_job is None:
             print_job = PrintJobOutputModel(output_controller = USBPrinterOuptutController(self), name= Application.getInstance().getPrintInformation().jobName)
             print_job = PrintJobOutputModel(output_controller = USBPrinterOuptutController(self), name= Application.getInstance().getPrintInformation().jobName)
+            print_job.updateState("printing")
             self._printers[0].updateActivePrintJob(print_job)
             self._printers[0].updateActivePrintJob(print_job)
 
 
         print_job.updateTimeElapsed(elapsed_time)
         print_job.updateTimeElapsed(elapsed_time)

+ 0 - 14
plugins/USBPrinting/USBPrinterOutputDeviceManager.py

@@ -46,20 +46,6 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension):
         Application.getInstance().applicationShuttingDown.connect(self.stop)
         Application.getInstance().applicationShuttingDown.connect(self.stop)
         self.addUSBOutputDeviceSignal.connect(self.addOutputDevice) #Because the model needs to be created in the same thread as the QMLEngine, we use a signal.
         self.addUSBOutputDeviceSignal.connect(self.addOutputDevice) #Because the model needs to be created in the same thread as the QMLEngine, we use a signal.
 
 
-    @pyqtProperty(float, notify = progressChanged)
-    def progress(self):
-        progress = 0
-        for printer_name, device in self._usb_output_devices.items(): # TODO: @UnusedVariable "printer_name"
-            progress += device.progress
-        return progress / len(self._usb_output_devices)
-
-    @pyqtProperty(int, notify = progressChanged)
-    def errorCode(self):
-        for printer_name, device in self._usb_output_devices.items(): # TODO: @UnusedVariable "printer_name"
-            if device._error_code:
-                return device._error_code
-        return 0
-
     def start(self):
     def start(self):
         self._check_updates = True
         self._check_updates = True
         self._update_thread.start()
         self._update_thread.start()