From 12a406529ebef8170b892d30bf8e75d54d5b1846 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 7 Jun 2018 12:51:52 +0200 Subject: [PATCH 1/3] Fix inconsistent curaproject mimetype definition CURA-5334 - In project file writer, it says the mime type is "application/x-curaproject+xml", and we decided to use this as THE mime type. - Pass preferred_mimetype to save project file dialog so it automatically adds the file extension upon open. --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 2 +- resources/qml/Cura.qml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 9375e5d6ee..09ac501dcc 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -86,7 +86,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader): MimeTypeDatabase.addMimeType( MimeType( - name="application/x-cura-project-file", + name="application/x-curaproject+xml", comment="Cura Project File", suffixes=["curaproject.3mf"] ) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index dce106e219..6a026cf5e0 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -139,13 +139,15 @@ UM.MainWindow text: catalog.i18nc("@title:menu menubar:file","Save &Project...") onTriggered: { + var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetype": "application/x-curaproject+xml" }; if(UM.Preferences.getValue("cura/dialog_on_project_save")) { + saveWorkspaceDialog.args = args; saveWorkspaceDialog.open() } else { - UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "file_type": "workspace" }) + UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args) } } } @@ -557,7 +559,8 @@ UM.MainWindow WorkspaceSummaryDialog { id: saveWorkspaceDialog - onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "file_type": "workspace" }) + property var args + onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args) } Connections From 54c827fd4411f79c7ec9eea75ddd116d2c64d089 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 7 Jun 2018 13:43:43 +0200 Subject: [PATCH 2/3] Do not run firmware update check jobs in parallel CURA-5418 To avoid showing multiple update messages. --- .../FirmwareUpdateChecker.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py index 23a040f2e2..bc216ab395 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py @@ -8,10 +8,11 @@ from UM.Extension import Extension from UM.Preferences import Preferences from UM.Logger import Logger from UM.i18n import i18nCatalog +from UM.Settings.ContainerRegistry import ContainerRegistry + from cura.Settings.GlobalStack import GlobalStack from .FirmwareUpdateCheckerJob import FirmwareUpdateCheckerJob -from UM.Settings.ContainerRegistry import ContainerRegistry i18n_catalog = i18nCatalog("cura") @@ -36,6 +37,7 @@ class FirmwareUpdateChecker(Extension): ContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded) self._download_url = None + self._check_job = None ## Callback for the message that is spawned when there is a new version. def _onActionTriggered(self, message, action): @@ -51,6 +53,9 @@ class FirmwareUpdateChecker(Extension): if isinstance(container, GlobalStack): self.checkFirmwareVersion(container, True) + def _onJobFinished(self, *args, **kwargs): + self._check_job = None + ## Connect with software.ultimaker.com, load latest.version and check version info. # If the version info is different from the current version, spawn a message to # allow the user to download it. @@ -58,7 +63,13 @@ class FirmwareUpdateChecker(Extension): # \param silent type(boolean) Suppresses messages other than "new version found" messages. # This is used when checking for a new firmware version at startup. def checkFirmwareVersion(self, container = None, silent = False): - job = FirmwareUpdateCheckerJob(container = container, silent = silent, url = self.JEDI_VERSION_URL, - callback = self._onActionTriggered, - set_download_url_callback = self._onSetDownloadUrl) - job.start() + # Do not run multiple check jobs in parallel + if self._check_job is not None: + Logger.log("i", "A firmware update check is already running, do nothing.") + return + + self._check_job = FirmwareUpdateCheckerJob(container = container, silent = silent, url = self.JEDI_VERSION_URL, + callback = self._onActionTriggered, + set_download_url_callback = self._onSetDownloadUrl) + self._check_job.start() + self._check_job.finished.connect(self._onJobFinished) From 79fb1bb2bddbef35c8fb6b661838cfc6f7b8b2ee Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 8 Jun 2018 11:47:07 +0200 Subject: [PATCH 3/3] Correction to translation of Retraction Extra Prime Amount Thanks to @getget1980. Fixes #3789. --- resources/i18n/fr_FR/fdmprinter.def.json.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/i18n/fr_FR/fdmprinter.def.json.po b/resources/i18n/fr_FR/fdmprinter.def.json.po index 581c1ee054..97b197c138 100644 --- a/resources/i18n/fr_FR/fdmprinter.def.json.po +++ b/resources/i18n/fr_FR/fdmprinter.def.json.po @@ -1998,7 +1998,7 @@ msgstr "La vitesse à laquelle le filament est préparé pendant une rétraction #: fdmprinter.def.json msgctxt "retraction_extra_prime_amount label" msgid "Retraction Extra Prime Amount" -msgstr "Degré supplémentaire de rétraction primaire" +msgstr "Volume supplémentaire à l'amorçage" #: fdmprinter.def.json msgctxt "retraction_extra_prime_amount description"