Placeholder; the selected printer to monitor is abstract, but cloud-capable.

forms the base of CURA-9422
This commit is contained in:
Remco Burema 2022-08-26 13:10:09 +02:00
parent fe7960ee73
commit 95f234679c
2 changed files with 23 additions and 2 deletions

View file

@ -530,6 +530,10 @@ class MachineManager(QObject):
def printerConnected(self) -> bool:
return bool(self._printer_output_devices)
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineIsAbstract(self) -> bool:
return (self.activeMachine is not None) and parseBool(self.activeMachine.getMetaDataEntry("is_abstract_machine", False))
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineIsGroup(self) -> bool:
if self.activeMachine is None:
@ -554,6 +558,8 @@ class MachineManager(QObject):
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineHasCloudRegistration(self) -> bool:
if self.activeMachineIsAbstract:
return any(m.getMetaDataEntry("is_online", False) for m in self.getMachinesWithDefinition(self.activeMachine.definition.getId(), True))
return self.activeMachine is not None and ConnectionType.CloudConnection in self.activeMachine.configuredConnectionTypes
@pyqtProperty(bool, notify = printerConnectedStatusChanged)