diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py index d2968acb2c..8c81ce39a8 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py @@ -51,7 +51,7 @@ class CloudOutputDeviceManager: self._account = CuraApplication.getInstance().getCuraAPI().account # type: Account self._api = CloudApiClient(CuraApplication.getInstance(), on_error = lambda error: Logger.log("e", str(error))) self._account.loginStateChanged.connect(self._onLoginStateChanged) - self.removed_printers_message = None # type: Optional[Message] + self._removed_printers_message = None # type: Optional[Message] # Ensure we don't start twice. self._running = False @@ -123,9 +123,9 @@ class CloudOutputDeviceManager: self._onDevicesDiscovered(new_clusters) # Hide the current removed_printers_message, if there is any - if self.removed_printers_message: - self.removed_printers_message.actionTriggered.disconnect(self._onRemovedPrintersMessageActionTriggered) - self.removed_printers_message.hide() + if self._removed_printers_message: + self._removed_printers_message.actionTriggered.disconnect(self._onRemovedPrintersMessageActionTriggered) + self._removed_printers_message.hide() # Remove the CloudOutput device for offline printers offline_device_keys = set(self._remote_clusters.keys()) - set(online_clusters.keys()) @@ -276,7 +276,7 @@ class CloudOutputDeviceManager: return # Generate message - self.removed_printers_message = Message( + self._removed_printers_message = Message( title = self.I18N_CATALOG.i18ncp( "info:status", "Cloud connection is not available for a printer", @@ -298,19 +298,19 @@ class CloudOutputDeviceManager: "Ultimaker Digital Factory.", device_names ) - self.removed_printers_message.setText(message_text) - self.removed_printers_message.addAction("keep_printer_configurations_action", - name = self.I18N_CATALOG.i18nc("@action:button", "Keep printer configurations"), - icon = "", - description = "Keep the configuration of the cloud printer(s) synced with Cura which are not linked to your account.", - button_align = Message.ActionButtonAlignment.ALIGN_RIGHT) - self.removed_printers_message.addAction("remove_printers_action", - name = self.I18N_CATALOG.i18nc("@action:button", "Remove printers"), - icon = "", - description = "Remove the cloud printer(s) which are not linked to your account.", - button_style = Message.ActionButtonStyle.SECONDARY, - button_align = Message.ActionButtonAlignment.ALIGN_LEFT) - self.removed_printers_message.actionTriggered.connect(self._onRemovedPrintersMessageActionTriggered) + self._removed_printers_message.setText(message_text) + self._removed_printers_message.addAction("keep_printer_configurations_action", + name = self.I18N_CATALOG.i18nc("@action:button", "Keep printer configurations"), + icon = "", + description = "Keep the configuration of the cloud printer(s) synced with Cura which are not linked to your account.", + button_align = Message.ActionButtonAlignment.ALIGN_RIGHT) + self._removed_printers_message.addAction("remove_printers_action", + name = self.I18N_CATALOG.i18nc("@action:button", "Remove printers"), + icon = "", + description = "Remove the cloud printer(s) which are not linked to your account.", + button_style = Message.ActionButtonStyle.SECONDARY, + button_align = Message.ActionButtonAlignment.ALIGN_LEFT) + self._removed_printers_message.actionTriggered.connect(self._onRemovedPrintersMessageActionTriggered) output_device_manager = CuraApplication.getInstance().getOutputDeviceManager() @@ -327,7 +327,7 @@ class CloudOutputDeviceManager: # Update the printer's metadata to mark it as not linked to the account device.setMetaDataEntry(META_UM_LINKED_TO_ACCOUNT, False) - self.removed_printers_message.show() + self._removed_printers_message.show() def _onDiscoveredDeviceRemoved(self, device_id: str) -> None: device = self._remote_clusters.pop(device_id, None) # type: Optional[CloudOutputDevice]