diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index a60eac7c2..34e0ea5d0 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,5 @@ 2005-05-15 Don Allingham + * 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 diff --git a/gramps2/src/ChooseParents.py b/gramps2/src/ChooseParents.py index a475e63cc..7673b6127 100644 --- a/gramps2/src/ChooseParents.py +++ b/gramps2/src/ChooseParents.py @@ -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)