mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 13:47:51 -06:00
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:
parent
a4171dd561
commit
da5e4c11a4
1 changed files with 3 additions and 5 deletions
|
@ -62,8 +62,6 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
# See comments about this hack with the clusterPrintersChanged signal
|
# See comments about this hack with the clusterPrintersChanged signal
|
||||||
self.printersChanged.connect(self.clusterPrintersChanged)
|
self.printersChanged.connect(self.clusterPrintersChanged)
|
||||||
|
|
||||||
self.connectionStateChanged.connect(self._onConnectionStateChanged)
|
|
||||||
|
|
||||||
self._accepts_commands = True
|
self._accepts_commands = True
|
||||||
|
|
||||||
# Cluster does not have authentication, so default to authenticated
|
# Cluster does not have authentication, so default to authenticated
|
||||||
|
@ -371,9 +369,9 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
self._finished_jobs = finished_jobs
|
self._finished_jobs = finished_jobs
|
||||||
|
|
||||||
## Called when the connection to the cluster changes.
|
## Called when the connection to the cluster changes.
|
||||||
def _onConnectionStateChanged(self) -> None:
|
def connect(self) -> None:
|
||||||
if self.connectionState == ConnectionState.connected:
|
super().connect()
|
||||||
self.sendMaterialProfiles()
|
self.sendMaterialProfiles()
|
||||||
|
|
||||||
def _update(self) -> None:
|
def _update(self) -> None:
|
||||||
if not super()._update():
|
if not super()._update():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue