Add signal to CloudOutputDeviceManager for added cloud device

Contributes to CL-1222
This commit is contained in:
Ian Paschal 2019-02-05 16:49:54 +01:00
parent 9c82cfd6fa
commit d022672bcf

View file

@ -32,6 +32,8 @@ class CloudOutputDeviceManager:
# The translation catalog for this device. # The translation catalog for this device.
I18N_CATALOG = i18nCatalog("cura") I18N_CATALOG = i18nCatalog("cura")
addedCloudCluster = Signal()
def __init__(self) -> None: def __init__(self) -> None:
# Persistent dict containing the remote clusters for the authenticated user. # Persistent dict containing the remote clusters for the authenticated user.
self._remote_clusters = {} # type: Dict[str, CloudOutputDevice] self._remote_clusters = {} # type: Dict[str, CloudOutputDevice]
@ -90,6 +92,7 @@ class CloudOutputDeviceManager:
for added_cluster in added_clusters: for added_cluster in added_clusters:
device = CloudOutputDevice(self._api, added_cluster) device = CloudOutputDevice(self._api, added_cluster)
self._remote_clusters[added_cluster.cluster_id] = device self._remote_clusters[added_cluster.cluster_id] = device
self.addedCloudCluster.emit()
for device, cluster in updates: for device, cluster in updates:
device.clusterData = cluster device.clusterData = cluster