From 979bdc68087281dc6d7daecd45d82cdbd5f17b90 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 24 Nov 2003 02:56:13 +0000 Subject: [PATCH] * src/gramps_main.py: just update information after an edit instead of deleting/re-enter. Caused pygtk to segfault * src/PeopleView.py: provide update person function * src/dialog.glade: remove unused callbacks svn: r2367 --- gramps2/src/PeopleView.py | 18 ++++++++++++++++++ gramps2/src/dialog.glade | 2 -- gramps2/src/gramps_main.py | 3 +-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/gramps2/src/PeopleView.py b/gramps2/src/PeopleView.py index 5c70c7801..10963ed1a 100644 --- a/gramps2/src/PeopleView.py +++ b/gramps2/src/PeopleView.py @@ -397,3 +397,21 @@ class PeopleView: def redisplay_person_list(self,person): self.add_to_person_list(person,1) + + def update_person_list(self,person,old_id): + key = person.getId() + if old_id != key: + (model,iter) = self.id2col[old_id] + del self.id2col[old_id] + self.id2col[key] = (model,iter) + else: + (model,iter) = self.id2col[key] + + val = self.parent.db.getPersonDisplay(person.getId()) + pg = unicode(val[5]) + pg = pg[0] + if self.DataFilter.compare(person): + col = 0 + for object in val[:-1]: + model.model.set_value(iter,col,object) + col = col + 1 diff --git a/gramps2/src/dialog.glade b/gramps2/src/dialog.glade index a61850682..a627b7ebe 100644 --- a/gramps2/src/dialog.glade +++ b/gramps2/src/dialog.glade @@ -928,7 +928,6 @@ True GTK_RELIEF_NORMAL -6 - @@ -942,7 +941,6 @@ True GTK_RELIEF_NORMAL -5 - diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index ee8679ec3..132c827c2 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -1586,8 +1586,7 @@ class Gramps: def update_after_edit(self,epo,plist): if epo: self.db.buildPersonDisplay(epo.person.getId(),epo.original_id) - self.people_view.remove_from_person_list(epo.person,epo.original_id) - self.people_view.redisplay_person_list(epo.person) + self.people_view.update_person_list(epo.person,epo.original_id) for p in plist: self.place_view.new_place_after_edit(p) self.update_display(0)