diff --git a/src/Filters/_SearchBar.py b/src/Filters/_SearchBar.py index fbbce28e6..be88ef7d1 100644 --- a/src/Filters/_SearchBar.py +++ b/src/Filters/_SearchBar.py @@ -79,6 +79,10 @@ class SearchBar(object): return self.filterbar def setup_filter( self, column_data ): + """ + column_data is a list of tuples: + [(trans_col_name, index, use_exact), ...] + """ self.filter_model.clear() old_value = self.filter_list.get_active() @@ -88,11 +92,17 @@ class SearchBar(object): self.filter_list.add_attribute(cell, 'text', 0) maxval = 0 - for col, index in column_data: - rule = _("%s contains") % col + for col, index, exact in column_data: + if exact: + rule = _("%s is") % col + else: + rule = _("%s contains") % col self.filter_model.append(row=[rule, index, False]) maxval += 1 - rule = _("%s does not contain") % col + if exact: + rule = _("%s is not") % col + else: + rule = _("%s does not contain") % col self.filter_model.append(row=[rule, index, True]) maxval += 1 diff --git a/src/gui/selectors/baseselector.py b/src/gui/selectors/baseselector.py index 6873755c8..4118d9d28 100644 --- a/src/gui/selectors/baseselector.py +++ b/src/gui/selectors/baseselector.py @@ -231,7 +231,7 @@ class BaseSelector(ManagedWindow.ManagedWindow): """ Builds the default filters and add them to the filter bar. """ - cols = [(pair[3], pair[1]) + cols = [(pair[3], pair[1], pair[0] in self.eaxct_search()) for pair in self.column_order() if pair[0] ] diff --git a/src/gui/views/listview.py b/src/gui/views/listview.py index 740feb1b2..e27c083e3 100644 --- a/src/gui/views/listview.py +++ b/src/gui/views/listview.py @@ -358,7 +358,7 @@ class ListView(NavigationView): def setup_filter(self): """Build the default filters and add them to the filter menu.""" self.search_bar.setup_filter( - [(self.colinfo[pair[1]], pair[1]) + [(self.colinfo[pair[1]], pair[1], pair[1] in self.exact_search()) for pair in self.column_order() if pair[0]]) ####################################################################