Remove much logging or use debug level, fix cloud icon not appearing right away

This commit is contained in:
ChrisTerBeke 2018-12-19 14:14:44 +01:00
parent dd2f12f68a
commit beb68213f4
4 changed files with 16 additions and 17 deletions

View file

@ -178,6 +178,7 @@ class MachineManager(QObject):
self._printer_output_devices.append(printer_output_device)
self.outputDevicesChanged.emit()
self.printerConnectedStatusChanged.emit()
@pyqtProperty(QObject, notify = currentConfigurationChanged)
def currentConfiguration(self) -> ConfigurationModel:
@ -520,7 +521,7 @@ class MachineManager(QObject):
return ""
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def printerConnected(self):
def printerConnected(self) -> bool:
return bool(self._printer_output_devices)
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
@ -532,9 +533,10 @@ class MachineManager(QObject):
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineHasCloudConnection(self) -> bool:
if not self.activeMachineHasRemoteConnection:
return False
output_device = next(iter(self.printerOutputDevices), None) # type: Optional[PrinterOutputDevice]
# A cloud connection is only available if the active output device actually is a cloud connected device.
# We cannot simply use the connection_type metadata entry as that's always set to 'NetworkConnection'
# if there was a network connection during setup, which is always the case.
output_device = next(iter(self._printer_output_devices), None) # type: Optional[PrinterOutputDevice]
if not output_device:
return False
return output_device.connectionType == ConnectionType.CloudConnection