mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 07:25:58 +08:00
Merge pull request #4300 from Ultimaker/remove_double_extensions_cura_5650
change .curaproject.3mf to just use .3mf
This commit is contained in:
commit
0488494537
@ -85,14 +85,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
MimeTypeDatabase.addMimeType(
|
|
||||||
MimeType(
|
|
||||||
name="application/x-curaproject+xml",
|
|
||||||
comment="Cura Project File",
|
|
||||||
suffixes=["curaproject.3mf"]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
self._supported_extensions = [".3mf"]
|
self._supported_extensions = [".3mf"]
|
||||||
self._dialog = WorkspaceDialog()
|
self._dialog = WorkspaceDialog()
|
||||||
self._3mf_mesh_reader = None
|
self._3mf_mesh_reader = None
|
||||||
@ -726,8 +718,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||||||
nodes = []
|
nodes = []
|
||||||
|
|
||||||
base_file_name = os.path.basename(file_name)
|
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)
|
self.setWorkspaceName(base_file_name)
|
||||||
return nodes
|
return nodes
|
||||||
|
|
||||||
|
@ -18,11 +18,7 @@ catalog = i18nCatalog("cura")
|
|||||||
|
|
||||||
|
|
||||||
def getMetaData() -> Dict:
|
def getMetaData() -> Dict:
|
||||||
# Workaround for osx not supporting double file extensions correctly.
|
workspace_extension = "3mf"
|
||||||
if Platform.isOSX():
|
|
||||||
workspace_extension = "3mf"
|
|
||||||
else:
|
|
||||||
workspace_extension = "curaproject.3mf"
|
|
||||||
|
|
||||||
metaData = {}
|
metaData = {}
|
||||||
if "3MFReader.ThreeMFReader" in sys.modules:
|
if "3MFReader.ThreeMFReader" in sys.modules:
|
||||||
|
@ -15,11 +15,7 @@ from UM.Platform import Platform
|
|||||||
i18n_catalog = i18nCatalog("uranium")
|
i18n_catalog = i18nCatalog("uranium")
|
||||||
|
|
||||||
def getMetaData():
|
def getMetaData():
|
||||||
# Workarround for osx not supporting double file extensions correctly.
|
workspace_extension = "3mf"
|
||||||
if Platform.isOSX():
|
|
||||||
workspace_extension = "3mf"
|
|
||||||
else:
|
|
||||||
workspace_extension = "curaproject.3mf"
|
|
||||||
|
|
||||||
metaData = {}
|
metaData = {}
|
||||||
|
|
||||||
@ -36,7 +32,7 @@ def getMetaData():
|
|||||||
"output": [{
|
"output": [{
|
||||||
"extension": workspace_extension,
|
"extension": workspace_extension,
|
||||||
"description": i18n_catalog.i18nc("@item:inlistbox", "Cura Project 3MF file"),
|
"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
|
"mode": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter.OutputMode.BinaryMode
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ UM.MainWindow
|
|||||||
text: catalog.i18nc("@title:menu menubar:file","Save...")
|
text: catalog.i18nc("@title:menu menubar:file","Save...")
|
||||||
onTriggered:
|
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"))
|
if(UM.Preferences.getValue("cura/dialog_on_project_save"))
|
||||||
{
|
{
|
||||||
saveWorkspaceDialog.args = args;
|
saveWorkspaceDialog.args = args;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user