Store the printer cluster size as a metadata entry on the machine

This makes the cluster size also available when the machine is offline.
Also fixes an issue where the cluster size is improperly restored
once the internet connection comes back online, resulting in the printer
showing as a single printer until next sync

CURA-7347
This commit is contained in:
Nino van Hooff 2020-06-03 13:59:51 +02:00
parent ba705176fe
commit 80a5b53aad
4 changed files with 10 additions and 3 deletions

View file

@ -488,7 +488,11 @@ class MachineManager(QObject):
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineIsGroup(self) -> bool:
return bool(self._printer_output_devices) and len(self._printer_output_devices[0].printers) > 1
if self.activeMachine is None:
return False
group_size = int(self.activeMachine.getMetaDataEntry("group_size", "-1"))
return group_size > 1
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineHasNetworkConnection(self) -> bool: