From 4eae1d0ad2e5e52b896e53bcdbb575be82c03a90 Mon Sep 17 00:00:00 2001 From: Necoro <> Date: Sun, 24 Feb 2008 13:17:53 +0000 Subject: r159@Zakarumiy: necoro | 2008-02-24 14:16:32 +0100 Added searchOnType pref. --- etc/portato.cfg | 4 ++++ portato/gui/gtk/windows.py | 28 +++++++++++++++------------- portato/gui/templates/portato.glade | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/etc/portato.cfg b/etc/portato.cfg index 8870757..07825c1 100644 --- a/etc/portato.cfg +++ b/etc/portato.cfg @@ -65,6 +65,10 @@ hideonminimize = true ; the browser to use - string value browserCmd = firefox +; search the packages while you are typing +; disable this if you own a slow machine +searchontype = true + # # GTK-Section for options of the GTK-Frontend # diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py index 03fb5b4..417c626 100644 --- a/portato/gui/gtk/windows.py +++ b/portato/gui/gtk/windows.py @@ -288,6 +288,7 @@ class PreferenceWindow (AbstractDialog): "newUseCheck" : "newuse", "maskPerVersionCheck" : "maskPerVersion", "minimizeCheck" : ("hideOnMinimize", "GUI"), + "searchOnTypeCheck" : ("searchOnType", "GUI"), "systrayCheck" : ("showSystray", "GUI"), "testPerVersionCheck" : "keywordPerVersion", "titleUpdateCheck" : ("updateTitle", "GUI"), @@ -1556,23 +1557,24 @@ class MainWindow (Window): return True def cb_search_changed (self, *args): - txt = self.searchEntry.get_text() + if self.cfg.get_boolean("searchOnType", section="GUI"): + 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 - store = self.catList.get_model() - store.clear() - self.fill_cat_store(store) + store = self.catList.get_model() + store.clear() + self.fill_cat_store(store) - store = self.pkgList.get_model() - store.clear() - try: - self.fill_pkg_store(store, self.selCatName) - except AttributeError: # no selCatName -> so no category selected --> ignore - debug("No category selected --> should be no harm.") + store = self.pkgList.get_model() + store.clear() + try: + self.fill_pkg_store(store, self.selCatName) + except AttributeError: # no selCatName -> so no category selected --> ignore + debug("No category selected --> should be no harm.") - return True + return True def cb_delete_search_clicked (self, *args): self.searchEntry.set_text("") diff --git a/portato/gui/templates/portato.glade b/portato/gui/templates/portato.glade index 8b577e3..baedf91 100644 --- a/portato/gui/templates/portato.glade +++ b/portato/gui/templates/portato.glade @@ -1762,6 +1762,23 @@ 2 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + Update the package list with the current search results while you are typing. +<b>Note</b>: Will slow down the typing process. + Search while typing + 0.47999998927116394 + -3 + True + + + 3 + + -- cgit v1.2.3