Ravi Gadhia (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client/trunk-new_dashboard_api-rga into 
lp:openobject-client.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-new_dashboard_api-rga/+merge/79794

Dashboard: support new proto61 api of dashboard
more detail: http://pad.openerp.com/rd-v61-web-proto61-dashboard
-- 
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-new_dashboard_api-rga/+merge/79794
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client/trunk-new_dashboard_api-rga.
=== modified file 'bin/widget/view/form_gtk/parser.py'
--- bin/widget/view/form_gtk/parser.py	2011-10-11 05:41:57 +0000
+++ bin/widget/view/form_gtk/parser.py	2011-10-19 10:56:14 +0000
@@ -298,6 +298,8 @@
            self.widget_id = 0
            self.default_focus_field = False
            self.default_focus_button = False
+           self.board_style = False
+           self.column = 1
            self.accepted_attr_list = ['type','domain','context','relation', 'widget','attrs',
                                       'digits','function','store','fnct_search','fnct_inv','fnct_inv_arg',
                                       'func_obj','func_method','related_columns','third_table','states',
@@ -549,23 +551,50 @@
                 dict_widget.update(widgets)
                 if 'position' in attrs:
                     hp.set_position(int(attrs['position']))
+                    
             elif node.tag =='child1':
                 widget, widgets, saws, on_write = self.parse(model, node, fields, paned=paned)
                 saw_list += saws
                 dict_widget.update(widgets)
                 paned.pack1(widget, resize=True, shrink=True)
+            
             elif node.tag =='child2':
                 widget, widgets, saws, on_write = self.parse(model, node, fields, paned=paned)
                 saw_list += saws
                 dict_widget.update(widgets)
                 paned.pack2(widget, resize=True, shrink=True)
+            
             elif node.tag =='action':
                 from action import action
                 name = str(attrs['name'])
+                x ,y ,width, hight = self.window.get_allocation()
+                if (self.board_style == '2-1' and self.column == 1) or (self.column == 2 and self.board_style == '1-2'):
+                    attrs.update({'width': width * 0.75})
                 widget_act = action(self.window, self.parent, model, attrs)
                 if hasattr(widget_act, 'widget'):
                     dict_widget[name] = widget_act
                     container.wid_add(widget_act.widget, colspan=int(attrs.get('colspan', 3)), expand=True, fill=True)
+            
+            elif node.tag == 'board':
+                self.board_style = attrs.get('style')
+                hp = gtk.HPaned()
+                container.wid_add(hp, colspan=int(attrs.get('colspan', 4)), expand=True, fill=True)
+                _, widgets, saws, on_write = self.parse(model, node, fields, paned=hp)
+                saw_list += saws
+                dict_widget.update(widgets)
+            
+            elif node.tag == 'column':
+                if not node.getchildren():
+                    continue
+                hp = gtk.HPaned()
+                paned.pack2(hp, resize=True, shrink=True)
+                paned = hp
+                widget, widgets, saws, on_write = self.parse(model, node, fields, paned=paned)
+                self.column = self.column +  1
+                saw_list += saws
+                dict_widget.update(widgets)
+                paned.pack1(widget, resize=True, shrink=True)
+                
         for (ebox,src,name,widget) in container.trans_box:
             ebox.connect('button_press_event',self.translate, model, name, src, widget, self.screen, self.window)
         for (ebox,src,name) in container.trans_box_label:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to