[Sugar-devel] [sugar] Connect the clear-clicked signal in the ObjectChooser listview

godiard at sugarlabs.org godiard at sugarlabs.org
Sat Sep 1 01:42:05 EDT 2012


From: Gonzalo Odiard <godiard at gmail.com>

Signed-off-by: Gonzalo Odiard <gonzalo at laptop.org>
---
 src/jarabe/journal/objectchooser.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/jarabe/journal/objectchooser.py b/src/jarabe/journal/objectchooser.py
index 175aa0f..f658345 100644
--- a/src/jarabe/journal/objectchooser.py
+++ b/src/jarabe/journal/objectchooser.py
@@ -85,6 +85,8 @@ class ObjectChooser(gtk.Window):
 
         self._list_view = ChooserListView()
         self._list_view.connect('entry-activated', self.__entry_activated_cb)
+        self._list_view.connect('clear-clicked', self.__clear_clicked_cb)
+
         vbox.pack_start(self._list_view)
         self._list_view.show()
 
@@ -135,6 +137,9 @@ class ObjectChooser(gtk.Window):
         visible = event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED
         self._list_view.set_is_visible(visible)
 
+    def __clear_clicked_cb(self, list_view):
+        self._toolbar.clear_query()
+
 
 class TitleBox(VolumesToolbar):
     __gtype_name__ = 'TitleBox'
-- 
1.7.11.4



More information about the Sugar-devel mailing list