From 8f6e17e80d2d57e7399350805cead44fadcaae49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 27 May 2009 19:06:45 +0200 Subject: [PATCH] Remove form_tab_orientation and deduce the orientation from the form_tab value --- tryton/config.py | 1 - tryton/gui/main.py | 33 ------------------- tryton/gui/window/view_board/parser.py | 8 +++-- .../window/view_form/view/form_gtk/parser.py | 8 +++-- 4 files changed, 10 insertions(+), 40 deletions(-) diff --git a/tryton/config.py b/tryton/config.py index e22cb554ce..0667aaebe8 100644 --- a/tryton/config.py +++ b/tryton/config.py @@ -74,7 +74,6 @@ class ConfigManager(object): 'client.default_path': get_home_dir(), 'form.toolbar': True, 'client.form_tab': 'left', - 'client.form_tab_orientation': 90, 'client.tree_width': True, 'client.spellcheck': False, 'client.lang': locale.getdefaultlocale()[0], diff --git a/tryton/gui/main.py b/tryton/gui/main.py index 921bc67fd2..df1d3bb1c4 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -725,35 +725,6 @@ class Main(object): if (CONFIG['client.form_tab'] or 'left') == 'bottom': radiomenuitem_bottom.set_active(True) - menuitem_orientation = gtk.MenuItem(_('Tabs Orientation')) - menu_form.add(menuitem_orientation) - - menu_orientation = gtk.Menu() - menu_orientation.set_accel_group(self.accel_group) - menu_orientation.set_accel_path('/Options/Tabs Orientation') - menuitem_orientation.set_submenu(menu_orientation) - - radiomenuitem_horizontal = gtk.RadioMenuItem(label=_('Horizontal')) - radiomenuitem_horizontal.connect('activate', - lambda x: CONFIG.__setitem__('client.form_tab_orientation', - 0)) - radiomenuitem_horizontal.set_accel_path( - '/Options/Tabs Orientation/Horizontal') - menu_orientation.add(radiomenuitem_horizontal) - if (str(CONFIG['client.form_tab_orientation']) or '0') == '0': - radiomenuitem_horizontal.set_active(True) - - radiomenuitem_vertical = gtk.RadioMenuItem(group=radiomenuitem_horizontal, - label=_('Vertical')) - radiomenuitem_vertical.connect('activate', - lambda x: CONFIG.__setitem__('client.form_tab_orientation', - 90)) - radiomenuitem_vertical.set_accel_path( - '/Options/Tabs Orientation/Vertical') - menu_orientation.add(radiomenuitem_vertical) - if (str(CONFIG['client.form_tab_orientation']) or '0') == '90': - radiomenuitem_vertical.set_active(True) - menuitem_actions = gtk.MenuItem(_('File _Actions...')) self.menuitem_actions = menuitem_actions menuitem_actions.connect('activate', self.sig_file_actions) @@ -999,10 +970,6 @@ class Main(object): def sig_form_tab(option): CONFIG['client.form_tab'] = option - @staticmethod - def sig_form_tab_orientation(option): - CONFIG['client.form_tab_orientation'] = option - def sig_file_actions(self, widget): FileActions(self.window).run() diff --git a/tryton/gui/window/view_board/parser.py b/tryton/gui/window/view_board/parser.py index 27a15ac004..26b99bbf16 100644 --- a/tryton/gui/window/view_board/parser.py +++ b/tryton/gui/window/view_board/parser.py @@ -125,10 +125,12 @@ class ParserBoard(object): widget, new_widgets = self.parse(node, notebook, tooltips=tooltips) widgets += new_widgets elif node.localName == 'page': - if attrs and 'angle' in attrs: - angle = int(attrs['angle']) + if CONFIG['client.form_tab'] == 'left': + angle = 90 + elif CONFIG['client.form_tab'] == 'right': + angle = -90 else: - angle = int(CONFIG['client.form_tab_orientation']) + angle = 0 label = gtk.Label(attrs.get('string','No String Attr.')) label.set_angle(angle) widget, new_widgets = self.parse(node, notebook, tooltips=tooltips) diff --git a/tryton/gui/window/view_form/view/form_gtk/parser.py b/tryton/gui/window/view_form/view/form_gtk/parser.py index 1b952085ce..df0f766fcc 100644 --- a/tryton/gui/window/view_form/view/form_gtk/parser.py +++ b/tryton/gui/window/view_form/view/form_gtk/parser.py @@ -560,10 +560,12 @@ class ParserForm(ParserInterface): dict_widget[widget_name].extend(widgets) elif node.localName == 'page': - if attrs and 'angle' in attrs: - angle = int(attrs['angle']) + if CONFIG['client.form_tab'] == 'left': + angle = 90 + elif CONFIG['client.form_tab'] == 'right': + angle = -90 else: - angle = int(CONFIG['client.form_tab_orientation']) + angle = 0 text = attrs.get('string', '') if 'name' in attrs and attrs['name'] in fields: if 'states' in fields[attrs['name']]: