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:
Lipu Fei 2018-06-07 12:51:52 +02:00
parent 8202b62343
commit 3a7a1dbc6d
2 changed files with 6 additions and 3 deletions

View file

@ -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"]
)

View file

@ -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