From da5e4c11a445fce300eb37bdea9babd8d0715363 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 12 Jun 2018 15:40:10 +0200 Subject: [PATCH] Override connect() rather than connecting to connection state signal This is much more lean and a bit more semantic. Contributes to issue CURA-5034. --- plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py index da3a98b1fc..1dc82a800f 100644 --- a/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py @@ -62,8 +62,6 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): # See comments about this hack with the clusterPrintersChanged signal self.printersChanged.connect(self.clusterPrintersChanged) - self.connectionStateChanged.connect(self._onConnectionStateChanged) - self._accepts_commands = True # Cluster does not have authentication, so default to authenticated @@ -371,9 +369,9 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): self._finished_jobs = finished_jobs ## Called when the connection to the cluster changes. - def _onConnectionStateChanged(self) -> None: - if self.connectionState == ConnectionState.connected: - self.sendMaterialProfiles() + def connect(self) -> None: + super().connect() + self.sendMaterialProfiles() def _update(self) -> None: if not super()._update():