diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py index c4929fc2d1..ccc64f8073 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py @@ -15,7 +15,6 @@ from cura.Settings.GlobalStack import GlobalStack from .CloudApiClient import CloudApiClient from .CloudOutputDevice import CloudOutputDevice from ..Models.Http.CloudClusterResponse import CloudClusterResponse -from ..Messages.CloudPrinterDetectedMessage import CloudPrinterDetectedMessage ## The cloud output device manager is responsible for using the Ultimaker Cloud APIs to manage remote clusters. @@ -111,7 +110,6 @@ class CloudOutputDeviceManager: ) self._remote_clusters[device.getId()] = device self.discoveredDevicesChanged.emit() - self._checkIfNewClusterWasAdded(device.clusterData.cluster_id) self._connectToActiveMachine() def _onDiscoveredDeviceUpdated(self, cluster_data: CloudClusterResponse) -> None: @@ -183,11 +181,4 @@ class CloudOutputDeviceManager: output_device_manager = CuraApplication.getInstance().getOutputDeviceManager() if device.key not in output_device_manager.getOutputDeviceIds(): - output_device_manager.addOutputDevice(device) - - ## Checks if Cura has a machine stack (printer) for the given cluster ID and shows a message if it hasn't. - def _checkIfNewClusterWasAdded(self, cluster_id: str) -> None: - container_registry = CuraApplication.getInstance().getContainerRegistry() - cloud_machines = container_registry.findContainersMetadata(**{self.META_CLUSTER_ID: "*"}) # all cloud machines - if not any(machine[self.META_CLUSTER_ID] == cluster_id for machine in cloud_machines): - CloudPrinterDetectedMessage().show() + output_device_manager.addOutputDevice(device) \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/src/Messages/CloudPrinterDetectedMessage.py b/plugins/UM3NetworkPrinting/src/Messages/CloudPrinterDetectedMessage.py deleted file mode 100644 index 3a1a9f0e0f..0000000000 --- a/plugins/UM3NetworkPrinting/src/Messages/CloudPrinterDetectedMessage.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2019 Ultimaker B.V. -# Cura is released under the terms of the LGPLv3 or higher. -from UM import i18nCatalog -from UM.Message import Message -from cura.CuraApplication import CuraApplication - -I18N_CATALOG = i18nCatalog("cura") - - -## Message shown when a new printer was added to your account but not yet in Cura. -class CloudPrinterDetectedMessage(Message): - - # Singleton used to prevent duplicate messages of this type at the same time. - __is_visible = False - - # Store in preferences to hide this message in the future. - _preference_key = "cloud/block_new_printers_popup" - - def __init__(self) -> None: - super().__init__( - title=I18N_CATALOG.i18nc("@info:title", "New cloud printers found"), - text=I18N_CATALOG.i18nc("@info:message", "New printers have been found connected to your account, " - "you can find them in your list of discovered printers."), - lifetime=0, - dismissable=True, - option_state=False, - option_text=I18N_CATALOG.i18nc("@info:option_text", "Do not show this message again") - ) - self.optionToggled.connect(self._onDontAskMeAgain) - CuraApplication.getInstance().getPreferences().addPreference(self._preference_key, False) - - def show(self) -> None: - if CuraApplication.getInstance().getPreferences().getValue(self._preference_key): - return - if CloudPrinterDetectedMessage.__is_visible: - return - super().show() - CloudPrinterDetectedMessage.__is_visible = True - - def hide(self, send_signal = True) -> None: - super().hide(send_signal) - CloudPrinterDetectedMessage.__is_visible = False - - def _onDontAskMeAgain(self, checked: bool) -> None: - CuraApplication.getInstance().getPreferences().setValue(self._preference_key, checked)