From dd02515f61b74f6dda57f01cdd614083bbb4f199 Mon Sep 17 00:00:00 2001 From: Jean CAVALLO Date: Wed, 24 Apr 2013 16:18:50 +0200 Subject: [PATCH] Trigger selection pop-up on Ctrl-Space for Selection Widget of Dict fields issue3163 review809002 --- tryton/gui/window/view_form/view/form_gtk/dictionary.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tryton/gui/window/view_form/view/form_gtk/dictionary.py b/tryton/gui/window/view_form/view/form_gtk/dictionary.py index d660ca29fb..be517f718d 100644 --- a/tryton/gui/window/view_form/view/form_gtk/dictionary.py +++ b/tryton/gui/window/view_form/view/form_gtk/dictionary.py @@ -86,6 +86,7 @@ class DictSelectionEntry(DictEntry): lambda w, e: self.parent_widget._focus_out()) widget.connect('notify::active', lambda w, e: self.parent_widget._focus_out()) + widget.child.connect('key_press_event', self.sig_key_press) # setting completion and selection model = gtk.ListStore(gobject.TYPE_STRING) @@ -129,6 +130,12 @@ class DictSelectionEntry(DictEntry): def set_readonly(self, readonly): self.widget.set_sensitive(not readonly) + def sig_key_press(self, widget, event): + if (event.type == gtk.gdk.KEY_PRESS + and event.state & gtk.gdk.CONTROL_MASK + and event.keyval == gtk.keysyms.space): + self.widget.popup() + class DictIntegerEntry(DictEntry): expand = False