Merge lp:~numerigraphe/openobject-client/6.0-configurable-spinbuttons into lp:openobject-client/6.0

Proposed by Numérigraphe
Status: Needs review
Proposed branch: lp:~numerigraphe/openobject-client/6.0-configurable-spinbuttons
Merge into: lp:openobject-client/6.0
Diff against target: 52 lines (+7/-2)
3 files modified
bin/options.py (+1/-0)
bin/widget/view/form_gtk/spinbutton.py (+3/-1)
bin/widget/view/form_gtk/spinint.py (+3/-1)
To merge this branch: bzr merge lp:~numerigraphe/openobject-client/6.0-configurable-spinbuttons
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+133088@code.launchpad.net

Description of the change

I propose to add a configuration key to set the spin buttons' increment.
By setting it to 0 in the configuration file, one can disable spinning altogether. This is seen as a useful improvement by several of our users, because using the mouse wheel to scroll the form actually spins int/float widgets instead if the mouse cursor is on such a widget.
The default remains to increment/decrement by 1.0 on spin.
Lionel Sausin.

To post a comment you must log in.

Unmerged revisions

1965. By Numerigraphe - Lionel Sausin <email address hidden>

[IMP] Add a configuration option to set the increment of all spinbuttons in the config file. Set to 0.0 to disable spinning (users with wheelmouse hate spinbuttons in forms!)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/options.py'
2--- bin/options.py 2011-02-17 13:44:50 +0000
3+++ bin/options.py 2012-11-06 16:10:31 +0000
4@@ -116,6 +116,7 @@
5 'help.context': 'http://doc.openerp.com/v6.0/index.php?model=%(model)s&lang=%(lang)s',
6 'client.timeout': 3600,
7 'client.form_text_spellcheck': True,
8+ 'client.spinbutton_increment': 1.0,
9 }
10 loglevels = ('critical', 'error', 'warning', 'info', 'debug', 'debug_rpc', 'debug_rpc_answer', 'notset')
11 parser = optparse.OptionParser(version=_("OpenERP Client %s" % openerp_version))
12
13=== modified file 'bin/widget/view/form_gtk/spinbutton.py'
14--- bin/widget/view/form_gtk/spinbutton.py 2012-10-25 07:20:19 +0000
15+++ bin/widget/view/form_gtk/spinbutton.py 2012-11-06 16:10:31 +0000
16@@ -23,12 +23,14 @@
17 import interface
18 import ctypes
19 from tools import user_locale_format
20+import options
21
22 class spinbutton(interface.widget_interface):
23 def __init__(self, window, parent, model, attrs={}):
24 interface.widget_interface.__init__(self, window, parent, model, attrs)
25
26- adj = gtk.Adjustment(0.0, -2**100, 2**100, 1.0, 5.0)
27+ adj = gtk.Adjustment(0.0, -2**100, 2**100,
28+ float(options.options['client.spinbutton_increment']), 5.0)
29 self.widget = gtk.SpinButton(adj, 1.0, digits=int( attrs.get('digits',(14,2))[1] ) )
30 self.widget.set_activates_default(True)
31 self.widget.connect('populate-popup', self._menu_open)
32
33=== modified file 'bin/widget/view/form_gtk/spinint.py'
34--- bin/widget/view/form_gtk/spinint.py 2012-10-25 07:20:19 +0000
35+++ bin/widget/view/form_gtk/spinint.py 2012-11-06 16:10:31 +0000
36@@ -23,13 +23,15 @@
37 import interface
38 import ctypes
39 from tools import user_locale_format
40+import options
41
42 class spinint(interface.widget_interface):
43
44 def __init__(self, window, parent, model, attrs={}):
45 interface.widget_interface.__init__(self, window, parent, model, attrs)
46
47- adj = gtk.Adjustment(0.0, -2**100, 2**100, 1.0, 5.0)
48+ adj = gtk.Adjustment(0.0, -2**100, 2**100,
49+ float(options.options['client.spinbutton_increment']), 5.0)
50 self.widget = gtk.SpinButton(adj, 1, digits=0)
51 self.widget.set_width_chars(5)
52 self.widget.set_activates_default(True)