From ad2e5d7d705a1e026b1a0425b0e45c5ccf39870b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Tue, 26 Jul 2011 12:30:04 +0200 Subject: [PATCH] Add separator between print buttons and relate --- tryton/gui/window/form.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tryton/gui/window/form.py b/tryton/gui/window/form.py index fabdb454ce..d755a5189c 100644 --- a/tryton/gui/window/form.py +++ b/tryton/gui/window/form.py @@ -569,19 +569,23 @@ class Form(SignalEvent, TabContent): for action_type, special_action, action_name, tooltip in ( ('action', 'action', _('Action'), _('Launch action')), ('relate', 'relate', _('Relate'), _('Open related records')), + (None,) * 4, ('print', 'open', _('Report'), _('Open report')), ('print', 'email', _('E-Mail'), _('E-Mail report')), ('print', 'print', _('Print'), _('Print report')), ): - tbutton = gtk.ToggleToolButton(iconstock.get(special_action)) - tbutton.set_label(action_name) - tbutton._menu = self._create_popup_menu(tbutton, - action_type, toolbars[action_type], special_action) - tbutton.connect('toggled', self.action_popup) - self.tooltips.set_tip(tbutton, tooltip) - self.buttons[special_action] = tbutton + if action_type is not None: + tbutton = gtk.ToggleToolButton(iconstock.get(special_action)) + tbutton.set_label(action_name) + tbutton._menu = self._create_popup_menu(tbutton, + action_type, toolbars[action_type], special_action) + tbutton.connect('toggled', self.action_popup) + self.tooltips.set_tip(tbutton, tooltip) + self.buttons[special_action] = tbutton + tbutton._can_be_sensitive = bool(toolbars.get(action_type)) + else: + tbutton = gtk.SeparatorToolItem() gtktoolbar.insert(tbutton, -1) - tbutton._can_be_sensitive = bool(toolbars.get(action_type)) return gtktoolbar