mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Only set "do not show cloud message" metadata if active machine is the added cloud cluster
Contributes to CL-1267
This commit is contained in:
parent
9aef692082
commit
2233543780
1 changed files with 11 additions and 2 deletions
|
@ -458,7 +458,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
if self._start_cloud_flow_message and not self._start_cloud_flow_message.visible:
|
||||
self._start_cloud_flow_message.show()
|
||||
|
||||
def _onCloudPrintingConfigured(self) -> None:
|
||||
def _onCloudPrintingConfigured(self, device) -> None:
|
||||
# Hide the cloud flow start message if it was hanging around already
|
||||
# For example: if the user already had the browser openen and made the association themselves
|
||||
if self._start_cloud_flow_message and self._start_cloud_flow_message.visible:
|
||||
|
@ -473,7 +473,16 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
# Set the machine's cloud flow as complete so we don't ask the user again and again for cloud connected printers
|
||||
active_machine = self._application.getMachineManager().activeMachine
|
||||
if active_machine:
|
||||
active_machine.setMetaDataEntry("do_not_show_cloud_message", True)
|
||||
|
||||
# The active machine _might_ not be the machine that was in the added cloud cluster and
|
||||
# then this will hide the cloud message for the wrong machine. So we only set it if the
|
||||
# host names match between the active machine and the newly added cluster
|
||||
saved_host_name = active_machine.getMetaDataEntry("um_network_key", "").split('.')[0]
|
||||
added_host_name = device.toDict()["host_name"]
|
||||
|
||||
if added_host_name == saved_host_name:
|
||||
active_machine.setMetaDataEntry("do_not_show_cloud_message", True)
|
||||
|
||||
return
|
||||
|
||||
def _onDontAskMeAgain(self, checked: bool) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue