0009014: "Show all" checkbox of "Select Family - Gramps" window not unchecked when the filter is cleared
This commit is contained in:
parent
95062b7f46
commit
b3140d9bd9
@ -42,9 +42,10 @@ _KP_ENTER = Gdk.keyval_from_name("KP_Enter")
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class SearchBar(object):
|
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.on_apply_callback = on_apply
|
||||||
self.apply_done_callback = apply_done
|
self.apply_done_callback = apply_done
|
||||||
|
self.apply_clear_callback = apply_clear
|
||||||
self.dbstate = dbstate
|
self.dbstate = dbstate
|
||||||
self.uistate = uistate
|
self.uistate = uistate
|
||||||
self.apply_text = ''
|
self.apply_text = ''
|
||||||
@ -151,6 +152,8 @@ class SearchBar(object):
|
|||||||
def apply_clear(self, obj):
|
def apply_clear(self, obj):
|
||||||
self.filter_text.set_text('')
|
self.filter_text.set_text('')
|
||||||
self.apply_filter()
|
self.apply_filter()
|
||||||
|
if self.apply_clear_callback is not None:
|
||||||
|
self.apply_clear_callback()
|
||||||
|
|
||||||
def get_value(self):
|
def get_value(self):
|
||||||
text = str(self.filter_text.get_text()).strip()
|
text = str(self.filter_text.get_text()).strip()
|
||||||
|
@ -92,7 +92,7 @@ class BaseSelector(ManagedWindow):
|
|||||||
self.tree.connect('key-press-event', self.searchbox.treeview_keypress)
|
self.tree.connect('key-press-event', self.searchbox.treeview_keypress)
|
||||||
|
|
||||||
#add the search bar
|
#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()
|
filter_box = self.search_bar.build()
|
||||||
self.setup_filter()
|
self.setup_filter()
|
||||||
vbox.pack_start(filter_box, False, False, 0)
|
vbox.pack_start(filter_box, False, False, 0)
|
||||||
@ -348,6 +348,9 @@ class BaseSelector(ManagedWindow):
|
|||||||
self.model.destroy()
|
self.model.destroy()
|
||||||
self.model = None
|
self.model = None
|
||||||
|
|
||||||
|
def apply_clear(self):
|
||||||
|
self.showall.set_active(False)
|
||||||
|
|
||||||
def _cleanup_on_exit(self):
|
def _cleanup_on_exit(self):
|
||||||
"""Unset all things that can block garbage collection.
|
"""Unset all things that can block garbage collection.
|
||||||
Finalize rest
|
Finalize rest
|
||||||
|
Loading…
x
Reference in New Issue
Block a user