Override connect() rather than connecting to connection state signal

This is much more lean and a bit more semantic.

Contributes to issue CURA-5034.
This commit is contained in:
Ghostkeeper 2018-06-12 15:40:10 +02:00
parent a4171dd561
commit da5e4c11a4
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -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():