mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Display the printer activation status
CURA-12557
This commit is contained in:
parent
65b0e4f080
commit
2e9999ed2d
6 changed files with 69 additions and 7 deletions
|
@ -183,10 +183,16 @@ class MachineManager(QObject):
|
|||
self.setActiveMachine(active_machine_id)
|
||||
|
||||
def _onOutputDevicesChanged(self) -> None:
|
||||
for printer_output_device in self._printer_output_devices:
|
||||
if hasattr(printer_output_device, "cloudActiveChanged"):
|
||||
printer_output_device.cloudActiveChanged.disconnect(self.printerConnectedStatusChanged)
|
||||
|
||||
self._printer_output_devices = []
|
||||
for printer_output_device in self._application.getOutputDeviceManager().getOutputDevices():
|
||||
if isinstance(printer_output_device, PrinterOutputDevice):
|
||||
self._printer_output_devices.append(printer_output_device)
|
||||
if hasattr(printer_output_device, "cloudActiveChanged"):
|
||||
printer_output_device.cloudActiveChanged.connect(self.printerConnectedStatusChanged)
|
||||
|
||||
self.outputDevicesChanged.emit()
|
||||
|
||||
|
@ -569,6 +575,14 @@ class MachineManager(QObject):
|
|||
def activeMachineIsUsingCloudConnection(self) -> bool:
|
||||
return self.activeMachineHasCloudConnection and not self.activeMachineHasNetworkConnection
|
||||
|
||||
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
||||
def activeMachineIsCloudActive(self) -> bool:
|
||||
if not self._printer_output_devices:
|
||||
return True
|
||||
|
||||
first_printer = self._printer_output_devices[0]
|
||||
return True if not hasattr(first_printer, 'cloudActive') else first_printer.cloudActive
|
||||
|
||||
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