mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
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.
This commit is contained in:
parent
8202b62343
commit
3a7a1dbc6d
2 changed files with 6 additions and 3 deletions
|
@ -86,7 +86,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
|
|
||||||
MimeTypeDatabase.addMimeType(
|
MimeTypeDatabase.addMimeType(
|
||||||
MimeType(
|
MimeType(
|
||||||
name="application/x-cura-project-file",
|
name="application/x-curaproject+xml",
|
||||||
comment="Cura Project File",
|
comment="Cura Project File",
|
||||||
suffixes=["curaproject.3mf"]
|
suffixes=["curaproject.3mf"]
|
||||||
)
|
)
|
||||||
|
|
|
@ -139,13 +139,15 @@ UM.MainWindow
|
||||||
text: catalog.i18nc("@title:menu menubar:file","Save &Project...")
|
text: catalog.i18nc("@title:menu menubar:file","Save &Project...")
|
||||||
onTriggered:
|
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"))
|
if(UM.Preferences.getValue("cura/dialog_on_project_save"))
|
||||||
{
|
{
|
||||||
|
saveWorkspaceDialog.args = args;
|
||||||
saveWorkspaceDialog.open()
|
saveWorkspaceDialog.open()
|
||||||
}
|
}
|
||||||
else
|
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
|
WorkspaceSummaryDialog
|
||||||
{
|
{
|
||||||
id: saveWorkspaceDialog
|
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
|
Connections
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue