diff options
Diffstat (limited to 'portato')
-rw-r--r-- | portato/gui/gtk/windows.py | 28 | ||||
-rw-r--r-- | portato/gui/templates/portato.glade | 17 |
2 files changed, 32 insertions, 13 deletions
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 @@ <property name="position">2</property> </packing> </child> + <child> + <widget class="GtkCheckButton" id="searchOnTypeCheck"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip_markup">Update the package list with the current search results while you are typing. +<b>Note</b>: Will slow down the typing process.</property> + <property name="label" translatable="yes">Search while typing</property> + <property name="yalign">0.47999998927116394</property> + <property name="response_id">-3</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="position">3</property> + </packing> + </child> </widget> </child> </widget> |