From e02e3d29f477b82d37159fc7f613952c54cb24e3 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 20 Jan 2007 04:22:31 +0000 Subject: [PATCH] 2007-01-19 Don Allingham * src/DataViews/_FamilyList.py: remove loop * src/PageView.py: check for null model svn: r7935 --- gramps2/ChangeLog | 4 +++ gramps2/src/DataViews/_FamilyList.py | 42 ++-------------------------- gramps2/src/PageView.py | 4 ++- 3 files changed, 10 insertions(+), 40 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index ab1520ee8..126cbba9c 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2007-01-19 Don Allingham + * src/DataViews/_FamilyList.py: remove loop + * src/PageView.py: check for null model + 2007-01-19 Alex Roitman * src/GrampsDb/_GrampsInMemDB.py: Support the cached surname list. * src/GrampsDb/_GrampsBSDDB.py: Support the cached surname list. diff --git a/gramps2/src/DataViews/_FamilyList.py b/gramps2/src/DataViews/_FamilyList.py index 14e991fb3..efc6c2936 100644 --- a/gramps2/src/DataViews/_FamilyList.py +++ b/gramps2/src/DataViews/_FamilyList.py @@ -71,9 +71,9 @@ class FamilyListView(PageView.ListView): def __init__(self, dbstate, uistate): signal_map = { - 'family-add' : self.family_add, - 'family-update' : self.family_update, - 'family-delete' : self.family_delete, + 'family-add' : self.row_add, + 'family-update' : self.row_update, + 'family-delete' : self.row_delete, 'family-rebuild' : self.build_tree, } @@ -177,42 +177,6 @@ class FamilyListView(PageView.ListView): except Errors.WindowActiveError: pass - def family_add(self, handle_list): - while not self.family_add_loop(handle_list): - pass - - def family_update(self, handle_list): - while not self.family_update_loop(handle_list): - pass - - def family_delete(self, handle_list): - while not self.family_delete_loop(handle_list): - pass - - def family_add_loop(self, handle_list): - if self.updating: - return False - self.updating = True - self.row_add(handle_list) - self.updating = False - return True - - def family_update_loop(self, handle_list): - if self.updating: - return False - self.updating = True - self.row_update(handle_list) - self.updating = False - return True - - def family_delete_loop(self, handle_list): - if self.updating: - return False - self.updating = True - self.row_delete(handle_list) - self.updating = False - return True - def remove(self, obj): import GrampsDb diff --git a/gramps2/src/PageView.py b/gramps2/src/PageView.py index 0f2993ba5..e29e6a17a 100644 --- a/gramps2/src/PageView.py +++ b/gramps2/src/PageView.py @@ -71,6 +71,7 @@ class PageView: self.additional_action_groups = [] self.additional_uis = [] self.widget = None + self.model = None self.ui = '' self.dbstate.connect('no-database',self.disable_action_group) self.dbstate.connect('database-changed',self.enable_action_group) @@ -744,7 +745,8 @@ class ListView(BookMarkView): self.dirty = True def row_update(self,handle_list): - self.model.prev_handle = None + if self.model: + self.model.prev_handle = None if self.active: for handle in handle_list: self.model.update_row_by_handle(handle)