Reviewers: ,


Please review this at http://codereview.tryton.org/221009/

Affected files:
  M tryton/gui/window/view_form/view/list_gtk/parser.py


Index: tryton/gui/window/view_form/view/list_gtk/parser.py
===================================================================
--- a/tryton/gui/window/view_form/view/list_gtk/parser.py
+++ b/tryton/gui/window/view_form/view/list_gtk/parser.py
@@ -241,6 +241,7 @@
                 col.set_widget(label)

                 col._type = 'button'
+                col.set_cell_data_func(renderer, cell.setter)
                 if 'width' in node_attrs:
                     width = int(node_attrs['width'])
                 else:
@@ -997,6 +998,15 @@

         self.renderer.connect('clicked', self.button_clicked)

+    def setter(self, column, cell, store, iter):
+        record = store.get_value(iter, 0)
+        states = record.expr_eval(self.attrs.get('states', {}),
+            check_load=False)
+        invisible = states.get('invisible', False)
+        cell.set_property('visible', not invisible)
+        # TODO readonly
+        # TODO icon
+
     def button_clicked(self, widget, path):
         if not path:
             return True


--
tryton-dev@googlegroups.com mailing list

Reply via email to