Unsasigned jobs are now also removed from list

CL-541
This commit is contained in:
Jaime van Kessel 2018-01-04 12:54:47 +01:00
parent 4cb7bc03ad
commit 2e8ae5c590

View file

@ -275,6 +275,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
# Check what jobs need to be removed.
removed_jobs = [print_job for print_job in self._print_jobs if print_job not in print_jobs_seen]
for removed_job in removed_jobs:
job_list_changed |= self._removeJob(removed_job)
@ -371,12 +372,15 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
extruder.updateActiveMaterial(material)
def _removeJob(self, job):
if job not in self._print_jobs:
return False
if job.assignedPrinter:
job.assignedPrinter.updateActivePrintJob(None)
job.stateChanged.disconnect(self._printJobStateChanged)
self._print_jobs.remove(job)
return True
return False
self._print_jobs.remove(job)
return True
def _removePrinter(self, printer):
self._printers.remove(printer)