0009014: "Show all" checkbox of "Select Family - Gramps" window not unchecked when the filter is cleared

This commit is contained in:
SNoiraud 2015-11-01 12:56:43 +01:00
parent 95062b7f46
commit b3140d9bd9
2 changed files with 8 additions and 2 deletions

View File

@ -42,9 +42,10 @@ _KP_ENTER = Gdk.keyval_from_name("KP_Enter")
#
#-------------------------------------------------------------------------
class SearchBar(object):
def __init__( self, dbstate, uistate, on_apply, apply_done = None):
def __init__( self, dbstate, uistate, on_apply, apply_done = None, apply_clear = None):
self.on_apply_callback = on_apply
self.apply_done_callback = apply_done
self.apply_clear_callback = apply_clear
self.dbstate = dbstate
self.uistate = uistate
self.apply_text = ''
@ -151,6 +152,8 @@ class SearchBar(object):
def apply_clear(self, obj):
self.filter_text.set_text('')
self.apply_filter()
if self.apply_clear_callback is not None:
self.apply_clear_callback()
def get_value(self):
text = str(self.filter_text.get_text()).strip()

View File

@ -92,7 +92,7 @@ class BaseSelector(ManagedWindow):
self.tree.connect('key-press-event', self.searchbox.treeview_keypress)
#add the search bar
self.search_bar = SearchBar(dbstate, uistate, self.build_tree)
self.search_bar = SearchBar(dbstate, uistate, self.build_tree, apply_clear=self.apply_clear)
filter_box = self.search_bar.build()
self.setup_filter()
vbox.pack_start(filter_box, False, False, 0)
@ -348,6 +348,9 @@ class BaseSelector(ManagedWindow):
self.model.destroy()
self.model = None
def apply_clear(self):
self.showall.set_active(False)
def _cleanup_on_exit(self):
"""Unset all things that can block garbage collection.
Finalize rest