mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Merge remote-tracking branch 'origin/master' into feature_intent
This commit is contained in:
commit
96a9bcccbb
55 changed files with 551 additions and 205 deletions
|
@ -96,6 +96,14 @@ class LocalClusterOutputDeviceManager:
|
|||
if not active_machine:
|
||||
return
|
||||
self._connectToOutputDevice(device, active_machine)
|
||||
self._connectToActiveMachine()
|
||||
|
||||
# Pre-select the correct machine type of the group host.
|
||||
# We first need to find the correct definition because the machine manager only takes name as input, not ID.
|
||||
definitions = CuraApplication.getInstance().getContainerRegistry().findContainers(id = device.printerType)
|
||||
if not definitions:
|
||||
return
|
||||
CuraApplication.getInstance().getMachineManager().switchPrinterType(definitions[0].getName())
|
||||
|
||||
## Callback for when the active machine was changed by the user or a new remote cluster was found.
|
||||
def _connectToActiveMachine(self) -> None:
|
||||
|
@ -111,7 +119,7 @@ class LocalClusterOutputDeviceManager:
|
|||
self._connectToOutputDevice(device, active_machine)
|
||||
elif device.key in output_device_manager.getOutputDeviceIds():
|
||||
# Remove device if it is not meant for the active machine.
|
||||
CuraApplication.getInstance().getOutputDeviceManager().removeOutputDevice(device.key)
|
||||
output_device_manager.removeOutputDevice(device.key)
|
||||
|
||||
## Callback for when a manual device check request was responded to.
|
||||
def _onCheckManualDeviceResponse(self, address: str, status: PrinterSystemStatus,
|
||||
|
@ -201,7 +209,7 @@ class LocalClusterOutputDeviceManager:
|
|||
if not active_machine:
|
||||
return
|
||||
self._connectToOutputDevice(device, active_machine)
|
||||
CloudFlowMessage(device.ipAddress).show() # Nudge the user to start using Ultimaker Cloud.
|
||||
self._showCloudFlowMessage(device)
|
||||
|
||||
## Add an address to the stored preferences.
|
||||
def _storeManualAddress(self, address: str) -> None:
|
||||
|
@ -248,3 +256,14 @@ class LocalClusterOutputDeviceManager:
|
|||
output_device_manager = CuraApplication.getInstance().getOutputDeviceManager()
|
||||
if device.key not in output_device_manager.getOutputDeviceIds():
|
||||
output_device_manager.addOutputDevice(device)
|
||||
|
||||
## Nudge the user to start using Ultimaker Cloud.
|
||||
@staticmethod
|
||||
def _showCloudFlowMessage(device: LocalClusterOutputDevice) -> None:
|
||||
if CuraApplication.getInstance().getMachineManager().activeMachineIsUsingCloudConnection:
|
||||
# This printer is already cloud connected, so we do not bother the user anymore.
|
||||
return
|
||||
if not CuraApplication.getInstance().getCuraAPI().account.isLoggedIn:
|
||||
# Do not show the message if the user is not signed in.
|
||||
return
|
||||
CloudFlowMessage(device.ipAddress).show()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue