Remove Tabs Position option

issue1014
review7991002
This commit is contained in:
Cédric Krier committed 2015-03-15 16:31:07 +01:00
1 parent f900c6b25e
commit 689614e2a0
5 files changed
+5 -105

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Remove Tabs Position option
* Manage product attribute
* Remove float_time widget
* Add TimeDelta field
-2
View File
@@ -40,7 +40,6 @@ class ConfigManager(object):
short_version = '.'.join(VERSION.split('.', 2)[:2])
demo_server = 'demo%s.tryton.org' % short_version
demo_database = 'demo%s' % short_version
form_tab = 'left' if os.name != 'nt' else 'top'
self.defaults = {
'login.profile': demo_server,
'login.login': 'demo',
@@ -55,7 +54,6 @@ class ConfigManager(object):
'client.default_height': 750,
'client.modepda': False,
'client.toolbar': 'default',
'client.form_tab': form_tab,
'client.maximize': False,
'client.save_width_height': True,
'client.save_tree_state': True,
-46
View File
@@ -643,52 +643,6 @@ class Main(object):
if CONFIG['client.spellcheck']:
checkmenuitem_spellcheck.set_active(True)
menuitem_tab = gtk.MenuItem(_('Tabs Position'))
menu_form.add(menuitem_tab)
menu_tab = gtk.Menu()
menu_tab.set_accel_group(self.accel_group)
menu_tab.set_accel_path('<tryton>/Options/Tabs Position')
menuitem_tab.set_submenu(menu_tab)
radiomenuitem_top = gtk.RadioMenuItem(label=_('Top'))
radiomenuitem_top.connect('activate',
lambda x: CONFIG.__setitem__('client.form_tab', 'top'))
radiomenuitem_top.set_accel_path('<tryton>/Options/Tabs Position/Top')
menu_tab.add(radiomenuitem_top)
if (CONFIG['client.form_tab'] or 'left') == 'top':
radiomenuitem_top.set_active(True)
radiomenuitem_left = gtk.RadioMenuItem(group=radiomenuitem_top,
label=_('Left'))
radiomenuitem_left.connect('activate',
lambda x: CONFIG.__setitem__('client.form_tab', 'left'))
radiomenuitem_left.set_accel_path(
'<tryton>/Options/Tabs Position/Left')
menu_tab.add(radiomenuitem_left)
if (CONFIG['client.form_tab'] or 'left') == 'left':
radiomenuitem_left.set_active(True)
radiomenuitem_right = gtk.RadioMenuItem(group=radiomenuitem_top,
label=_('Right'))
radiomenuitem_right.connect('activate',
lambda x: CONFIG.__setitem__('client.form_tab', 'right'))
radiomenuitem_right.set_accel_path(
'<tryton>/Options/Tabs Position/Right')
menu_tab.add(radiomenuitem_right)
if (CONFIG['client.form_tab'] or 'left') == 'right':
radiomenuitem_right.set_active(True)
radiomenuitem_bottom = gtk.RadioMenuItem(group=radiomenuitem_top,
label=_('Bottom'))
radiomenuitem_bottom.connect('activate',
lambda x: CONFIG.__setitem__('client.form_tab', 'bottom'))
radiomenuitem_bottom.set_accel_path(
'<tryton>/Options/Tabs Position/Bottom')
menu_tab.add(radiomenuitem_bottom)
if (CONFIG['client.form_tab'] or 'left') == 'bottom':
radiomenuitem_bottom.set_active(True)
imagemenuitem_win_prev = gtk.ImageMenuItem(_('_Previous Tab'),
self.accel_group)
imagemenuitem_win_prev.connect('activate', self.sig_win_prev)
+2 -29
View File
@@ -6,7 +6,6 @@ import gettext
import xml.dom.minidom
from tryton.gui.window.view_form.view.form import Container
from tryton.common import node_attributes, ICONFACTORY
from tryton.config import CONFIG
from .action import Action
_ = gettext.gettext
@@ -83,36 +82,14 @@ class ViewBoard(object):
attributes.setdefault('yfill', True)
notebook = gtk.Notebook()
notebook.set_scrollable(True)
positions = {
'top': gtk.POS_TOP,
'left': gtk.POS_LEFT,
'right': gtk.POS_RIGHT,
'bottom': gtk.POS_BOTTOM,
}
notebook.set_tab_pos(positions[CONFIG['client.form_tab']])
container.add(notebook, attributes)
self.parse(node, notebook)
def _parse_page(self, node, notebook, attributes):
if CONFIG['client.form_tab'] == 'left':
angle = 90
tab_box = gtk.VBox(spacing=3)
image_pos, image_rotate = ('end',
gtk.gdk.PIXBUF_ROTATE_COUNTERCLOCKWISE)
elif CONFIG['client.form_tab'] == 'right':
angle = -90
tab_box = gtk.VBox(spacing=3)
image_pos, image_rotate = ('start',
gtk.gdk.PIXBUF_ROTATE_CLOCKWISE)
else:
angle = 0
tab_box = gtk.HBox(spacing=3)
image_pos, image_rotate = ('start',
gtk.gdk.PIXBUF_ROTATE_NONE)
tab_box = gtk.HBox(spacing=3)
if '_' not in attributes['string']:
attributes['string'] = '_' + attributes['string']
label = gtk.Label(attributes['string'])
label.set_angle(angle)
label.set_use_underline(True)
tab_box.pack_start(label)
@@ -120,13 +97,9 @@ class ViewBoard(object):
ICONFACTORY.register_icon(attributes['icon'])
pixbuf = tab_box.render_icon(attributes['icon'],
gtk.ICON_SIZE_SMALL_TOOLBAR)
pixbuf = pixbuf.rotate_simple(image_rotate)
icon = gtk.Image()
icon.set_from_pixbuf(pixbuf)
if image_pos == 'end':
tab_box.pack_end(icon)
else:
tab_box.pack_start(icon)
tab_box.pack_start(icon)
tab_box.show_all()
viewport = gtk.Viewport()
+2 -28
View File
@@ -205,13 +205,6 @@ class ViewForm(View):
attributes.setdefault('colspan', 4)
notebook = Notebook(attrs=attributes)
notebook.set_scrollable(True)
positions = {
'top': gtk.POS_TOP,
'left': gtk.POS_LEFT,
'right': gtk.POS_RIGHT,
'bottom': gtk.POS_BOTTOM,
}
notebook.set_tab_pos(positions[CONFIG['client.form_tab']])
notebook.set_border_width(3)
# Force to display the first time it switches on a page
@@ -231,21 +224,7 @@ class ViewForm(View):
self.parse(node, notebook)
def _parse_page(self, node, notebook, attributes):
if CONFIG['client.form_tab'] == 'left':
angle = 90
tab_box = gtk.VBox(spacing=3)
image_pos, image_rotate = ('end',
gtk.gdk.PIXBUF_ROTATE_COUNTERCLOCKWISE)
elif CONFIG['client.form_tab'] == 'right':
angle = -90
tab_box = gtk.VBox(spacing=3)
image_pos, image_rotate = ('start',
gtk.gdk.PIXBUF_ROTATE_CLOCKWISE)
else:
angle = 0
tab_box = gtk.HBox(spacing=3)
image_pos, image_rotate = ('start',
gtk.gdk.PIXBUF_ROTATE_NONE)
tab_box = gtk.HBox(spacing=3)
if 'name' in attributes:
field = self.screen.group.fields[attributes['name']]
if attributes['name'] == self.screen.exclude_field:
@@ -256,7 +235,6 @@ class ViewForm(View):
if '_' not in attributes['string']:
attributes['string'] = '_' + attributes['string']
label = gtk.Label(attributes['string'])
label.set_angle(angle)
label.set_use_underline(True)
tab_box.pack_start(label)
@@ -264,13 +242,9 @@ class ViewForm(View):
ICONFACTORY.register_icon(attributes['icon'])
pixbuf = tab_box.render_icon(attributes['icon'],
gtk.ICON_SIZE_SMALL_TOOLBAR)
pixbuf = pixbuf.rotate_simple(image_rotate)
icon = gtk.Image()
icon.set_from_pixbuf(pixbuf)
if image_pos == 'end':
tab_box.pack_end(icon)
else:
tab_box.pack_start(icon)
tab_box.pack_start(icon)
tab_box.show_all()
viewport = gtk.Viewport()