Calculate file name directly in QML

CURA-12138
This commit is contained in:
Erwan MATHIEU 2024-09-27 12:17:34 +02:00
parent 6313e9cc48
commit 8d2bef86d6
2 changed files with 3 additions and 9 deletions

View file

@ -554,15 +554,16 @@ Item
Action
{
id: exportProjectForSupportAction
text: catalog.i18nc("@action:inmenu menubar:help","Export Project For Support")
text: catalog.i18nc("@action:inmenu menubar:help", "Export Project For Support")
onTriggered:
{
var exportName = CuraActions.supportProjectTag()
var exportName = Qt.formatDateTime(new Date(), "'export-'yyyyMMdd-HHmmss")
var args = {
"filter_by_machine": false,
"file_type": "workspace",
"preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml",
"limit_mimetypes": ["application/vnd.ms-package.3dmanufacturing-3dmodel+xml"],
"silent_save": true,
};
UM.OutputDeviceManager.requestWriteToDevice("local_file", exportName, args)
}