mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Show Cura Connect alerts in the monitor tab
CL-897
This commit is contained in:
parent
942d20a8d8
commit
b7673a7438
4 changed files with 268 additions and 5 deletions
|
@ -12,6 +12,8 @@ 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()
|
||||
|
@ -24,6 +26,7 @@ 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)
|
||||
|
@ -41,6 +44,7 @@ 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):
|
||||
|
@ -147,4 +151,14 @@ class PrintJobOutputModel(QObject):
|
|||
|
||||
@pyqtSlot(str)
|
||||
def setState(self, state):
|
||||
self._output_controller.setJobState(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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue