From fbe04615f57072e9bea4722243c95b95010df656 Mon Sep 17 00:00:00 2001 From: Zsolt Foldvari Date: Sun, 4 Feb 2007 23:59:03 +0000 Subject: [PATCH] 2007-02-05 Zsolt Foldvari * src/GrampsDb/_GrampsBSDDB.py: load/save db owner info * src/GrampsDb/_DbUtils.py (db_copy): copy also db owner svn: r8057 --- ChangeLog | 4 ++++ src/GrampsDb/_DbUtils.py | 3 +++ src/GrampsDb/_GrampsBSDDB.py | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9b8ca038e..3d302c624 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-02-05 Zsolt Foldvari + * src/GrampsDb/_GrampsBSDDB.py: load/save db owner info + * src/GrampsDb/_DbUtils.py (db_copy): copy also db owner + 2007-02-04 Zsolt Foldvari * src/plugins/OwnerEditor.py: include $Id$ diff --git a/src/GrampsDb/_DbUtils.py b/src/GrampsDb/_DbUtils.py index 166dad7c5..748e2d796 100644 --- a/src/GrampsDb/_DbUtils.py +++ b/src/GrampsDb/_DbUtils.py @@ -273,6 +273,9 @@ def db_copy(from_db,to_db,callback): # Copy name formats to_db.name_formats = from_db.name_formats + # Copy db owner + to_db.owner = from_db.owner + def set_birth_death_index(db, person): birth_ref_index = -1 death_ref_index = -1 diff --git a/src/GrampsDb/_GrampsBSDDB.py b/src/GrampsDb/_GrampsBSDDB.py index c155ea08d..d1de9f483 100644 --- a/src/GrampsDb/_GrampsBSDDB.py +++ b/src/GrampsDb/_GrampsBSDDB.py @@ -467,6 +467,10 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): if len(format) == 3: format = format + (True,) self.name_formats[format_ix] = format + + # database owner + self.set_researcher(self.metadata.get('researcher', default=self.owner)) + # bookmarks self.bookmarks.set(self.metadata.get('bookmarks',default=[])) self.family_bookmarks.set(self.metadata.get('family_bookmarks', @@ -481,6 +485,7 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): default=[])) self.place_bookmarks.set(self.metadata.get('place_bookmarks', default=[])) + # Custom type values self.family_event_names = set(self.metadata.get('fevent_names', default=[])) @@ -505,6 +510,7 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): self.url_types = set(self.metadata.get('url_types',default=[])) self.media_attributes = set(self.metadata.get('mattr_names', default=[])) + # surname list self.surname_list = self.metadata.get('surname_list',default=[]) @@ -989,6 +995,9 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): # name display formats self.metadata.put('name_formats',self.name_formats,txn=the_txn) + + # database owner + self.metadata.put('researcher', self.owner, txn=the_txn) # bookmarks self.metadata.put('bookmarks',self.bookmarks.get(),txn=the_txn)