mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Move cloud connection check logic to Python
This commit is contained in:
parent
5e9fe3fe50
commit
1b356a3219
2 changed files with 10 additions and 1 deletions
|
@ -530,6 +530,15 @@ class MachineManager(QObject):
|
|||
return connection_type in [ConnectionType.NetworkConnection.value, ConnectionType.CloudConnection.value]
|
||||
return False
|
||||
|
||||
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
||||
def activeMachineHasCloudConnection(self) -> bool:
|
||||
if not self.activeMachineHasRemoteConnection:
|
||||
return False
|
||||
output_device = next(iter(self.printerOutputDevices), None) # type: PrinterOutputDevice
|
||||
if not output_device:
|
||||
return False
|
||||
return output_device.connectionType == ConnectionType.CloudConnection
|
||||
|
||||
def activeMachineNetworkKey(self) -> str:
|
||||
if self._global_container_stack:
|
||||
return self._global_container_stack.getMetaDataEntry("um_network_key", "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue