Просмотр исходного кода

Merge branch '4.11' into CURA-8491_sdk_upgrade_770

Ghostkeeper 3 лет назад
Родитель
Сommit
fcadba944a

+ 3 - 1
plugins/DigitalLibrary/src/BackwardsCompatibleMessage.py

@@ -1,11 +1,13 @@
 # Copyright (c) 2021 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
+from typing import Optional
 
 from cura.CuraApplication import CuraApplication
 from UM.Message import Message
 from UM.Version import Version
 
-def getBackwardsCompatibleMessage(text: str, title: str, lifetime: int, message_type_str: str) -> Message:
+
+def getBackwardsCompatibleMessage(text: str, title: str, message_type_str: str, lifetime: Optional[int] = 30) -> Message:
     if CuraApplication.getInstance().getAPIVersion() < Version("7.7.0"):
         return Message(text=text, title=title, lifetime=lifetime)
     else:

+ 12 - 15
plugins/DigitalLibrary/src/DFFileExportAndUploadManager.py

@@ -73,7 +73,6 @@ class DFFileExportAndUploadManager:
         self._generic_success_message = getBackwardsCompatibleMessage(
                 text = "Your {} uploaded to '{}'.".format("file was" if len(self._file_upload_job_metadata) <= 1 else "files were", self._library_project_name),
                 title = "Upload successful",
-                lifetime = 0,
                 message_type_str = "POSITIVE"
         )
         self._generic_success_message.addAction(
@@ -221,8 +220,8 @@ class DFFileExportAndUploadManager:
             self._file_upload_job_metadata[filename]["file_upload_failed_message"] = getBackwardsCompatibleMessage(
                     text = "Failed to export the file '{}'. The upload process is aborted.".format(filename),
                     title = "Export error",
-                    lifetime = 0,
-                    message_type_str = "ERROR"
+                    message_type_str = "ERROR",
+                    lifetime = 0
             )
         self._on_upload_error()
         self._onFileUploadFinished(filename)
@@ -244,8 +243,8 @@ class DFFileExportAndUploadManager:
             self._file_upload_job_metadata[filename_3mf]["file_upload_failed_message"] = getBackwardsCompatibleMessage(
                     text = "Failed to upload the file '{}' to '{}'. {}".format(filename_3mf, self._library_project_name, human_readable_error),
                     title = "File upload error",
-                    lifetime = 0,
-                    message_type_str = "ERROR"
+                    message_type_str = "ERROR",
+                    lifetime = 0
             )
         self._on_upload_error()
         self._onFileUploadFinished(filename_3mf)
@@ -267,8 +266,8 @@ class DFFileExportAndUploadManager:
             self._file_upload_job_metadata[filename_ufp]["file_upload_failed_message"] = getBackwardsCompatibleMessage(
                     title = "File upload error",
                     text = "Failed to upload the file '{}' to '{}'. {}".format(filename_ufp, self._library_project_name, human_readable_error),
-                    lifetime = 0,
-                    message_type_str = "ERROR"
+                    message_type_str = "ERROR",
+                    lifetime = 0
             )
         self._on_upload_error()
         self._onFileUploadFinished(filename_ufp)
@@ -304,8 +303,8 @@ class DFFileExportAndUploadManager:
             self._file_upload_job_metadata[filename]["file_upload_failed_message"] = getBackwardsCompatibleMessage(
                     title = "File upload error",
                     text = "Failed to upload the file '{}' to '{}'. {}".format(self._file_name, self._library_project_name, human_readable_error),
-                    lifetime = 0,
-                    message_type_str = "ERROR"
+                    message_type_str = "ERROR",
+                    lifetime = 0
             )
 
         self._on_upload_error()
@@ -341,14 +340,13 @@ class DFFileExportAndUploadManager:
                 "file_upload_success_message": getBackwardsCompatibleMessage(
                     text = "'{}' was uploaded to '{}'.".format(filename_3mf, self._library_project_name),
                     title = "Upload successful",
-                    lifetime = 0,
                     message_type_str = "POSITIVE"
                 ),
                 "file_upload_failed_message": getBackwardsCompatibleMessage(
                     text = "Failed to upload the file '{}' to '{}'.".format(filename_3mf, self._library_project_name),
                     title = "File upload error",
-                    lifetime = 0,
-                    message_type_str = "ERROR"
+                    message_type_str = "ERROR",
+                    lifetime = 0
                 )
             }
             job_3mf = ExportFileJob(self._file_handlers["3mf"], self._nodes, self._file_name, "3mf")
@@ -365,14 +363,13 @@ class DFFileExportAndUploadManager:
                 "file_upload_success_message": getBackwardsCompatibleMessage(
                     text = "'{}' was uploaded to '{}'.".format(filename_ufp, self._library_project_name),
                     title = "Upload successful",
-                    lifetime = 0,
                     message_type_str = "POSITIVE"
                 ),
                 "file_upload_failed_message": getBackwardsCompatibleMessage(
                     text = "Failed to upload the file '{}' to '{}'.".format(filename_ufp, self._library_project_name),
                     title = "File upload error",
-                    lifetime = 0,
-                    message_type_str = "ERROR"
+                    message_type_str = "ERROR",
+                    lifetime = 0
                 )
             }
             job_ufp = ExportFileJob(self._file_handlers["ufp"], self._nodes, self._file_name, "ufp")

