From 29d18998d1538fc5a0e707559b41ff7596890ce8 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 29 Jun 2004 03:51:49 +0000 Subject: [PATCH] * src/ChooseParents.py: fix parent selection * src/FamilyView.py: fix update of parents after selction * src/PeopleView.py: fix update of parents after selction * src/gramps_main.py: fix update of parents after selction * src/EditPerson.py: fix person id reference svn: r3244 --- ChangeLog | 7 +++++++ src/ChooseParents.py | 2 ++ src/EditPerson.py | 5 +++-- src/FamilyView.py | 12 +++++------- src/PeopleView.py | 6 ++---- src/gramps_main.py | 12 ++++-------- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48108501c..c2d090eda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-06-28 Don Allingham + * src/ChooseParents.py: fix parent selection + * src/FamilyView.py: fix update of parents after selction + * src/PeopleView.py: fix update of parents after selction + * src/gramps_main.py: fix update of parents after selction + * src/EditPerson.py: fix person id reference + 2004-06-28 Alex Roitman * src/DbPrompter.py: Add new class for new, existing, and import prompters. Enable opening any format on the startup. diff --git a/src/ChooseParents.py b/src/ChooseParents.py index ebee95dd8..2270eadc6 100644 --- a/src/ChooseParents.py +++ b/src/ChooseParents.py @@ -299,6 +299,7 @@ class ChooseParents: def redrawf(self): """Redraws the potential father list""" self.father_nsort = PeopleModel.PeopleModel(self.db) + self.father_nsort.rebuild_data() self.father_model = gtk.TreeModelSort(self.father_nsort) self.father_list.set_model(self.father_model) @@ -310,6 +311,7 @@ class ChooseParents: def redrawm(self): """Redraws the potential mother list""" self.mother_nsort = PeopleModel.PeopleModel(self.db) + self.mother_nsort.rebuild_data() self.mother_model = gtk.TreeModelSort(self.mother_nsort) self.mother_list.set_model(self.mother_model) diff --git a/src/EditPerson.py b/src/EditPerson.py index 167e83e08..1f91a9a6e 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -1777,7 +1777,7 @@ class EditPerson: """Reorder the child list to put the specified person in his/her correct birth order. Only check *valid* birthdates. Move the person as short a distance as possible.""" - + if (self.birth_dates_in_order(list)): return(list) @@ -1790,7 +1790,8 @@ class EditPerson: person_bday = "99999999" # First, see if the person needs to be moved forward in the list - index = list.index(person) + + index = list.index(person.get_id()) target = index for i in range(index-1, -1, -1): other = self.db.try_to_find_person_from_id(list[i]) diff --git a/src/FamilyView.py b/src/FamilyView.py index d58a601d8..6919b237d 100644 --- a/src/FamilyView.py +++ b/src/FamilyView.py @@ -617,13 +617,13 @@ class FamilyView: except: DisplayTrace.DisplayTrace() - def spouse_after_edit(self,ep,trans): + def spouse_after_edit(self,epo,trans): ap = self.parent.active_person if epo: self.parent.db.commit_person(epo.person,trans) n = epo.person.get_primary_name().get_regular_name() self.parent.db.add_transaction(trans,_("Add Person (%s)") % n) - self.parent.people_view.remove_from_person_list(epo.person,epo.original_id) + self.parent.people_view.remove_from_person_list(epo.person) self.parent.people_view.redisplay_person_list(epo.person) self.parent.active_person = ap @@ -679,7 +679,8 @@ class FamilyView: person.get_primary_name().set_surname_prefix(name[0]) try: - EditPerson.EditPerson(self.parent, person, self.parent.db, self.new_child_after_edit) + EditPerson.EditPerson(self.parent, person, self.parent.db, + self.new_child_after_edit) except: DisplayTrace.DisplayTrace() @@ -1050,13 +1051,10 @@ class FamilyView: i += 1 event = self.parent.db.find_event_from_id(val[3]) - print event.serialize() if event: dval = event.get_date() else: dval = u'' - - print i,val[0],val[1],val[2],dval,status,val[3],child.get_id() self.child_model.set(iter,0,i,1,val[0],2,val[1],3,val[2], 4,dval,5,status,6,val[6],7,child.get_id()) @@ -1395,7 +1393,7 @@ class FamilyView: child_id = list[i] child = self.parent.db.try_to_find_person_from_id(child_id) birth_id = child.get_birth_id() - birth = self.parent.db.try_to_find_event_from_id(birth_id) + birth = self.parent.db.find_event_from_id(birth_id) if not birth: continue bday = birth.get_date_object() diff --git a/src/PeopleView.py b/src/PeopleView.py index c5631d945..a872ed006 100644 --- a/src/PeopleView.py +++ b/src/PeopleView.py @@ -158,12 +158,10 @@ class PeopleView: self.sort_model.set_visible_column(PeopleModel.COLUMN_VIEW) self.person_tree.set_model(self.sort_model) - def remove_from_person_list(self,person,old_id=None): + def remove_from_person_list(self,person): """Remove the selected person from the list. A person object is expected, not an ID""" - if old_id == None: - old_id = person.get_id() - path = self.person_model.on_get_path(old_id) + path = self.person_model.on_get_path(person.get_id()) self.person_model.row_deleted(path) def remove_from_history(self,person_id,old_id=None): diff --git a/src/gramps_main.py b/src/gramps_main.py index e7863fc45..2f8a1a962 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -918,6 +918,10 @@ class Gramps: self.import_tool_callback() def import_tool_callback(self): + self.full_update() + + def full_update(self): + """Brute force display update, updating all the pages""" self.people_view.person_model.rebuild_data() if Utils.wasHistory_broken(): self.clear_history() @@ -932,14 +936,6 @@ class Gramps: self.place_view.change_db(self.db) self.source_view.change_db(self.db) self.media_view.change_db(self.db) - - def full_update(self): - """Brute force display update, updating all the pages""" - self.place_view.change_db(self.db) - self.people_view.change_db(self.db) - self.source_view.change_db(self.db) - self.media_view.change_db(self.db) - self.toolbar.set_style(GrampsCfg.toolbar) def update_display(self,changed): """Incremental display update, update only the displayed page"""