Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/canvas.py
diff options
context:
space:
mode:
authorAgustin Zubiaga <aguz@sugarlabs.org>2012-10-25 04:54:12 (GMT)
committer Agustin Zubiaga <aguz@sugarlabs.org>2012-10-25 04:54:12 (GMT)
commit866c4be68bef1361fa8fc389835ef1df301bae41 (patch)
treeb2bb75029a9f5002091d7dc5d4bd2d5217ce6dc8 /canvas.py
parent541f1b354d00916d83c86c134e19796b9e9f98bf (diff)
Stop a search and start a new one
Diffstat (limited to 'canvas.py')
-rw-r--r--canvas.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/canvas.py b/canvas.py
index 0e44b6a..5cc6d6b 100644
--- a/canvas.py
+++ b/canvas.py
@@ -84,9 +84,13 @@ class List(gtk.VBox):
self.words = ''
self._list = utils.get_store_list()
self.can_search = True
+ self.stopped = False
self.show_all()
+ def stop_search(self, *args):
+ self.stopped = True
+
def _add_activity(self, widget):
self.pack_start(widget, False, False, 7)
separator = gtk.HSeparator()
@@ -109,12 +113,15 @@ class List(gtk.VBox):
self.thread = threading.Thread(target=self._search)
self.thread.start()
else:
- pass
+ self.stop_search()
+ gobject.idle_add(self.search, entry)
def _search(self):
w = str(self.w)
_id = -1
for activity in self._list:
+ if self.stopped:
+ break
_id += 1
name = activity[1].lower()
description = activity[2].lower()
@@ -257,6 +264,5 @@ class DownloadList(gtk.TreeView):
self._model[_id][1] = _("Installing...")
self._model[_id][2] = 100
-
if progress == 200:
self._model[_id][1] = _("Installed!")