From c48a5474f0f0e51945d9783839e0d5d0eee338df Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 29 Aug 2018 13:42:26 +0200 Subject: [PATCH 1/2] remove .curaproject from the extensions and just use .3mf CURA-5650 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 4 +--- plugins/3MFReader/__init__.py | 6 +----- plugins/3MFWriter/__init__.py | 6 +----- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 16ab22473b..685f3091e2 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -89,7 +89,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader): MimeType( name="application/x-curaproject+xml", comment="Cura Project File", - suffixes=["curaproject.3mf"] + suffixes=["3mf"] ) ) @@ -726,8 +726,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader): nodes = [] base_file_name = os.path.basename(file_name) - if base_file_name.endswith(".curaproject.3mf"): - base_file_name = base_file_name[:base_file_name.rfind(".curaproject.3mf")] self.setWorkspaceName(base_file_name) return nodes diff --git a/plugins/3MFReader/__init__.py b/plugins/3MFReader/__init__.py index 3a4fde4ab8..ce94bbe69c 100644 --- a/plugins/3MFReader/__init__.py +++ b/plugins/3MFReader/__init__.py @@ -18,11 +18,7 @@ catalog = i18nCatalog("cura") def getMetaData() -> Dict: - # Workaround for osx not supporting double file extensions correctly. - if Platform.isOSX(): - workspace_extension = "3mf" - else: - workspace_extension = "curaproject.3mf" + workspace_extension = "3mf" metaData = {} if "3MFReader.ThreeMFReader" in sys.modules: diff --git a/plugins/3MFWriter/__init__.py b/plugins/3MFWriter/__init__.py index e779628f7e..29e2beae60 100644 --- a/plugins/3MFWriter/__init__.py +++ b/plugins/3MFWriter/__init__.py @@ -15,11 +15,7 @@ from UM.Platform import Platform i18n_catalog = i18nCatalog("uranium") def getMetaData(): - # Workarround for osx not supporting double file extensions correctly. - if Platform.isOSX(): - workspace_extension = "3mf" - else: - workspace_extension = "curaproject.3mf" + workspace_extension = "3mf" metaData = {} From baef0350cdf931a8365272b86e42233740c99541 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 29 Aug 2018 14:41:38 +0200 Subject: [PATCH 2/2] Cleaned up MIME types --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 8 -------- plugins/3MFWriter/__init__.py | 2 +- resources/qml/Cura.qml | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 685f3091e2..6d55e0643d 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -85,14 +85,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader): def __init__(self) -> None: super().__init__() - MimeTypeDatabase.addMimeType( - MimeType( - name="application/x-curaproject+xml", - comment="Cura Project File", - suffixes=["3mf"] - ) - ) - self._supported_extensions = [".3mf"] self._dialog = WorkspaceDialog() self._3mf_mesh_reader = None diff --git a/plugins/3MFWriter/__init__.py b/plugins/3MFWriter/__init__.py index 29e2beae60..4b8a03888d 100644 --- a/plugins/3MFWriter/__init__.py +++ b/plugins/3MFWriter/__init__.py @@ -32,7 +32,7 @@ def getMetaData(): "output": [{ "extension": workspace_extension, "description": i18n_catalog.i18nc("@item:inlistbox", "Cura Project 3MF file"), - "mime_type": "application/x-curaproject+xml", + "mime_type": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml", "mode": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter.OutputMode.BinaryMode }] } diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 33e456c758..616523fc45 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -120,7 +120,7 @@ UM.MainWindow text: catalog.i18nc("@title:menu menubar:file","Save...") onTriggered: { - var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/x-curaproject+xml" }; + var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" }; if(UM.Preferences.getValue("cura/dialog_on_project_save")) { saveWorkspaceDialog.args = args;