mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Add legacy 'Connect over Network' button back
This commit is contained in:
parent
d703e48007
commit
e977cdd431
7 changed files with 131 additions and 140 deletions
|
@ -16,7 +16,6 @@ from .LocalClusterOutputDevice import LocalClusterOutputDevice
|
|||
from ..UltimakerNetworkedPrinterOutputDevice import UltimakerNetworkedPrinterOutputDevice
|
||||
from ..Messages.CloudFlowMessage import CloudFlowMessage
|
||||
from ..Messages.LegacyDeviceNoLongerSupportedMessage import LegacyDeviceNoLongerSupportedMessage
|
||||
from ..Messages.NotClusterHostMessage import NotClusterHostMessage
|
||||
from ..Models.Http.PrinterSystemStatus import PrinterSystemStatus
|
||||
|
||||
|
||||
|
@ -86,6 +85,17 @@ class LocalClusterOutputDeviceManager:
|
|||
def refreshConnections(self) -> None:
|
||||
self._connectToActiveMachine()
|
||||
|
||||
## Get the discovered devices.
|
||||
def getDiscoveredDevices(self) -> Dict[str, LocalClusterOutputDevice]:
|
||||
return self._discovered_devices
|
||||
|
||||
## Connect the active machine to a given device.
|
||||
def associateActiveMachineWithPrinterDevice(self, device: LocalClusterOutputDevice) -> None:
|
||||
active_machine = CuraApplication.getInstance().getGlobalContainerStack()
|
||||
if not active_machine:
|
||||
return
|
||||
self._connectToOutputDevice(device, active_machine)
|
||||
|
||||
## Callback for when the active machine was changed by the user or a new remote cluster was found.
|
||||
def _connectToActiveMachine(self) -> None:
|
||||
active_machine = CuraApplication.getInstance().getGlobalContainerStack()
|
||||
|
@ -176,8 +186,6 @@ class LocalClusterOutputDeviceManager:
|
|||
active_machine = CuraApplication.getInstance().getGlobalContainerStack()
|
||||
if not active_machine:
|
||||
return
|
||||
active_machine.setMetaDataEntry(self.META_NETWORK_KEY, device.key)
|
||||
active_machine.setMetaDataEntry("group_name", device.name)
|
||||
self._connectToOutputDevice(device, active_machine)
|
||||
CloudFlowMessage(device.ipAddress).show() # Nudge the user to start using Ultimaker Cloud.
|
||||
|
||||
|
@ -215,6 +223,10 @@ class LocalClusterOutputDeviceManager:
|
|||
LegacyDeviceNoLongerSupportedMessage().show()
|
||||
return
|
||||
|
||||
machine.setName(device.name)
|
||||
machine.setMetaDataEntry(self.META_NETWORK_KEY, device.key)
|
||||
machine.setMetaDataEntry("group_name", device.name)
|
||||
|
||||
device.connect()
|
||||
machine.addConfiguredConnectionType(device.connectionType.value)
|
||||
CuraApplication.getInstance().getOutputDeviceManager().addOutputDevice(device)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue