forked from qt-creator/qt-creator
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:
@@ -9,13 +9,46 @@
|
||||
"icon": "file_javascript.png",
|
||||
"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" :
|
||||
[
|
||||
{
|
||||
"trDisplayName": "Location",
|
||||
"trShortTitle": "Location",
|
||||
"typeId": "File"
|
||||
"trDisplayName": "Define Class",
|
||||
"trShortTitle": "Details",
|
||||
"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",
|
||||
@@ -34,11 +67,6 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"trDisplayName": "Project Management",
|
||||
"trShortTitle": "Summary",
|
||||
"typeId": "Summary"
|
||||
}
|
||||
],
|
||||
"generators" :
|
||||
@@ -48,7 +76,7 @@
|
||||
"data":
|
||||
{
|
||||
"source": "file.js.tpl",
|
||||
"target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('application/javascript')}')}",
|
||||
"target": "%{TargetPath}/%{JSFile}",
|
||||
"openInEditor": true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user