mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
If a reserved job is moved to a printer that can do it, it' s correclty removed from the old printer
CL-541
This commit is contained in:
parent
931c87716b
commit
eb27695d52
2 changed files with 9 additions and 2 deletions
|
@ -44,7 +44,11 @@ class PrintJobOutputModel(QObject):
|
||||||
|
|
||||||
def updateAssignedPrinter(self, assigned_printer: "PrinterOutputModel"):
|
def updateAssignedPrinter(self, assigned_printer: "PrinterOutputModel"):
|
||||||
if self._assigned_printer != assigned_printer:
|
if self._assigned_printer != assigned_printer:
|
||||||
|
old_printer = self._assigned_printer
|
||||||
self._assigned_printer = assigned_printer
|
self._assigned_printer = assigned_printer
|
||||||
|
if old_printer is not None:
|
||||||
|
# If the previously assigned printer is set, this job is moved away from it.
|
||||||
|
old_printer.updateActivePrintJob(None)
|
||||||
self.assignedPrinterChanged.emit()
|
self.assignedPrinterChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(str, notify=keyChanged)
|
@pyqtProperty(str, notify=keyChanged)
|
||||||
|
|
|
@ -180,11 +180,14 @@ class PrinterOutputModel(QObject):
|
||||||
|
|
||||||
def updateActivePrintJob(self, print_job):
|
def updateActivePrintJob(self, print_job):
|
||||||
if self._active_print_job != print_job:
|
if self._active_print_job != print_job:
|
||||||
if self._active_print_job is not None:
|
old_print_job = self._active_print_job
|
||||||
self._active_print_job.updateAssignedPrinter(None)
|
|
||||||
if print_job is not None:
|
if print_job is not None:
|
||||||
print_job.updateAssignedPrinter(self)
|
print_job.updateAssignedPrinter(self)
|
||||||
self._active_print_job = print_job
|
self._active_print_job = print_job
|
||||||
|
|
||||||
|
if old_print_job is not None:
|
||||||
|
old_print_job.updateAssignedPrinter(None)
|
||||||
self.activePrintJobChanged.emit()
|
self.activePrintJobChanged.emit()
|
||||||
|
|
||||||
def updateState(self, printer_state):
|
def updateState(self, printer_state):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue