Move ConfigurationChangeModel to plugin

Contributes to CL-897
This commit is contained in:
Ian Paschal 2018-10-01 17:12:05 +02:00
parent ae9faadca6
commit 82cddf07ad
4 changed files with 42 additions and 28 deletions

View file

@ -1,4 +1,4 @@
# Copyright (c) 2017 Ultimaker B.V.
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, pyqtSlot
@ -12,9 +12,6 @@ if TYPE_CHECKING:
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
from cura.PrinterOutput.ConfigurationChangeModel import ConfigurationChangeModel
class PrintJobOutputModel(QObject):
stateChanged = pyqtSignal()
timeTotalChanged = pyqtSignal()
@ -26,7 +23,6 @@ class PrintJobOutputModel(QObject):
configurationChanged = pyqtSignal()
previewImageChanged = pyqtSignal()
compatibleMachineFamiliesChanged = pyqtSignal()
configurationChangesChanged = pyqtSignal()
def __init__(self, output_controller: "PrinterOutputController", key: str = "", name: str = "", parent=None) -> None:
super().__init__(parent)
@ -44,7 +40,6 @@ class PrintJobOutputModel(QObject):
self._preview_image_id = 0
self._preview_image = None # type: Optional[QImage]
self._configuration_changes = [] # type: List[ConfigurationChangeModel]
@pyqtProperty("QStringList", notify=compatibleMachineFamiliesChanged)
def compatibleMachineFamilies(self):
@ -152,13 +147,3 @@ class PrintJobOutputModel(QObject):
@pyqtSlot(str)
def setState(self, state):
self._output_controller.setJobState(self, state)
@pyqtProperty("QVariantList", notify=configurationChangesChanged)
def configurationChanges(self) -> List[ConfigurationChangeModel]:
return self._configuration_changes
def updateConfigurationChanges(self, changes: List[ConfigurationChangeModel]) -> None:
if len(self._configuration_changes) == 0 and len(changes) == 0:
return
self._configuration_changes = changes
self.configurationChangesChanged.emit()