Commit 83fc120e authored by Dimitri van Heesch's avatar Dimitri van Heesch

Minor changes to the way the code for config options is generated (thanks to Albert for the patch)

parent e2597756
...@@ -15,4 +15,13 @@ bool parseConfig( ...@@ -15,4 +15,13 @@ bool parseConfig(
void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s); void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s);
// directly copied from ../../src/config.h to be consistent
enum
{
/*! Maximum length of an option in the config file. Used for
* alignment purposes.
*/
MAX_OPTION_LENGTH = 23
};
#endif #endif
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -112,7 +112,8 @@ void Expert::createTopics(const QDomElement &rootElem) ...@@ -112,7 +112,8 @@ void Expert::createTopics(const QDomElement &rootElem)
{ {
if (childElem.tagName()==SA("group")) if (childElem.tagName()==SA("group"))
{ {
QString name = childElem.attribute(SA("name")); // Remove _ from a group name like: Source_Browser
QString name = childElem.attribute(SA("name")).replace(SA("_"),SA(" "));
items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(name))); items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(name)));
QWidget *widget = createTopicWidget(childElem); QWidget *widget = createTopicWidget(childElem);
m_topics[name] = widget; m_topics[name] = widget;
...@@ -144,7 +145,7 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -144,7 +145,7 @@ static QString getDocsForNode(const QDomElement &child)
QDomText t = n.toText(); QDomText t = n.toText();
if (!t.isNull()) docs+=t.data(); if (!t.isNull()) docs+=t.data();
} }
docs+=SA("<br/>"); docs += SA("<br/>");
} }
docsVal = docsVal.nextSiblingElement(); docsVal = docsVal.nextSiblingElement();
} }
...@@ -152,6 +153,7 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -152,6 +153,7 @@ static QString getDocsForNode(const QDomElement &child)
// for an enum we list the values // for an enum we list the values
if (type==SA("enum")) if (type==SA("enum"))
{ {
docs += SA("<br/>");
docs += SA("Possible values are: "); docs += SA("Possible values are: ");
int numValues=0; int numValues=0;
docsVal = child.firstChildElement(); docsVal = child.firstChildElement();
...@@ -192,29 +194,35 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -192,29 +194,35 @@ static QString getDocsForNode(const QDomElement &child)
docsVal = docsVal.nextSiblingElement(); docsVal = docsVal.nextSiblingElement();
} }
docs+=SA("<br/>"); docs+=SA("<br/>");
docs+=SA("The default value is: <code>")+ docs+=SA("<br/>");
docs+=SA(" The default value is: <code>")+
child.attribute(SA("defval"))+ child.attribute(SA("defval"))+
SA("</code>."); SA("</code>.");
docs+= SA("<br/>");
} }
else if (type==SA("int")) else if (type==SA("int"))
{ {
docs+=SA("<br/>");
docs+=SA("Minimum value: ")+child.attribute(SA("minval"))+SA(", "); docs+=SA("Minimum value: ")+child.attribute(SA("minval"))+SA(", ");
docs+=SA("maximum value: ")+child.attribute(SA("maxval"))+SA(", "); docs+=SA("maximum value: ")+child.attribute(SA("maxval"))+SA(", ");
docs+=SA("default value: ")+child.attribute(SA("defval"))+SA("."); docs+=SA("default value: ")+child.attribute(SA("defval"))+SA(".");
docs+= SA("<br/>");
} }
else if (type==SA("bool")) else if (type==SA("bool"))
{ {
docs+=SA("<br/>");
if (child.hasAttribute(SA("altdefval"))) if (child.hasAttribute(SA("altdefval")))
{ {
docs+=SA("The default value is: system dependent."); docs+=SA(" The default value is: system dependent.");
} }
else else
{ {
QString defval = child.attribute(SA("defval")); QString defval = child.attribute(SA("defval"));
docs+=SA("The default value is: <code>")+ docs+=SA(" The default value is: <code>")+
(defval==SA("1")?SA("YES"):SA("NO"))+ (defval==SA("1")?SA("YES"):SA("NO"))+
SA("</code>."); SA("</code>.");
} }
docs+= SA("<br/>");
} }
else if (type==SA("list")) else if (type==SA("list"))
{ {
...@@ -226,7 +234,12 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -226,7 +234,12 @@ static QString getDocsForNode(const QDomElement &child)
{ {
if (docsVal.tagName()==SA("value")) if (docsVal.tagName()==SA("value"))
{ {
if (docsVal.attribute(SA("name"))!=SA("")) numValues++; QString showDocu = SA("");
if (docsVal.hasAttribute(SA("show_docu")))
{
showDocu = docsVal.attribute(SA("show_docu")).toLower();
}
if ((showDocu != SA("no")) && (docsVal.attribute(SA("name"))!=SA(""))) numValues++;
} }
docsVal = docsVal.nextSiblingElement(); docsVal = docsVal.nextSiblingElement();
} }
...@@ -238,29 +251,38 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -238,29 +251,38 @@ static QString getDocsForNode(const QDomElement &child)
{ {
if (docsVal.tagName()==SA("value")) if (docsVal.tagName()==SA("value"))
{ {
i++; QString showDocu = SA("");
docs += SA("<code>") + docsVal.attribute(SA("name")) + SA("</code>"); if (docsVal.hasAttribute(SA("show_docu")))
QString desc = docsVal.attribute(SA("desc"));
if (desc != SA(""))
{
docs += SA(" ") + desc;
}
if (i==numValues-1)
{ {
docs += SA(" and "); showDocu = docsVal.attribute(SA("show_docu")).toLower();
} }
else if (i==numValues) if ((showDocu != SA("no")) && (docsVal.attribute(SA("name"))!=SA("")))
{ {
docs += SA("."); i++;
} docs += SA("<code>") + docsVal.attribute(SA("name")) + SA("</code>");
else QString desc = docsVal.attribute(SA("desc"));
{ if (desc != SA(""))
docs += SA(", "); {
docs += SA(" ") + desc;
}
if (i==numValues-1)
{
docs += SA(" and ");
}
else if (i==numValues)
{
docs += SA(".");
}
else
{
docs += SA(", ");
}
} }
} }
docsVal = docsVal.nextSiblingElement(); docsVal = docsVal.nextSiblingElement();
} }
} }
// docs+= SA("<br/>");
} }
} }
else if (type==SA("string")) else if (type==SA("string"))
...@@ -270,7 +292,9 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -270,7 +292,9 @@ static QString getDocsForNode(const QDomElement &child)
{ {
if (defval != SA("")) if (defval != SA(""))
{ {
docs += SA("The default directory is: <code>") + defval + SA("</code>."); docs+=SA("<br/>");
docs += SA(" The default directory is: <code>") + defval + SA("</code>.");
docs += SA("<br/>");
} }
} }
else if (child.attribute(SA("format")) == SA("file")) else if (child.attribute(SA("format")) == SA("file"))
...@@ -278,20 +302,24 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -278,20 +302,24 @@ static QString getDocsForNode(const QDomElement &child)
QString abspath = child.attribute(SA("abspath")); QString abspath = child.attribute(SA("abspath"));
if (defval != SA("")) if (defval != SA(""))
{ {
docs+=SA("<br/>");
if (abspath != SA("1")) if (abspath != SA("1"))
{ {
docs += SA("The default file is: <code>") + defval + SA("</code>."); docs += SA(" The default file is: <code>") + defval + SA("</code>.");
} }
else else
{ {
docs += SA("The default file (with absolute path) is: <code>") + defval + SA("</code>."); docs += SA(" The default file (with absolute path) is: <code>") + defval + SA("</code>.");
} }
docs += SA("<br/>");
} }
else else
{ {
if (abspath == SA("1")) if (abspath == SA("1"))
{ {
docs += SA("The file has to be specified with full path."); docs+=SA("<br/>");
docs += SA(" The file has to be specified with full path.");
docs += SA("<br/>");
} }
} }
} }
...@@ -299,7 +327,9 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -299,7 +327,9 @@ static QString getDocsForNode(const QDomElement &child)
{ {
if (defval != SA("")) if (defval != SA(""))
{ {
docs += SA("The default value is: <code>") + defval + SA("</code>."); docs+=SA("<br/>");
docs += SA(" The default value is: <code>") + defval + SA("</code>.");
docs += SA("<br/>");
} }
} }
} }
...@@ -307,8 +337,8 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -307,8 +337,8 @@ static QString getDocsForNode(const QDomElement &child)
if (child.hasAttribute(SA("depends"))) if (child.hasAttribute(SA("depends")))
{ {
QString dependsOn = child.attribute(SA("depends")); QString dependsOn = child.attribute(SA("depends"));
docs += SA("<br/>"); docs+=SA("<br/>");
docs+= SA("This tag requires that the tag \\ref cfg_"); docs+= SA(" This tag requires that the tag \\ref cfg_");
docs+= dependsOn.toLower(); docs+= dependsOn.toLower();
docs+= SA(" \""); docs+= SA(" \"");
docs+= dependsOn.toUpper(); docs+= dependsOn.toUpper();
...@@ -324,13 +354,22 @@ static QString getDocsForNode(const QDomElement &child) ...@@ -324,13 +354,22 @@ static QString getDocsForNode(const QDomElement &child)
// remove <br> at end // remove <br> at end
regexp.setPattern(SA("<br> *$")); regexp.setPattern(SA("<br> *$"));
docs.replace(regexp,SA(" ")); docs.replace(regexp,SA(" "));
// \c word -> <code>word</code> // \c word -> <code>word</code>; word ends with ')', ',', '.' or ' '
regexp.setPattern(SA("\\\\c[ ]+([^ \\)]+)\\)"));
docs.replace(regexp,SA("<code>\\1</code>)"));
regexp.setPattern(SA("\\\\c[ ]+([^ ,]+),"));
docs.replace(regexp,SA("<code>\\1</code>,"));
regexp.setPattern(SA("\\\\c[ ]+([^ \\.]+)\\."));
docs.replace(regexp,SA("<code>\\1</code>."));
regexp.setPattern(SA("\\\\c[ ]+([^ ]+) ")); regexp.setPattern(SA("\\\\c[ ]+([^ ]+) "));
docs.replace(regexp,SA("<code>\\1</code> ")); docs.replace(regexp,SA("<code>\\1</code> "));
// `word` -> <code>word</code> // `word` -> <code>word</code>
docs.replace(SA("``"),SA("")); docs.replace(SA("``"),SA(""));
regexp.setPattern(SA("`([^`]+)`")); regexp.setPattern(SA("`([^`]+)`"));
docs.replace(regexp,SA("<code>\\1</code> ")); docs.replace(regexp,SA("<code>\\1</code>"));
// \ref key "desc" -> <code>desc</code> // \ref key "desc" -> <code>desc</code>
regexp.setPattern(SA("\\\\ref[ ]+[^ ]+[ ]+\"([^ ]+)\"")); regexp.setPattern(SA("\\\\ref[ ]+[^ ]+[ ]+\"([^ ]+)\""));
docs.replace(regexp,SA("<code>\\1</code> ")); docs.replace(regexp,SA("<code>\\1</code> "));
...@@ -683,7 +722,7 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec, ...@@ -683,7 +722,7 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,
t << convertToComment(option->templateDocs()); t << convertToComment(option->templateDocs());
t << endl; t << endl;
} }
t << name.leftJustified(23) << "= "; t << name.leftJustified(MAX_OPTION_LENGTH) << "= ";
if (option) if (option)
{ {
option->writeValue(t,codec); option->writeValue(t,codec);
...@@ -744,9 +783,10 @@ void Expert::showHelp(Input *option) ...@@ -744,9 +783,10 @@ void Expert::showHelp(Input *option)
m_helper->setText( m_helper->setText(
QString::fromAscii("<qt><b>")+option->id()+ QString::fromAscii("<qt><b>")+option->id()+
QString::fromAscii("</b><br>")+ QString::fromAscii("</b><br>")+
QString::fromAscii("<br/>")+
option->docs(). option->docs().
replace(QChar::fromAscii('\n'),QChar::fromAscii(' '))+ replace(QChar::fromAscii('\n'),QChar::fromAscii(' '))+
QString::fromAscii("<qt>") QString::fromAscii("</qt>")
); );
m_inShowHelp = FALSE; m_inShowHelp = FALSE;
} }
......
This diff is collapsed.
...@@ -734,11 +734,11 @@ Go to the <a href="commands.html">next</a> section or return to the ...@@ -734,11 +734,11 @@ Go to the <a href="commands.html">next</a> section or return to the
entities in documentation are documented, even if no documentation was entities in documentation are documented, even if no documentation was
available. Private class members and static file members will be hidden available. Private class members and static file members will be hidden
unless the \ref cfg_extract_private "EXTRACT_PRIVATE" respectively unless the \ref cfg_extract_private "EXTRACT_PRIVATE" respectively
\ref cfg_extract_static "EXTRACT_STATIC" tags are set to \c YES \ref cfg_extract_static "EXTRACT_STATIC" tags are set to \c YES.
\note This will also disable the warnings about undocumented members \note This will also disable the warnings about undocumented members
that are normally produced when \ref cfg_warnings "WARNINGS" is that are normally produced when \ref cfg_warnings "WARNINGS" is
set to \c YES set to \c YES.
]]> ]]>
</docs> </docs>
</option> </option>
...@@ -1038,7 +1038,7 @@ Go to the <a href="commands.html">next</a> section or return to the ...@@ -1038,7 +1038,7 @@ Go to the <a href="commands.html">next</a> section or return to the
<![CDATA[ <![CDATA[
Set the \c SHOW_FILES tag to \c NO to disable the generation of the Files page. Set the \c SHOW_FILES tag to \c NO to disable the generation of the Files page.
This will remove the Files entry from the Quick Index and from the This will remove the Files entry from the Quick Index and from the
Folder Tree View (if specified). The default is \c YES. Folder Tree View (if specified).
]]> ]]>
</docs> </docs>
</option> </option>
...@@ -1047,7 +1047,7 @@ Go to the <a href="commands.html">next</a> section or return to the ...@@ -1047,7 +1047,7 @@ Go to the <a href="commands.html">next</a> section or return to the
<![CDATA[ <![CDATA[
Set the \c SHOW_NAMESPACES tag to \c NO to disable the generation of the Set the \c SHOW_NAMESPACES tag to \c NO to disable the generation of the
Namespaces page. This will remove the Namespaces entry from the Quick Index Namespaces page. This will remove the Namespaces entry from the Quick Index
and from the Folder Tree View (if specified). The default is \c YES. and from the Folder Tree View (if specified).
]]> ]]>
</docs> </docs>
</option> </option>
...@@ -1131,8 +1131,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" ...@@ -1131,8 +1131,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
<docs> <docs>
<![CDATA[ <![CDATA[
The \c QUIET tag can be used to turn on/off the messages that are generated The \c QUIET tag can be used to turn on/off the messages that are generated
to standard output by doxygen. Possible values are \c YES and \c NO, to standard output by doxygen. If \c QUIET is set to \c YES this implies that the messages are off.
where \c YES implies that the messages are off.
]]> ]]>
</docs> </docs>
</option> </option>
...@@ -1140,8 +1139,8 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" ...@@ -1140,8 +1139,8 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
<docs> <docs>
<![CDATA[ <![CDATA[
The \c WARNINGS tag can be used to turn on/off the warning messages that are The \c WARNINGS tag can be used to turn on/off the warning messages that are
generated to standard error (\c stderr) by doxygen. Possible values are \c YES and \c NO, generated to standard error (\c stderr) by doxygen. If \c WARNINGS is set to
where \c YES implies that the warnings are on. \c YES this implies that the warnings are on.
<br> <br>
\b Tip: Turn warnings on while writing the documentation. \b Tip: Turn warnings on while writing the documentation.
]]> ]]>
...@@ -1196,7 +1195,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" ...@@ -1196,7 +1195,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
<![CDATA[ <![CDATA[
The \c WARN_LOGFILE tag can be used to specify a file to which warning The \c WARN_LOGFILE tag can be used to specify a file to which warning
and error messages should be written. If left blank the output is written and error messages should be written. If left blank the output is written
to standard error (\c stderr). to standard error (`stderr`).
]]> ]]>
</docs> </docs>
</option> </option>
...@@ -1282,8 +1281,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" ...@@ -1282,8 +1281,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
<docs> <docs>
<![CDATA[ <![CDATA[
The \c RECURSIVE tag can be used to specify whether or not subdirectories The \c RECURSIVE tag can be used to specify whether or not subdirectories
should be searched for input files as well. Possible values are \c YES should be searched for input files as well.
and \c NO.
]]> ]]>
</docs> </docs>
</option> </option>
...@@ -1350,7 +1348,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" ...@@ -1350,7 +1348,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
blank all files are included. blank all files are included.
]]> ]]>
</docs> </docs>
<value name='*'/> <value name='*' show_docu='NO'/>
</option> </option>
<option type='bool' id='EXAMPLE_RECURSIVE' defval='0'> <option type='bool' id='EXAMPLE_RECURSIVE' defval='0'>
<docs> <docs>
...@@ -1829,7 +1827,6 @@ hr.footer { ...@@ -1829,7 +1827,6 @@ hr.footer {
see http://en.wikipedia.org/wiki/Hue for more information. see http://en.wikipedia.org/wiki/Hue for more information.
For instance the value 0 represents red, 60 is yellow, 120 is green, For instance the value 0 represents red, 60 is yellow, 120 is green,
180 is cyan, 240 is blue, 300 purple, and 360 is red again. 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
The allowed range is 0 to 359.
]]> ]]>
</docs> </docs>
</option> </option>
...@@ -2746,7 +2743,7 @@ front of it. ...@@ -2746,7 +2743,7 @@ front of it.
</docs> </docs>
</option> </option>
</group> </group>
<group name='DEF' docs='Configuration options for the AutoGen Definitions output'> <group name='AutoGen' docs='Configuration options for the AutoGen Definitions output'>
<option type='bool' id='GENERATE_AUTOGEN_DEF' defval='0'> <option type='bool' id='GENERATE_AUTOGEN_DEF' defval='0'>
<docs> <docs>
<![CDATA[ <![CDATA[
......
...@@ -73,6 +73,10 @@ def transformDocs(doc): ...@@ -73,6 +73,10 @@ def transformDocs(doc):
# <br> will be removed later on again, we need it here otherwise splitlines # <br> will be removed later on again, we need it here otherwise splitlines
# will filter the extra line. # will filter the extra line.
doc = doc.replace("<br>", "\n<br>\n") doc = doc.replace("<br>", "\n<br>\n")
# a dirty trick to go to the next line in Doxyfile documentation.
# <br/> will be removed later on again, we need it here otherwise splitlines
# will filter the line break.
doc = doc.replace("<br/>", "\n<br/>\n")
# #
doc = doc.splitlines() doc = doc.splitlines()
split_doc = [] split_doc = []
...@@ -82,7 +86,8 @@ def transformDocs(doc): ...@@ -82,7 +86,8 @@ def transformDocs(doc):
# and start string at next line # and start string at next line
docC = [] docC = []
for line in split_doc: for line in split_doc:
docC.append(line.strip().replace('\\', '\\\\'). if (line.strip() != "<br/>"):
docC.append(line.strip().replace('\\', '\\\\').
replace('"', '\\"').replace("<br>", "")) replace('"', '\\"').replace("<br>", ""))
return docC return docC
...@@ -93,11 +98,12 @@ def collectValues(node): ...@@ -93,11 +98,12 @@ def collectValues(node):
if (n.nodeName == "value"): if (n.nodeName == "value"):
if n.nodeType == Node.ELEMENT_NODE: if n.nodeType == Node.ELEMENT_NODE:
if n.getAttribute('name') != "": if n.getAttribute('name') != "":
name = "<code>" + n.getAttribute('name') + "</code>" if n.getAttribute('show_docu') != "NO":
desc = n.getAttribute('desc') name = "<code>" + n.getAttribute('name') + "</code>"
if (desc != ""): desc = n.getAttribute('desc')
name += " " + desc if (desc != ""):
values.append(name) name += " " + desc
values.append(name)
return values return values
...@@ -142,7 +148,7 @@ def prepCDocs(node): ...@@ -142,7 +148,7 @@ def prepCDocs(node):
doc += parseDocs(n) doc += parseDocs(n)
if (type == 'enum'): if (type == 'enum'):
values = collectValues(node) values = collectValues(node)
doc += "Possible values are: " doc += "<br/>Possible values are: "
rng = len(values) rng = len(values)
for i in range(rng): for i in range(rng):
val = values[i] val = values[i]
...@@ -153,19 +159,18 @@ def prepCDocs(node): ...@@ -153,19 +159,18 @@ def prepCDocs(node):
else: else:
doc += "%s, " % (val) doc += "%s, " % (val)
if (defval != ""): if (defval != ""):
doc += "<br>" doc += "<br/>The default value is: <code>%s</code>." % (defval)
doc += "The default value is: <code>%s</code>." % (defval)
elif (type == 'int'): elif (type == 'int'):
minval = node.getAttribute('minval') minval = node.getAttribute('minval')
maxval = node.getAttribute('maxval') maxval = node.getAttribute('maxval')
doc += "%s: %s, %s: %s, %s: %s." % (" Minimum value", minval, doc += "<br/>%s: %s, %s: %s, %s: %s." % (" Minimum value", minval,
"maximum value", maxval, "maximum value", maxval,
"default value", defval) "default value", defval)
elif (type == 'bool'): elif (type == 'bool'):
if (node.hasAttribute('altdefval')): if (node.hasAttribute('altdefval')):
doc += "%s: %s." % ("Default value", "system dependent") doc += "<br/>%s: %s." % ("The default value is", "system dependent")
else: else:
doc += "%s: %s." % ("Default value", "YES" if (defval == "1") else "NO") doc += "<br/>%s: %s." % ("The default value is", "YES" if (defval == "1") else "NO")
elif (type == 'list'): elif (type == 'list'):
if format == 'string': if format == 'string':
values = collectValues(node) values = collectValues(node)
...@@ -181,30 +186,29 @@ def prepCDocs(node): ...@@ -181,30 +186,29 @@ def prepCDocs(node):
elif (type == 'string'): elif (type == 'string'):
if format == 'dir': if format == 'dir':
if defval != '': if defval != '':
doc += "The default directory is: <code>%s</code>." % ( doc += "<br/>The default directory is: <code>%s</code>." % (
defval) defval)
elif format == 'file': elif format == 'file':
abspath = node.getAttribute('abspath') abspath = node.getAttribute('abspath')
if defval != '': if defval != '':
if abspath != '1': if abspath != '1':
doc += "The default file is: <code>%s</code>." % ( doc += "<br/>The default file is: <code>%s</code>." % (
defval) defval)
else: else:
doc += "%s: %s%s%s." % ( doc += "<br/>%s: %s%s%s." % (
"The default file (with absolute path) is", "The default file (with absolute path) is",
"<code>",defval,"</code>") "<code>",defval,"</code>")
else: else:
if abspath == '1': if abspath == '1':
doc += "The file has to be specified with full path." doc += "<br/>The file has to be specified with full path."
else: # format == 'string': else: # format == 'string':
if defval != '': if defval != '':
doc += "The default value is: <code>%s</code>." % ( doc += "<br/>The default value is: <code>%s</code>." % (
defval) defval)
# depends handling # depends handling
if (node.hasAttribute('depends')): if (node.hasAttribute('depends')):
depends = node.getAttribute('depends') depends = node.getAttribute('depends')
doc += "<br>" doc += "<br/>%s \\ref cfg_%s \"%s\" is set to \\c YES." % (
doc += "%s \\ref cfg_%s \"%s\" is set to \\c YES." % (
"This tag requires that the tag", depends.lower(), depends.upper()) "This tag requires that the tag", depends.lower(), depends.upper())
docC = transformDocs(doc) docC = transformDocs(doc)
...@@ -392,6 +396,7 @@ def parseOptionDoc(node, first): ...@@ -392,6 +396,7 @@ def parseOptionDoc(node, first):
else: else:
print "%s, " % (val) print "%s, " % (val)
if (defval != ""): if (defval != ""):
print ""
print "" print ""
print "The default value is: <code>%s</code>." % (defval) print "The default value is: <code>%s</code>." % (defval)
print "" print ""
...@@ -399,15 +404,17 @@ def parseOptionDoc(node, first): ...@@ -399,15 +404,17 @@ def parseOptionDoc(node, first):
minval = node.getAttribute('minval') minval = node.getAttribute('minval')
maxval = node.getAttribute('maxval') maxval = node.getAttribute('maxval')
print "" print ""
print ""
print "%s: %s%s%s, %s: %s%s%s, %s: %s%s%s." % ( print "%s: %s%s%s, %s: %s%s%s, %s: %s%s%s." % (
" Minimum value", "<code>", minval, "</code>", " Minimum value", "<code>", minval, "</code>",
"maximum value", "<code>", maxval, "</code>", "maximum value", "<code>", maxval, "</code>",
"default value", "<code>", defval, "</code>") "default value", "<code>", defval, "</code>")
print "" print ""
elif (type == 'bool'): elif (type == 'bool'):
print ""
print "" print ""
if (node.hasAttribute('altdefval')): if (node.hasAttribute('altdefval')):
print "Default value is system dependent." print "The default value is: system dependent."
else: else:
print "The default value is: <code>%s</code>." % ( print "The default value is: <code>%s</code>." % (
"YES" if (defval == "1") else "NO") "YES" if (defval == "1") else "NO")
...@@ -428,11 +435,13 @@ def parseOptionDoc(node, first): ...@@ -428,11 +435,13 @@ def parseOptionDoc(node, first):
elif (type == 'string'): elif (type == 'string'):
if format == 'dir': if format == 'dir':
if defval != '': if defval != '':
print ""
print "The default directory is: <code>%s</code>." % ( print "The default directory is: <code>%s</code>." % (
defval) defval)
elif format == 'file': elif format == 'file':
abspath = node.getAttribute('abspath') abspath = node.getAttribute('abspath')
if defval != '': if defval != '':
print ""
if abspath != '1': if abspath != '1':
print "The default file is: <code>%s</code>." % ( print "The default file is: <code>%s</code>." % (
defval) defval)
...@@ -442,15 +451,18 @@ def parseOptionDoc(node, first): ...@@ -442,15 +451,18 @@ def parseOptionDoc(node, first):
"<code>",defval,"</code>") "<code>",defval,"</code>")
else: else:
if abspath == '1': if abspath == '1':
print ""
print "The file has to be specified with full path." print "The file has to be specified with full path."
else: # format == 'string': else: # format == 'string':
if defval != '': if defval != '':
print ""
print "The default value is: <code>%s</code>." % ( print "The default value is: <code>%s</code>." % (
defval) defval)
print "" print ""
# depends handling # depends handling
if (node.hasAttribute('depends')): if (node.hasAttribute('depends')):
depends = node.getAttribute('depends') depends = node.getAttribute('depends')
print ""
print "%s \\ref cfg_%s \"%s\" is set to \\c YES." % ( print "%s \\ref cfg_%s \"%s\" is set to \\c YES." % (
"This tag requires that the tag", depends.lower(), depends.upper()) "This tag requires that the tag", depends.lower(), depends.upper())
return False return False
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -9780,7 +9780,7 @@ static void usage(const char *name) ...@@ -9780,7 +9780,7 @@ static void usage(const char *name)
msg(" LaTeX: %s -w latex headerFile footerFile styleSheetFile [configFile]\n\n",name); msg(" LaTeX: %s -w latex headerFile footerFile styleSheetFile [configFile]\n\n",name);
msg("6) Use doxygen to generate an rtf extensions file\n"); msg("6) Use doxygen to generate an rtf extensions file\n");
msg(" RTF: %s -e rtf extensionsFile\n\n",name); msg(" RTF: %s -e rtf extensionsFile\n\n",name);
msg("If -s is specified the comments in the config file will be omitted.\n"); msg("If -s is specified the comments of the configuration items in the config file will be omitted.\n");
msg("If configName is omitted `Doxyfile' will be used as a default.\n\n"); msg("If configName is omitted `Doxyfile' will be used as a default.\n\n");
exit(1); exit(1);
} }
......
...@@ -24,7 +24,9 @@ The format of the configuration file (options and types) is defined ...@@ -24,7 +24,9 @@ The format of the configuration file (options and types) is defined
by the file `config.xml`. As part of the build process, by the file `config.xml`. As part of the build process,
the python script `configgen.py` will create a file configoptions.cpp the python script `configgen.py` will create a file configoptions.cpp
from this, which serves as the input for the configuration file parser from this, which serves as the input for the configuration file parser
that is invoked using Config::parse() that is invoked using Config::parse(). The script `configgen.py` will also
create the documentation for the configuration items, creating the file
`config.doc`.
Gathering Input files Gathering Input files
--------------------- ---------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment