summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--portato/gui/gtk/windows.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index 02785ed..5b6c621 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -948,6 +948,7 @@ class MainWindow (Window):
# booleans
self.doUpdate = False
self.showAll = True # show only installed or all packages?
+ self.__searchChanged = False
# installed pixbuf
self.instPixbuf = self.window.render_icon(gtk.STOCK_YES, gtk.ICON_SIZE_MENU)
@@ -1675,16 +1676,26 @@ class MainWindow (Window):
Called when the user enters something in the search field.
Updates the packages according to the search expression.
"""
- if self.cfg.get_boolean("searchOnType", section="GUI"):
- txt = self.searchEntry.get_text()
+ if not self.__searchChanged and self.cfg.get_boolean("searchOnType", section="GUI"):
+ self.__searchChanged = True
+
+ def __update():
+ self.__searchChanged = False
+ txt = self.searchEntry.get_text()
- if txt or self.db.restrict:
- self.db.restrict = txt
+ if txt or self.db.restrict:
+ self.db.restrict = txt
- self.refresh_stores()
- self.catList.get_selection().select_path("0") # XXX make this smarter
+ self.refresh_stores()
+ self.catList.get_selection().select_path("0") # XXX make this smarter
- return True
+ return False # not again ;)
+
+ gobject.timeout_add(100, __update)
+
+ def cb_delete_search_clicked (self, *args):
+ self.searchEntry.set_text("")
+ return True
def cb_preferences_clicked (self, *args):
"""
='insertions'>+2 2015-05-10Bump versionAntonio Terceiro1-1/+1 2015-05-10Fix regression in `include-images` optionAntonio Terceiro3-8/+16 2015-05-03Bump versionAntonio Terceiro1-1/+1 2015-05-03Fix usage of filtersAntonio Terceiro2-16/+24 2015-01-13Handle being given numbers as feed nameAntonio Terceiro2-0/+16 2015-01-13Rakefile: remove wrong (and thus unused) flagAntonio Terceiro1-1/+0 2015-01-13Remove deprecated 'test suite' fileAntonio Terceiro1-12/+0 2015-01-13Rakefile: re-indentAntonio Terceiro1-35/+35 2015-01-13Rakefile: run tests in verbose modeAntonio Terceiro1-1/+2 2014-10-071.2.3 releaseAntonio Terceiro1-1/+1 2014-10-07Fix cleanup of maildirsAntonio Terceiro3-1/+16 2014-05-18feed2imap-test: reuse cache dir/protect configAntonio Terceiro1-1/+1 2014-02-13feed2imap-test: can now take a feed URL as argumentAntonio Terceiro1-3/+22 2014-02-13update .gitignoreAntonio Terceiro1-0/+2 2014-02-13fix dependency on ruby-feedparserAntonio Terceiro1-1/+1 2014-02-05Release 1.2.2Antonio Terceiro2-2/+2 2014-02-05config: fix regression with arrays as targetAntonio Terceiro2-1/+17 2013-08-28Fix teardown method nameAntonio Terceiro1-1/+1