mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 00:07:51 -06:00
Replace "cloudActive" property by generic "active"
CURA-12557
This commit is contained in:
parent
9cf75648ab
commit
ae2a189c14
6 changed files with 33 additions and 27 deletions
|
@ -184,15 +184,13 @@ class MachineManager(QObject):
|
|||
|
||||
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)
|
||||
printer_output_device.activeChanged.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)
|
||||
printer_output_device.activeChanged.connect(self.printerConnectedStatusChanged)
|
||||
|
||||
self.outputDevicesChanged.emit()
|
||||
|
||||
|
@ -576,12 +574,11 @@ class MachineManager(QObject):
|
|||
return self.activeMachineHasCloudConnection and not self.activeMachineHasNetworkConnection
|
||||
|
||||
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
||||
def activeMachineIsCloudActive(self) -> bool:
|
||||
def activeMachineIsActive(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
|
||||
return self._printer_output_devices[0].active
|
||||
|
||||
def activeMachineNetworkKey(self) -> str:
|
||||
if self._global_container_stack:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue