diff --git a/plugins/UM3NetworkPrinting/src/CloudFlowMessage.py b/plugins/UM3NetworkPrinting/src/CloudFlowMessage.py index 2d7b99b750..4f2f7a71a2 100644 --- a/plugins/UM3NetworkPrinting/src/CloudFlowMessage.py +++ b/plugins/UM3NetworkPrinting/src/CloudFlowMessage.py @@ -16,16 +16,19 @@ I18N_CATALOG = i18nCatalog("cura") class CloudFlowMessage(Message): def __init__(self, address: str) -> None: + + image_path = os.path.join( + CuraApplication.getInstance().getPluginRegistry().getPluginPath("UM3NetworkPrinting") or "", + "resources", "svg", "cloud-flow-start.svg" + ) + super().__init__( text=I18N_CATALOG.i18nc("@info:status", "Send and monitor print jobs from anywhere using your Ultimaker account."), lifetime=0, dismissable=True, option_state=False, - image_source=QUrl.fromLocalFile(os.path.join( - CuraApplication.getInstance().getPluginRegistry().getPluginPath("UM3NetworkPrinting"), - "resources", "svg", "cloud-flow-start.svg" - )), + image_source=image_path, image_caption=I18N_CATALOG.i18nc("@info:status Ultimaker Cloud should not be translated.", "Connect to Ultimaker Cloud"), ) diff --git a/plugins/UM3NetworkPrinting/src/ExportFileJob.py b/plugins/UM3NetworkPrinting/src/ExportFileJob.py index 7abe1e6d8e..56d15bc835 100644 --- a/plugins/UM3NetworkPrinting/src/ExportFileJob.py +++ b/plugins/UM3NetworkPrinting/src/ExportFileJob.py @@ -1,4 +1,4 @@ -from typing import List +from typing import List, Optional from UM.FileHandler.FileHandler import FileHandler from UM.FileHandler.WriteFileJob import WriteFileJob @@ -12,7 +12,7 @@ from .MeshFormatHandler import MeshFormatHandler ## Job that exports the build plate to the correct file format for the target cluster. class ExportFileJob(WriteFileJob): - def __init__(self, file_handler: FileHandler, nodes: List[SceneNode], firmware_version: str) -> None: + def __init__(self, file_handler: Optional[FileHandler], nodes: List[SceneNode], firmware_version: str) -> None: self._mesh_format_handler = MeshFormatHandler(file_handler, firmware_version) if not self._mesh_format_handler.is_valid: diff --git a/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py b/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py index 1b13b6c91c..9927bf744e 100644 --- a/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py +++ b/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py @@ -32,7 +32,7 @@ class MeshFormatHandler: # \return A dict with the file format details, with the following keys: # {id: str, extension: str, description: str, mime_type: str, mode: int, hide_in_file_dialog: bool} @property - def preferred_format(self) -> Optional[Dict[str, Union[str, int, bool]]]: + def preferred_format(self) -> Dict[str, Union[str, int, bool]]: return self._preferred_format ## Gets the file writer for the given file handler and mime type. diff --git a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py index f8cf652114..758760ce86 100644 --- a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py @@ -7,7 +7,6 @@ from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty from PyQt5.QtNetwork import QNetworkReply from UM.FileHandler.FileHandler import FileHandler -from UM.FileHandler.WriteFileJob import WriteFileJob from UM.Message import Message from UM.i18n import i18nCatalog from UM.Scene.SceneNode import SceneNode @@ -130,7 +129,7 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice): ## Handler for when the print job was created locally. # It can now be sent over the network. - def _onPrintJobCreated(self, job: WriteFileJob) -> None: + def _onPrintJobCreated(self, job: ExportFileJob) -> None: self._progress.show() parts = [ self._createFormPart("name=owner", bytes(self._getUserName(), "utf-8"), "text/plain"), diff --git a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py index fedead7bce..9e21c0b4de 100644 --- a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py @@ -191,7 +191,7 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice): # Keep track of the new printers to show. # We create a new list instead of changing the existing one to get the correct order. - new_printers = [] + new_printers = [] # type: List[PrinterOutputModel] # Check which printers need to be created or updated. for index, printer_data in enumerate(remote_printers):