Browse Source

Message to show user when cloud printer is not available
-added png for makerbots for exception case

CURA-11138

CURA-11138

saumya.jain 1 year ago
parent
commit
1cc7ce7a66

BIN
plugins/UM3NetworkPrinting/resources/png/MakerBot Method X.png


BIN
plugins/UM3NetworkPrinting/resources/png/MakerBot Method XL.png


BIN
plugins/UM3NetworkPrinting/resources/png/MakerBot Method.png


+ 9 - 1
plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py

@@ -9,6 +9,7 @@ from PyQt6.QtWidgets import QMessageBox
 
 from UM import i18nCatalog
 from UM.Logger import Logger  # To log errors talking to the API.
+from UM.Message import Message
 from UM.Settings.Interfaces import ContainerInterface
 from UM.Signal import Signal
 from UM.Util import parseBool
@@ -25,7 +26,7 @@ from .CloudOutputDevice import CloudOutputDevice
 from ..Messages.RemovedPrintersMessage import RemovedPrintersMessage
 from ..Models.Http.CloudClusterResponse import CloudClusterResponse
 from ..Messages.NewPrinterDetectedMessage import NewPrinterDetectedMessage
-
+catalog = i18nCatalog("cura")
 
 class CloudOutputDeviceManager:
     """The cloud output device manager is responsible for using the Ultimaker Cloud APIs to manage remote clusters.
@@ -179,6 +180,13 @@ class CloudOutputDeviceManager:
                 return
         Logger.log("e", f"Failed writing to specific cloud printer: {unique_id} not in remote clusters.")
 
+        # This message is added so that user knows when the print job was not sent to cloud printer
+        message = Message(catalog.i18nc("@info:status",
+                                    "Failed writing to specific cloud printer: {0} not in remote clusters.").format(unique_id),
+                      title=catalog.i18nc("@info:title", "Error"),
+                      message_type=Message.MessageType.ERROR)
+        message.show()
+
     def _createMachineStacksForDiscoveredClusters(self, discovered_clusters: List[CloudClusterResponse]) -> None:
         """**Synchronously** create machines for discovered devices