From cb7227f692dbc56a777242598fb1d20f3170bc69 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Sun, 7 Mar 2010 19:38:48 +0000 Subject: [PATCH] 3175: Crash when undoing a family edit- part of undo being slow svn: r14676 --- src/plugins/view/pedigreeview.py | 9 ++-- src/plugins/view/relview.py | 78 ++++++++++++++++++++------------ 2 files changed, 54 insertions(+), 33 deletions(-) diff --git a/src/plugins/view/pedigreeview.py b/src/plugins/view/pedigreeview.py index 10d5b1584..1a42dc6bf 100644 --- a/src/plugins/view/pedigreeview.py +++ b/src/plugins/view/pedigreeview.py @@ -566,9 +566,12 @@ class PedigreeView(NavigationView): self.bookmarks.redraw() def person_rebuild(self,dummy=None): - self.format_helper.clear_cache() - self.dirty = True - self.rebuild_trees(self.get_active()) + if self.active: + self.format_helper.clear_cache() + self.dirty = True + self.rebuild_trees(self.get_active()) + else: + self.dirty = True def request_resize(self): self.size_request_cb(self.notebook.parent,None,None) diff --git a/src/plugins/view/relview.py b/src/plugins/view/relview.py index 288e4e911..e225d9809 100644 --- a/src/plugins/view/relview.py +++ b/src/plugins/view/relview.py @@ -211,55 +211,72 @@ class RelationshipView(NavigationView): self.redraw() def person_update(self, handle_list): - person = self.get_active() - if person: - while not self.change_person(person): - pass + if self.active: + person = self.get_active() + if person: + while not self.change_person(person): + pass + else: + self.change_person(None) else: - self.change_person(None) + self.dirty = True def person_rebuild(self): """Large change to person database""" if self.active: self.bookmarks.redraw() - person = self.get_active() - if person: - while not self.change_person(person): - pass + person = self.get_active() + if person: + while not self.change_person(person): + pass + else: + self.change_person(None) else: - self.change_person(None) + self.dirty = True def family_update(self, handle_list): - person = self.get_active() - if person: - while not self.change_person(person): - pass + if self.active: + person = self.get_active() + if person: + while not self.change_person(person): + pass + else: + self.change_person(None) else: - self.change_person(None) + self.dirty = True def family_add(self, handle_list): - person = self.get_active() - if person: - while not self.change_person(person): - pass + if self.active: + person = self.get_active() + if person: + while not self.change_person(person): + pass + else: + self.change_person(None) else: - self.change_person(None) + self.dirty = True def family_delete(self, handle_list): - person = self.get_active() - if person: - while not self.change_person(person): - pass + if self.active: + person = self.get_active() + if person: + while not self.change_person(person): + pass + else: + self.change_person(None) else: - self.change_person(None) + self.dirty = True def family_rebuild(self): - person = self.get_active() - if person: - while not self.change_person(person): - pass + if self.active: + person = self.get_active() + if person: + while not self.change_person(person): + pass + else: + self.change_person(None) else: - self.change_person(None) + self.dirty = True def change_page(self): NavigationView.change_page(self) @@ -553,6 +570,7 @@ class RelationshipView(NavigationView): self.uistate.modify_statusbar(self.dbstate) self.order_action.set_sensitive(self.reorder_sensitive) + self.dirty = False return True