From 61827510c068180059bf388bc9f3a418b3571e81 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 29 Aug 2023 16:59:25 +0200 Subject: [PATCH] QmlDesigner: Add SCXML wizard to QDS The wizard is only active if the plugin is actually enabled. Task-number: QDS-10507 Change-Id: I0a41deaa22745db90c3ec04a35109694a2fbc79c Reviewed-by: Unseon Ryu Reviewed-by: Thomas Hartmann --- .../studio_templates/files/scxml/file.scxml | 3 + .../studio_templates/files/scxml/wizard.json | 66 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 share/qtcreator/qmldesigner/studio_templates/files/scxml/file.scxml create mode 100644 share/qtcreator/qmldesigner/studio_templates/files/scxml/wizard.json diff --git a/share/qtcreator/qmldesigner/studio_templates/files/scxml/file.scxml b/share/qtcreator/qmldesigner/studio_templates/files/scxml/file.scxml new file mode 100644 index 00000000000..960867a73f4 --- /dev/null +++ b/share/qtcreator/qmldesigner/studio_templates/files/scxml/file.scxml @@ -0,0 +1,3 @@ + + + diff --git a/share/qtcreator/qmldesigner/studio_templates/files/scxml/wizard.json b/share/qtcreator/qmldesigner/studio_templates/files/scxml/wizard.json new file mode 100644 index 00000000000..36bbda7b71e --- /dev/null +++ b/share/qtcreator/qmldesigner/studio_templates/files/scxml/wizard.json @@ -0,0 +1,66 @@ +{ + "version": 1, + "supportedProjectTypes": [ ], + "id": "F.Scxml", + "category": "O.Model", + "trDescription": "Creates a new empty state chart.", + "trDisplayName": "State Chart", + "trDisplayCategory": "Modeling", + "iconText": "scxml", + "platformIndependent": true, + "enabled": "%{JS: value('Plugins').indexOf('ScxmlEditor') >= 0}", + + "options": + [ + { "key": "TargetPath", "value": "%{JS: Util.fileName(value('Location') + '/' + value('FileName'), Util.preferredSuffix('application/scxml+xml'))}" }, + { "key": "FileName", "value": "%{Name}" } + ], + + "pages" : + [ + { + "trDisplayName": "State Chart Name and Location", + "trShortTitle": "Location", + "typeId": "Fields", + "data": + [ + { + "name": "Name", + "trDisplayName": "State chart name:", + "mandatory": true, + "type": "LineEdit" + }, + { + "name": "Location", + "trDisplayName": "Location:", + "type": "PathChooser", + "isComplete": "%{JS: value('Location') === '' || !Util.exists(value('TargetPath'))}", + "trIncompleteMessage": "\"%{JS: Util.toNativeSeparators(value('TargetPath'))}\" exists in the filesystem.", + "data": + { + "kind": "directory", + "basePath": "%{InitialPath}", + "path": "%{InitialPath}" + } + } + ] + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators" : + [ + { + "typeId": "File", + "data": + { + "source": "file.scxml", + "target": "%{TargetPath}", + "openInEditor": true + } + } + ] +}