Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API area selector in test template
- Loading branch information
Showing
1 changed file
with
111 additions
and
86 deletions.
There are no files selected for viewing
197 changes: 111 additions & 86 deletions
197
editors/QtCreator/templates/wizards/qgis/qgis_test/wizard.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,111 @@ | ||
{ | ||
"version": 1, | ||
"supportedProjectTypes": [ ], | ||
"id": "B.QGISTest", | ||
"category": "O.QGIS", | ||
"trDescription": "Creates a C++ QGIS Test", | ||
"trDisplayName": "QGIS C++ Test", | ||
"trDisplayCategory": "QGIS", | ||
"icon": "../qgis_icon.svg", | ||
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", | ||
"platformIndependent" : true, | ||
|
||
"options": | ||
[ | ||
{ "key": "TargetPath", "value": "Test%{Path}" }, | ||
{ "key": "SrcPath", "value": "%{Path}/%{SrcFileName}" }, | ||
{ "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" } | ||
], | ||
|
||
"pages": | ||
[ | ||
{ | ||
"trDisplayName": "Define Tests", | ||
"trShortTitle": "Details", | ||
"typeId": "Fields", | ||
"data" : | ||
[ | ||
{ | ||
"name": "Class", | ||
"trDisplayName": "Class name:", | ||
"mandatory": true, | ||
"type": "LineEdit", | ||
"data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)" } | ||
}, | ||
{ | ||
"name": "Sp1", | ||
"type": "Spacer", | ||
"data": { "factor": 2 } | ||
}, | ||
{ | ||
"name": "SrcFileName", | ||
"type": "LineEdit", | ||
"trDisplayName": "Source file:", | ||
"mandatory": true, | ||
"data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" } | ||
}, | ||
{ | ||
"name": "Path", | ||
"type": "PathChooser", | ||
"trDisplayName": "Path:", | ||
"mandatory": true, | ||
"data": | ||
{ | ||
"kind": "existingDirectory", | ||
"basePath": "%{CurrentProject:Path}\\tests\\src\\", | ||
"path": "%{CurrentProject:Path}\\tests\\src\\" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"trDisplayName": "Project Management", | ||
"trShortTitle": "Summary", | ||
"typeId": "Summary" | ||
} | ||
], | ||
|
||
"generators": | ||
[ | ||
{ | ||
"typeId": "File", | ||
"data": | ||
[ | ||
{ | ||
"source": "file.cpp", | ||
"target": "%{SrcPath}", | ||
"openInEditor": true, | ||
"options": [ | ||
{ "key": "Cpp:License:FileName", "value": "%{SrcFileName}" }, | ||
{ "key": "Cpp:License:ClassName", "value": "%{CN}" } | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
{ | ||
"version": 1, | ||
"supportedProjectTypes": [ ], | ||
"id": "B.QGISTest", | ||
"category": "O.QGIS", | ||
"trDescription": "Creates a C++ QGIS Test", | ||
"trDisplayName": "QGIS C++ Test", | ||
"trDisplayCategory": "QGIS", | ||
"icon": "../qgis_icon.svg", | ||
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", | ||
"platformIndependent" : true, | ||
|
||
"options": | ||
[ | ||
{ "key": "TargetPath", "value": "Test%{Path}" }, | ||
{ "key": "SrcPath", "value": "%{Path}/%{Area}/%{SrcFileName}" }, | ||
{ "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" } | ||
], | ||
|
||
"pages": | ||
[ | ||
{ | ||
"trDisplayName": "Define Tests", | ||
"trShortTitle": "Details", | ||
"typeId": "Fields", | ||
"data" : | ||
[ | ||
{ | ||
"name": "Class", | ||
"trDisplayName": "Class name:", | ||
"mandatory": true, | ||
"type": "LineEdit", | ||
"data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)" } | ||
}, | ||
{ | ||
"name": "Area", | ||
"trDisplayName": "API Area", | ||
"type": "ComboBox", | ||
"data": | ||
{ | ||
"items": [ | ||
"analysis", | ||
"app", | ||
"core", | ||
"gui", | ||
"providers" | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "Sp1", | ||
"type": "Spacer", | ||
"data": { "factor": 2 } | ||
}, | ||
{ | ||
"name": "LabelQQC_1_0", | ||
"type": "Label", | ||
"span": true, | ||
"data": | ||
{ | ||
"wordWrap": true, | ||
"trText": "Area selected above will be added to the final path to put the test in the correct location. You shouldn't need to change anything in here generally." | ||
} | ||
}, | ||
{ | ||
"name": "SrcFileName", | ||
"type": "LineEdit", | ||
"trDisplayName": "Source file:", | ||
"mandatory": true, | ||
"data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" } | ||
}, | ||
{ | ||
"name": "Path", | ||
"type": "PathChooser", | ||
"trDisplayName": "Path:", | ||
"mandatory": true, | ||
"data": | ||
{ | ||
"kind": "existingDirectory", | ||
"basePath": "%{CurrentProject:Path}/tests/src/", | ||
"path": "%{CurrentProject:Path}/tests/src/" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"trDisplayName": "Project Management", | ||
"trShortTitle": "Summary", | ||
"typeId": "Summary" | ||
} | ||
], | ||
|
||
"generators": | ||
[ | ||
{ | ||
"typeId": "File", | ||
"data": | ||
[ | ||
{ | ||
"source": "file.cpp", | ||
"target": "%{SrcPath}", | ||
"openInEditor": true, | ||
"options": [ | ||
{ "key": "Cpp:License:FileName", "value": "%{SrcFileName}" }, | ||
{ "key": "Cpp:License:ClassName", "value": "%{CN}" } | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |