From ca5a7367e2e57dc3a20a68d8af5c79970a4819ba Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 3 Oct 2007 16:34:51 +0000 Subject: [PATCH] 2007-10-03 Benny Malengier * src/DataViews/_PedigreeView.py: correctly load bookmarks, issue 1271 * src/DataViews/_RelationView.py: correctly load bookmarks, issue 1271 * src/PageView.py: correct bug not going to bookmark if no active person * src/DataViews/_MediaView.py: * src/DataViews/_NoteView.py: * src/DataViews/_RepositoryView.py: * src/DataViews/_SourceView.py: * src/DataViews/_EventView.py: * src/DataViews/_FamilyList.py: * src/DataViews/_PedigreeView.py: * src/DataViews/_PlaceView.py: * src/DataViews/_PersonView.py: * src/DataViews/_RelationView.py: after import, redraw bookmark menu svn: r9065 --- ChangeLog | 16 ++++++++++++++++ src/DataViews/_EventView.py | 2 +- src/DataViews/_FamilyList.py | 2 +- src/DataViews/_MediaView.py | 2 +- src/DataViews/_NoteView.py | 2 +- src/DataViews/_PedigreeView.py | 14 ++++++++++---- src/DataViews/_PersonView.py | 8 +++++++- src/DataViews/_PlaceView.py | 2 +- src/DataViews/_RelationView.py | 6 +++++- src/DataViews/_RepositoryView.py | 2 +- src/DataViews/_SourceView.py | 2 +- src/PageView.py | 14 ++++++++++---- 12 files changed, 55 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 170274159..c7141ceb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2007-10-03 Benny Malengier + * src/DataViews/_PedigreeView.py: correctly load bookmarks, issue 1271 + * src/DataViews/_RelationView.py: correctly load bookmarks, issue 1271 + * src/PageView.py: correct bug not going to bookmark if no active person + * src/DataViews/_MediaView.py: + * src/DataViews/_NoteView.py: + * src/DataViews/_RepositoryView.py: + * src/DataViews/_SourceView.py: + * src/DataViews/_EventView.py: + * src/DataViews/_FamilyList.py: + * src/DataViews/_PedigreeView.py: + * src/DataViews/_PlaceView.py: + * src/DataViews/_PersonView.py: + * src/DataViews/_RelationView.py: + after import, redraw bookmark menu + 2007-10-02 Benny Malengier * src/DateEdit.py: resolve issue #1270, date edit not closing diff --git a/src/DataViews/_EventView.py b/src/DataViews/_EventView.py index c4a1c1f4b..8c0a3f72e 100644 --- a/src/DataViews/_EventView.py +++ b/src/DataViews/_EventView.py @@ -83,7 +83,7 @@ class EventView(PageView.ListView): 'event-add' : self.row_add, 'event-update' : self.row_update, 'event-delete' : self.row_delete, - 'event-rebuild' : self.build_tree, + 'event-rebuild' : self.object_build, } self.func_list = { diff --git a/src/DataViews/_FamilyList.py b/src/DataViews/_FamilyList.py index 53c310198..f18277d56 100644 --- a/src/DataViews/_FamilyList.py +++ b/src/DataViews/_FamilyList.py @@ -76,7 +76,7 @@ class FamilyListView(PageView.ListView): 'family-add' : self.row_add, 'family-update' : self.row_update, 'family-delete' : self.row_delete, - 'family-rebuild' : self.build_tree, + 'family-rebuild' : self.object_build, } self.func_list = { diff --git a/src/DataViews/_MediaView.py b/src/DataViews/_MediaView.py index 7d5e2d0b3..b313b54c1 100644 --- a/src/DataViews/_MediaView.py +++ b/src/DataViews/_MediaView.py @@ -101,7 +101,7 @@ class MediaView(PageView.ListView): 'media-add' : self.row_add, 'media-update' : self.row_update, 'media-delete' : self.row_delete, - 'media-rebuild' : self.build_tree, + 'media-rebuild' : self.object_build, } PageView.ListView.__init__( diff --git a/src/DataViews/_NoteView.py b/src/DataViews/_NoteView.py index 0c64603df..cfb4f0431 100644 --- a/src/DataViews/_NoteView.py +++ b/src/DataViews/_NoteView.py @@ -84,7 +84,7 @@ class NoteView(PageView.ListView): 'note-add' : self.row_add, 'note-update' : self.row_update, 'note-delete' : self.row_delete, - 'note-rebuild' : self.build_tree, + 'note-rebuild' : self.object_build, } self.func_list = { diff --git a/src/DataViews/_PedigreeView.py b/src/DataViews/_PedigreeView.py index 3797b8875..a12017822 100644 --- a/src/DataViews/_PedigreeView.py +++ b/src/DataViews/_PedigreeView.py @@ -622,16 +622,16 @@ class PedigreeView(PageView.PersonNavView): db.connect('person-add', self.person_rebuild) db.connect('person-update', self.person_rebuild) db.connect('person-delete', self.person_rebuild) - db.connect('person-rebuild', self.person_rebuild) + db.connect('person-rebuild', self.person_rebuild_bm) db.connect('family-update', self.person_rebuild) db.connect('family-add', self.person_rebuild) db.connect('family-delete', self.person_rebuild) db.connect('family-rebuild', self.person_rebuild) self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks()) - if self.dbstate.active: + if self.active: self.bookmarks.redraw() self.build_tree() - + def goto_active_person(self,handle=None): self.dirty = True if handle: @@ -640,7 +640,13 @@ class PedigreeView(PageView.PersonNavView): else: self.rebuild_trees(None) self.uistate.modify_statusbar(self.dbstate) - + + def person_rebuild_bm(self,dummy=None): + """Large change to person database""" + self.person_rebuild(dummy) + if self.active: + self.bookmarks.redraw() + def person_rebuild(self,dummy=None): self.format_helper.clear_cache() self.dirty = True diff --git a/src/DataViews/_PersonView.py b/src/DataViews/_PersonView.py index 7ca182798..87bbf9d8a 100644 --- a/src/DataViews/_PersonView.py +++ b/src/DataViews/_PersonView.py @@ -431,7 +431,7 @@ class PersonView(PageView.PersonNavView): db.connect('person-add', self.person_added) db.connect('person-update', self.person_updated) db.connect('person-delete', self.person_removed) - db.connect('person-rebuild', self.build_tree) + db.connect('person-rebuild', self.person_rebuild) if self.active: self.build_tree() @@ -743,6 +743,12 @@ class PersonView(PageView.PersonNavView): def func(self, tree, path, ex_list): ex_list.append(self.model.mapper.top_path2iter[path[0]]) + def person_rebuild(self): + """Large change to person database""" + if self.active: + self.bookmarks.redraw() + self.build_tree() + def person_removed(self, handle_list): if not self.model: return diff --git a/src/DataViews/_PlaceView.py b/src/DataViews/_PlaceView.py index f0c1998bf..6dd34bae8 100644 --- a/src/DataViews/_PlaceView.py +++ b/src/DataViews/_PlaceView.py @@ -91,7 +91,7 @@ class PlaceView(PageView.ListView): 'place-add' : self.row_add, 'place-update' : self.row_update, 'place-delete' : self.row_delete, - 'place-rebuild' : self.build_tree, + 'place-rebuild' : self.object_build, } self.func_list = { diff --git a/src/DataViews/_RelationView.py b/src/DataViews/_RelationView.py index b96d04fb2..4a33f2fae 100644 --- a/src/DataViews/_RelationView.py +++ b/src/DataViews/_RelationView.py @@ -176,6 +176,9 @@ class RelationshipView(PageView.PersonNavView): self.change_person(None) def person_rebuild(self): + """Large change to person database""" + if self.active: + self.bookmarks.redraw() if self.dbstate.active: while not self.change_person(self.dbstate.active.handle): pass @@ -368,7 +371,8 @@ class RelationshipView(PageView.PersonNavView): self.dbstate.db.connect('person-add', self.redraw) self.dbstate.db.connect('person-delete', self.redraw) self.bookmarks.update_bookmarks(db.get_bookmarks()) - self.bookmarks.redraw() + if self.active: + self.bookmarks.redraw() self.redraw() def get_name(self, handle, use_gender=False): diff --git a/src/DataViews/_RepositoryView.py b/src/DataViews/_RepositoryView.py index a5c09dafd..a7c560d39 100644 --- a/src/DataViews/_RepositoryView.py +++ b/src/DataViews/_RepositoryView.py @@ -92,7 +92,7 @@ class RepositoryView(PageView.ListView): 'repository-add' : self.row_add, 'repository-update' : self.row_update, 'repository-delete' : self.row_delete, - 'repository-rebuild' : self.build_tree, + 'repository-rebuild' : self.object_build, } self.func_list = { diff --git a/src/DataViews/_SourceView.py b/src/DataViews/_SourceView.py index 223feac87..b72b7e8b5 100644 --- a/src/DataViews/_SourceView.py +++ b/src/DataViews/_SourceView.py @@ -85,7 +85,7 @@ class SourceView(PageView.ListView): 'source-add' : self.row_add, 'source-update' : self.row_update, 'source-delete' : self.row_delete, - 'source-rebuild' : self.build_tree, + 'source-rebuild' : self.object_build, } self.func_list = { diff --git a/src/PageView.py b/src/PageView.py index 873e453b3..0a8eacb49 100644 --- a/src/PageView.py +++ b/src/PageView.py @@ -745,14 +745,13 @@ class ListView(BookMarkView): self.search_bar.setup_filter(cols) def goto_handle(self, handle): - if not self.dbstate.active or self.inactive: + if not handle or self.inactive: return - # mark inactive to prevent recusion + # mark inactive to prevent recursion self.inactive = True - # select the active person in the person view - + # select the handle in the view try: path = self.model.on_get_path(handle) self.selection.unselect_all() @@ -848,6 +847,13 @@ class ListView(BookMarkView): self.model.total) else: self.dirty = True + + def object_build(self): + """callback, for if tree must be rebuild and bookmarks redrawn + """ + if self.active: + self.bookmarks.redraw() + self.build_tree() def filter_toggle_action(self, obj): if obj.get_active():