diff options
author | Jaime van Kessel <nallath@gmail.com> | 2020-10-20 14:45:50 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2020-10-20 14:45:50 +0300 |
commit | 5c5a26bf35f27aa759630f5fab90efbe789617b2 (patch) | |
tree | 00c01b3166c73f7b9b76a6415f601ebae48665a7 /plugins/UM3NetworkPrinting | |
parent | a8acdd01e4e0b3f07522852364def9a6f75b00e6 (diff) | |
parent | 2254a49c74331caff9a0d926eec5c785ef745bfd (diff) |
Merge branch '4.8' of github.com:Ultimaker/Cura
Diffstat (limited to 'plugins/UM3NetworkPrinting')
-rw-r--r-- | plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py index c05945c356..c9231d71ee 100644 --- a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py @@ -85,6 +85,8 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice): self._timeout_time = 30 + self._num_is_host_check_failed = 0 + @pyqtProperty(str, constant=True) def address(self) -> str: """The IP address of the printer.""" @@ -293,8 +295,16 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice): def _checkIfClusterHost(self): """Check is this device is a cluster host and takes the needed actions when it is not.""" - if len(self._printers) < 1 and self.isConnected(): + self._num_is_host_check_failed += 1 + else: + self._num_is_host_check_failed = 0 + + # Since we request the status of the cluster itself way less frequent in the cloud, it can happen that a cloud + # printer reports having 0 printers (since they are offline!) but we haven't asked if the entire cluster is + # offline. (See CURA-7360) + # So by just counting a number of subsequent times that this has happened fixes the incorrect display. + if self._num_is_host_check_failed >= 6: NotClusterHostMessage(self).show() self.close() CuraApplication.getInstance().getOutputDeviceManager().removeOutputDevice(self.key) |