blob: 435b93e92167b5c87befdea1b9261e2435b58209 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/** \class FileCreatePart
FileCreatePart is a template manager and wizard system to assist with creation of new files.
Assists with creation of new files.
For those who want to look beyond the GUI, the following illustrates the XML to configure the FileCreate part for a project. It simply consists of a list of filetypes that the user may wish to create for a particular project. At present, the "create" attribute is ignored.
The file create part looks for a file template called \@ext (i.e. the value of the ext attribute) in the *project's* templates directory (see the PyQT appwizard template for an example).
For subtypes, it looks for a template called \@ext-\@ref, so in the example below the following files would need to be present in the project's templates directory:
<code>
py
ui
ui-dialog
ui-mainwin
</code>
Example XML:
<code>
\verbatim
<kdevfilecreate>
<filetypes>
<type ext="py" name="Python" create="template"/>
<type ext="ui" name="QT Designer" create="template">
<subtype ref="dialog" name="Dialog"/>
<subtype ref="mainwin" name="Main window"/>
</type>
</filetypes>
</kdevfilecreate>
\endverbatim
</code>
You can also use global template definitions supplied with the FileCreate part:
<code>
\verbatim
<kdevfilecreate>
<useglobaltypes>
<type ext="ui" />
</useglobaltypes>
<filetypes>
<type ext="py" name="Python" create="template"/>
</filetypes>
</kdevfilecreate>
\endverbatim
</code>
If a type has subtypes, and no subtypes are specified, then all subtypes are assumed to be required (as in the example above). Otherwise, specific subtypes should be specified:
<code>
\verbatim
<useglobaltypes>
<type ext="ui">
<subtype ref="dialog"/>
</type>
</useglobaltypes>
\endverbatim
</code>
Usually, this XML forms part of the base .kdevelop file created by the appwizard.
\authors <a href="mailto:kde AT jrockey.com">Julian Rockey</a>
\authors <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a>
\maintainer <a href="mailto:kde AT jrockey.com">Julian Rockey</a>
\feature friendly sidebar listing the types of new file that can be created for your project
\feature configurable per-project file types and global file types
\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=tdevelop&component=file+create&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">file create component at Bugzilla database</a>
\bug Arrangement of text in sidebar is not always perfect
*/
|