Add shortcut to focus search entry

review135001
This commit is contained in:
Nicolas Évrard committed 2011-12-14 17:29:57 +01:00
1 parent 88375df4f8
commit 8bc03c0939
2 files changed
+8

No files matched your search

+2
View File
@@ -124,6 +124,8 @@ class Main(object):
gtk.gdk.CONTROL_MASK)
gtk.accel_map_add_entry('<tryton>/Form/Report', gtk.keysyms.P,
gtk.gdk.CONTROL_MASK)
gtk.accel_map_add_entry('<tryton>/Form/Search', gtk.keysyms.F,
gtk.gdk.CONTROL_MASK)
if hasattr(gtk, 'accel_map_load'):
gtk.accel_map_load(os.path.join(get_config_dir(), 'accel.map'))
+6
View File
@@ -63,6 +63,7 @@ class Form(SignalEvent, TabContent):
'<tryton>/Form/Previous'),
(_('_Switch View'), 'tryton-fullscreen', 'sig_switch',
'<tryton>/Form/Switch View'),
(_('_Search'), 'tryton-find', 'sig_search', '<tryton>/Form/Search'),
(None,) * 4,
(_('_Close Tab'), 'tryton-close', 'sig_win_close',
'<tryton>/Form/Close'),
@@ -420,6 +421,11 @@ class Form(SignalEvent, TabContent):
def sig_relate(self, widget):
self.buttons['relate'].props.active = True
def sig_search(self, widget):
search_container = self.screen.screen_container
if hasattr(search_container, 'search_entry'):
search_container.search_entry.grab_focus()
def action_popup(self, widget):
button, = widget.get_children()
button.grab_focus()