+ 9 - 7
plugins/DigitalLibrary/src/DigitalFactoryController.py

@@ -531,8 +531,8 @@ class DigitalFactoryController(QObject):
                 getBackwardsCompatibleMessage(
                         text = "Failed to write to temporary file for '{}'.".format(file_name),
                         title = "File-system error",
-                        lifetime = 10,
-                        message_type_str="ERROR"
+                        message_type_str="ERROR",
+                        lifetime = 10
                 ).show()
                 return
 
@@ -546,8 +546,8 @@ class DigitalFactoryController(QObject):
             getBackwardsCompatibleMessage(
                     text = "Failed Digital Library download for '{}'.".format(f),
                     title = "Network error {}".format(error),
-                    lifetime = 10,
-                    message_type_str="ERROR"
+                    message_type_str="ERROR",
+                    lifetime = 10
             ).show()
 
         download_manager = HttpRequestManager.getInstance()
@@ -592,10 +592,12 @@ class DigitalFactoryController(QObject):
 
         if filename == "":
             Logger.log("w", "The file name cannot be empty.")
-            getBackwardsCompatibleMessage(text = "Cannot upload file with an empty name to the Digital Library",
+            getBackwardsCompatibleMessage(
+                    text = "Cannot upload file with an empty name to the Digital Library",
                     title = "Empty file name provided",
-                    lifetime = 0,
-                    message_type_str = "ERROR").show()
+                    message_type_str = "ERROR",
+                    lifetime = 0
+            ).show()
             return
 
         self._saveFileToSelectedProjectHelper(filename, formats)

+ 1 - 1
resources/texts/whats_new/0.html

@@ -1,3 +1,3 @@
 <h4>Complete UI refresh</h4>
 <p>Look around and you will notice that we have refreshed over 100 icons throughout Ultimaker Cura. The new icons are designed for clarity – resulting in a simpler and more informative slicing experience. Also, when scaling the Ultimaker Cura window, the UI will adapt, resulting in less visual clutter.</br> 
-<a href="">Learn more</a></p>
+<a href="https://ultimaker.com/learn/clear-skies-with-ultimaker-cura-4-11-beta?utm_source=cura&utm_medium=software&utm_campaign=whatsnew-4-11-releaseblog">Learn more</a></p>

+ 2 - 2
resources/texts/whats_new/1.html

@@ -1,3 +1,3 @@
 <h4>Improved digital library integration</h4>
-<p>Collaborative workflows using the Digital Library are now simpler. Every user with a cloud-connected Ultimaker 3D printer can access stored projects. And we have added a “Search” function to make finding files easier. <a href="">Learn more</a></br>
-Ready to get more out of your Ultimaker 3D Printer? <a href="">Upgrade to Ultimaker Essentials</a></p>
+<p>Collaborative workflows using the Digital Library are now simpler. Every user with a cloud-connected Ultimaker 3D printer can access stored projects. And we have added a “Search” function to make finding files easier. <a href="https://support.ultimaker.com/hc/en-us/articles/360020968960-Enhance-your-3D-printing-workflow-in-Ultimaker-Cura#h_01F32KXEXZ0940RCVFQZCWSG7B?utm_source=cura&utm_medium=software&utm_campaign=whatsnew-4-11-supportblog">Learn more</a><br>
+Ready to get more out of your Ultimaker 3D Printer? <a href="https://ultimaker.com/software/ultimaker-essentials?utm_source=cura&utm_medium=software&utm_campaign=whatsnew-4-11-essentialspage">Upgrade to Ultimaker Essentials</a></p>

+ 1 - 1
resources/texts/whats_new/3.html

@@ -1,2 +1,2 @@
 <h4>Learn about the past and future of Ultimaker Cura</h4>
-<p>How did Ultimaker Cura start? What does its future hold? Hear the origin stories and discover what's next, by listening to the core developers and community featured in <a href="">episode 29</a> and <a href="">episode 30</a> of the Talking Additive podcast.</p>
+<p>How did Ultimaker Cura start? What does its future hold? Hear the origin stories and discover what's next, by listening to the core developers and community featured in <a href="https://www.talkingadditive.com/episodes/episode-29-the-story-of-ultimaker-cura?utm_source=cura&utm_medium=software&utm_campaign=whatsnew-4-11-ta-ep29">episode 29</a> and <a href="https://www.talkingadditive.com/episodes/episode-30-the-future-of-ultimaker-cura-and-beyond?utm_source=cura&utm_medium=software&utm_campaign=whatsnew-4-11-ta-ep30">episode 30</a> of the Talking Additive podcast.</p>

+ 1 - 1
resources/texts/whats_new/4.html

@@ -1,2 +1,2 @@
 <h4>Get more information</h4>
-<p>Want more information on new features, bug fixes, and more for Ultimaker Cura 4.11 beta? Read the full<a href="">blog post</a> and don't forget to give us your feedback on<a href="https://github.com/Ultimaker/Cura/issues/new/choose">Github</a>!</p>
+<p>Want more information on new features, bug fixes, and more for Ultimaker Cura 4.11 beta? Read the full <a href="https://ultimaker.com/learn/clear-skies-with-ultimaker-cura-4-11-beta?utm_source=cura&utm_medium=software&utm_campaign=whatsnew-4-11-releaseblog">blog post</a> and don't forget to give us your feedback on <a href="https://github.com/Ultimaker/Cura/issues/new/choose">Github</a>!</p>