* src/ChooseParents.py: redraw window properly after person add

svn: r4598
This commit is contained in:
Don Allingham 2005-05-16 04:06:28 +00:00
parent 9c37651ddf
commit 1d1fab4eb9
2 changed files with 14 additions and 2 deletions

View File

@ -1,4 +1,5 @@
2005-05-15 Don Allingham <don@gramps-project.org>
* src/ChooseParents.py: redraw window properly after person add
* src/DisplayModels.py: provide sorting support
* src/PlaceView.py: add sorting by columns
* src/SourceView.py: add sorting by columns

View File

@ -90,6 +90,11 @@ class ChooseParents:
self.parent_selected = 0
self.renderer = gtk.CellRendererText()
db.connect('person-add', self.redraw)
db.connect('person-update', self.redraw)
db.connect('person-delete', self.redraw)
db.connect('person-rebuild', self.redraw2)
# set default filters
self.all_males_filter = GenericFilter.GenericFilter()
self.all_males_filter.add_rule(GenericFilter.IsMale([]))
@ -278,6 +283,14 @@ class ChooseParents:
"""Display the relevant portion of GRAMPS manual"""
gnome.help_display('gramps-manual','gramps-edit-quick')
def redraw(self,handle_list):
self.father_model.rebuild_data()
self.mother_model.rebuild_data()
def redraw2(self):
self.father_model.rebuild_data()
self.mother_model.rebuild_data()
def redrawf(self):
"""Redraws the potential father list"""
self.father_model = PeopleModel.PeopleModel(self.db,self.father_filter)
@ -505,14 +518,12 @@ class ChooseParents:
if self.type == RelLib.Family.CIVIL_UNION:
self.parent_relation_changed(self.prel)
elif person.get_gender() == RelLib.Person.MALE:
self.redrawf()
path = self.father_model.on_get_path(handle)
top_path = self.father_model.on_get_path(name)
self.father_list.expand_row(top_path,0)
self.father_selection.select_path(path)
self.father_list.scroll_to_cell(path,None,1,0.5,0)
else:
self.redrawm()
path = self.mother_model.on_get_path(handle)
top_path = self.mother_model.on_get_path(name)
self.mother_list.expand_row(top_path,0)