mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Fix some codestyle, make connectionType a property as it's needed in QML
This commit is contained in:
parent
d3419f2e07
commit
5e9fe3fe50
3 changed files with 18 additions and 21 deletions
|
@ -138,11 +138,11 @@ class DiscoverUM3Action(MachineAction):
|
|||
|
||||
if "connection_type" in meta_data:
|
||||
previous_connection_type = meta_data["connection_type"]
|
||||
global_container_stack.setMetaDataEntry("connection_type", printer_device.getConnectionType().value)
|
||||
CuraApplication.getInstance().getMachineManager().replaceContainersMetadata(key = "connection_type", value = previous_connection_type, new_value = printer_device.getConnectionType().value)
|
||||
global_container_stack.setMetaDataEntry("connection_type", printer_device.connectionType.value)
|
||||
CuraApplication.getInstance().getMachineManager().replaceContainersMetadata(key = "connection_type", value = previous_connection_type, new_value = printer_device.connectionType.value)
|
||||
else:
|
||||
global_container_stack.setMetaDataEntry("um_network_key", printer_device.key)
|
||||
global_container_stack.setMetaDataEntry("connection_type", printer_device.getConnectionType().value)
|
||||
global_container_stack.setMetaDataEntry("connection_type", printer_device.connectionType.value)
|
||||
|
||||
if self._network_plugin:
|
||||
# Ensure that the connection states are refreshed.
|
||||
|
|
|
@ -288,7 +288,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack and device.getId() == global_container_stack.getMetaDataEntry("um_network_key"):
|
||||
global_container_stack.setMetaDataEntry("connection_type", device.getConnectionType().value)
|
||||
global_container_stack.setMetaDataEntry("connection_type", device.connectionType.value)
|
||||
device.connect()
|
||||
device.connectionStateChanged.connect(self._onDeviceConnectionStateChanged)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue