Reviewers: ,
Please review this at http://codereview.tryton.org/41004/
Affected files:
M trytond/ir/module/module.xml
M trytond/ir/ui/tree.rnc
M trytond/ir/ui/tree.rng
Index: trytond/ir/module/module.xml
===================================================================
--- a/trytond/ir/module/module.xml
+++ b/trytond/ir/module/module.xml
@@ -68,6 +68,11 @@
<field name="website" select="2"/>
<field name="state" select="1"/>
<field name="description" tree_invisible="1"
select="2"/>
+ <legend>
+ <color name="blue">To upgrade/install</color>
+ <color name="grey">Uninstalled</color>
+ <color name="black">Installed</color>
+ </legend>
</tree>
]]>
</field>
Index: trytond/ir/ui/tree.rnc
===================================================================
--- a/trytond/ir/ui/tree.rnc
+++ b/trytond/ir/ui/tree.rnc
@@ -2,6 +2,7 @@
tree = element tree { attlist.tree,
(field
+ | legend
| button)*
}
attlist.tree &=
@@ -62,6 +63,11 @@
attlist.button &= attribute confirm { text }?
attlist.button &= attribute name { text }
attlist.button &= attribute states { text }?
+legend = element legend { attlist.legend, color+ }
+attlist.legend &= empty
+color = element color { attlist.color, text }
+attlist.color &=
+ [ a:defaultValue = "Unknown" ] attribute name { text }?
data = element data { attlist.data, xpath+ }
attlist.data &= empty
xpath = element xpath { attlist.xpath,
Index: trytond/ir/ui/tree.rng
===================================================================
--- a/trytond/ir/ui/tree.rng
+++ b/trytond/ir/ui/tree.rng
@@ -6,6 +6,7 @@
<zeroOrMore>
<choice>
<ref name="field"/>
+ <ref name="legend"/>
<ref name="button"/>
</choice>
</zeroOrMore>
@@ -198,6 +199,28 @@
<attribute name="states"/>
</optional>
</define>
+ <define name="legend">
+ <element name="legend">
+ <ref name="attlist.legend"/>
+ <oneOrMore>
+ <ref name="color"/>
+ </oneOrMore>
+ </element>
+ </define>
+ <define name="attlist.legend" combine="interleave">
+ <empty/>
+ </define>
+ <define name="color">
+ <element name="color">
+ <ref name="attlist.color"/>
+ <text/>
+ </element>
+ </define>
+ <define name="attlist.color" combine="interleave">
+ <optional>
+ <attribute name="name" a:defaultValue="Unknown"/>
+ </optional>
+ </define>
<define name="data">
<element name="data">
<ref name="attlist.data"/>
--
[email protected] mailing list