Remove form_tab_orientation and deduce the orientation from the form_tab value

This commit is contained in:
Cédric Krier committed 2009-05-27 19:06:45 +02:00
1 parent 9848b6d1d1
commit 8f6e17e80d
4 files changed
+10 -40

No files matched your search

-1
View File
@@ -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],
-33
View File
@@ -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('<tryton>/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(
'<tryton>/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(
'<tryton>/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()
+5 -3
View File
@@ -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)
@@ -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']]: