From 3a7a1dbc6d935b94e4c9b080259618f2f55551bf Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 7 Jun 2018 12:51:52 +0200 Subject: [PATCH] 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 cc47dfca80..90241c6e72 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 e8f832a733..5e12d3f1b9 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