QmlDesigner: Fix JavaScript wizard

The old wizard syntax stopped working. Using QML file wizard as
template.

Task-number: QDS-12520
Change-Id: Ib188f898c28be8b7ad9284f431ef0526fbc7bf7e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Thomas Hartmann
2024-04-25 15:15:58 +02:00
parent fa86d63188
commit d6065db983

View File

@@ -9,13 +9,46 @@
"icon": "file_javascript.png", "icon": "file_javascript.png",
"platformIndependent": true, "platformIndependent": true,
"options":
[
{ "key": "JSFile", "value": "%{Class}.%{JS: Util.preferredSuffix('application/javascript')}" },
{ "key": "ApplicationImport", "value": "%{QmlProjectName} 1.0" },
{ "key": "RootItem", "value": "%{JS: %{RootItemCB}.RootItem}" },
{ "key": "UseImportDefault", "value": "%{JS: false}" },
{ "key": "UseQtQuickControls2Default", "value": "%{JS: true}" }
],
"pages" : "pages" :
[ [
{ {
"trDisplayName": "Location", "trDisplayName": "Define Class",
"trShortTitle": "Location", "trShortTitle": "Details",
"typeId": "File" "typeId": "Fields",
"data" :
[
{
"name": "Class",
"trDisplayName": "Component name:",
"mandatory": true,
"type": "LineEdit",
"data": {
"validator": "(?:[A-Z_][a-zA-Z_0-9]*|)",
"fixup": "%{JS: '%{INPUT}'.charAt(0).toUpperCase() + '%{INPUT}'.slice(1) }"
}
},
{
"name": "TargetPath",
"type": "PathChooser",
"trDisplayName": "Path:",
"mandatory": true,
"data":
{
"kind": "existingDirectory",
"basePath": "%{InitialPath}",
"path": "%{InitialPath}"
}
}
]
}, },
{ {
"trDisplayName": "Options", "trDisplayName": "Options",
@@ -34,21 +67,16 @@
} }
} }
] ]
},
{
"trDisplayName": "Project Management",
"trShortTitle": "Summary",
"typeId": "Summary"
} }
], ],
"generators" : "generators" :
[ [
{ {
"typeId": "File", "typeId": "File",
"data": "data":
{ {
"source": "file.js.tpl", "source": "file.js.tpl",
"target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('application/javascript')}')}", "target": "%{TargetPath}/%{JSFile}",
"openInEditor": true "openInEditor": true
} }
} }