mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 16:57:51 -06:00
Fix review comments
CURA-6011
This commit is contained in:
parent
aad7540366
commit
84a7f2e5a2
5 changed files with 10 additions and 10 deletions
|
@ -54,7 +54,7 @@ class PrintersModel(ListModel):
|
||||||
|
|
||||||
for container_stack in container_stacks:
|
for container_stack in container_stacks:
|
||||||
connection_type = container_stack.getMetaDataEntry("connection_type")
|
connection_type = container_stack.getMetaDataEntry("connection_type")
|
||||||
has_remote_connection = connection_type in [str(ConnectionType.NetworkConnection), str(ConnectionType.CloudConnection)]
|
has_remote_connection = connection_type in [ConnectionType.NetworkConnection.value, ConnectionType.CloudConnection.value]
|
||||||
|
|
||||||
if container_stack.getMetaDataEntry("hidden", False) in ["True", True]:
|
if container_stack.getMetaDataEntry("hidden", False) in ["True", True]:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -521,11 +521,11 @@ class MachineManager(QObject):
|
||||||
def printerConnected(self):
|
def printerConnected(self):
|
||||||
return bool(self._printer_output_devices)
|
return bool(self._printer_output_devices)
|
||||||
|
|
||||||
@pyqtProperty(bool, notify=printerConnectedStatusChanged)
|
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
||||||
def activeMachineHasRemoteConnection(self) -> bool:
|
def activeMachineHasRemoteConnection(self) -> bool:
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
connection_type = self._global_container_stack.getMetaDataEntry("connection_type")
|
connection_type = self._global_container_stack.getMetaDataEntry("connection_type")
|
||||||
return connection_type in [str(ConnectionType.NetworkConnection), str(ConnectionType.CloudConnection)]
|
return connection_type in [ConnectionType.NetworkConnection.value, ConnectionType.CloudConnection.value]
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def activeMachineNetworkKey(self) -> str:
|
def activeMachineNetworkKey(self) -> str:
|
||||||
|
|
|
@ -136,13 +136,13 @@ class DiscoverUM3Action(MachineAction):
|
||||||
global_container_stack.removeMetaDataEntry("network_authentication_key")
|
global_container_stack.removeMetaDataEntry("network_authentication_key")
|
||||||
CuraApplication.getInstance().getMachineManager().replaceContainersMetadata(key = "um_network_key", value = previous_network_key, new_value = printer_device.key)
|
CuraApplication.getInstance().getMachineManager().replaceContainersMetadata(key = "um_network_key", value = previous_network_key, new_value = printer_device.key)
|
||||||
|
|
||||||
if "um_connection_type" in meta_data:
|
if "connection_type" in meta_data:
|
||||||
previous_connection_type = meta_data["um_connection_type"]
|
previous_connection_type = meta_data["connection_type"]
|
||||||
global_container_stack.setMetaDataEntry("um_connection_type", printer_device.getConnectionType().value)
|
global_container_stack.setMetaDataEntry("connection_type", printer_device.getConnectionType().value)
|
||||||
CuraApplication.getInstance().getMachineManager().replaceContainersMetadata(key = "um_connection_type", value = previous_connection_type, new_value = printer_device.getConnectionType().value)
|
CuraApplication.getInstance().getMachineManager().replaceContainersMetadata(key = "connection_type", value = previous_connection_type, new_value = printer_device.getConnectionType().value)
|
||||||
else:
|
else:
|
||||||
global_container_stack.setMetaDataEntry("um_network_key", printer_device.key)
|
global_container_stack.setMetaDataEntry("um_network_key", printer_device.key)
|
||||||
global_container_stack.setMetaDataEntry("um_connection_type", printer_device.getConnectionType().value)
|
global_container_stack.setMetaDataEntry("connection_type", printer_device.getConnectionType().value)
|
||||||
|
|
||||||
if self._network_plugin:
|
if self._network_plugin:
|
||||||
# Ensure that the connection states are refreshed.
|
# Ensure that the connection states are refreshed.
|
||||||
|
|
|
@ -283,7 +283,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
|
|
||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
if global_container_stack and device.getId() == global_container_stack.getMetaDataEntry("um_network_key"):
|
if global_container_stack and device.getId() == global_container_stack.getMetaDataEntry("um_network_key"):
|
||||||
global_container_stack.setMetaDataEntry("connection_type", str(device.getConnectionType()))
|
global_container_stack.setMetaDataEntry("connection_type", device.getConnectionType().value)
|
||||||
device.connect()
|
device.connect()
|
||||||
device.connectionStateChanged.connect(self._onDeviceConnectionStateChanged)
|
device.connectionStateChanged.connect(self._onDeviceConnectionStateChanged)
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
class USBPrinterOutputDevice(PrinterOutputDevice):
|
class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
def __init__(self, serial_port: str, baud_rate: Optional[int] = None) -> None:
|
def __init__(self, serial_port: str, baud_rate: Optional[int] = None) -> None:
|
||||||
super().__init__(serial_port, connection_type=ConnectionType.UsbConnection)
|
super().__init__(serial_port, connection_type = ConnectionType.UsbConnection)
|
||||||
self.setName(catalog.i18nc("@item:inmenu", "USB printing"))
|
self.setName(catalog.i18nc("@item:inmenu", "USB printing"))
|
||||||
self.setShortDescription(catalog.i18nc("@action:button Preceded by 'Ready to'.", "Print via USB"))
|
self.setShortDescription(catalog.i18nc("@action:button Preceded by 'Ready to'.", "Print via USB"))
|
||||||
self.setDescription(catalog.i18nc("@info:tooltip", "Print via USB"))
|
self.setDescription(catalog.i18nc("@info:tooltip", "Print via USB"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue