mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 21:44:01 -06:00
Calculate file name directly in QML
CURA-12138
This commit is contained in:
parent
6313e9cc48
commit
8d2bef86d6
2 changed files with 3 additions and 9 deletions
|
@ -32,8 +32,6 @@ from cura.Operations.SetBuildPlateNumberOperation import SetBuildPlateNumberOper
|
|||
from UM.Logger import Logger
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
class CuraActions(QObject):
|
||||
def __init__(self, parent: QObject = None) -> None:
|
||||
super().__init__(parent)
|
||||
|
@ -282,8 +280,3 @@ class CuraActions(QObject):
|
|||
|
||||
def _openUrl(self, url: QUrl) -> None:
|
||||
QDesktopServices.openUrl(url)
|
||||
|
||||
@pyqtSlot(result=str)
|
||||
def supportProjectTag(self) -> str:
|
||||
timestamp = datetime.now().strftime("%Y%m%d-%H%M%S")
|
||||
return f"exported-project-for-support-{timestamp}"
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue