From f0260456c9dc241404245be2bac981c838afa614 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 18 Aug 2009 13:48:04 +0100 Subject: [PATCH] we don't need to re-emit the search keypress, all it does is conditionally emit end-search anyway --- terminatorlib/searchbar.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terminatorlib/searchbar.py b/terminatorlib/searchbar.py index 4ebfe05b..acf563b9 100755 --- a/terminatorlib/searchbar.py +++ b/terminatorlib/searchbar.py @@ -12,8 +12,6 @@ class Searchbar(gtk.HBox): """Class implementing the Searchbar widget""" __gsignals__ = { - 'key-press-event': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, - ()), 'do-search': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), 'next-search': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), 'end-search': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), @@ -69,8 +67,10 @@ class Searchbar(gtk.HBox): self.show() def search_keypress(self, widget, event): - """Trap and re-emit the key-press-event signal""" - self.emit('key-press-event', widget, event) + """Handle keypress events""" + key = gtk.gdk.keyval_name(event.keyval) + if key == 'Escape': + self.end_search() def do_search(self, widget): """Trap and re-emit the clicked signal"""