diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index c49e101d8..70b82da16 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,10 @@ +2005-02-19 Don Allingham + * src/EditPerson.py: add privacy marker + * src/GrampBSDDB.py: record database version, handle person privacy flag + * src/RelLIb.py: Privacy flag for person (inherit from DataObj instead of SourceNote) + * src/ReportUtils.py: update to use person privacy flag + * src/gramps.glade: person privacy flag + 2005-02-19 Alex Roitman * src/ArgHandler.py: Command line support for geneweb import and export; Fix command line exports for gedcom, XML, and package. diff --git a/gramps2/src/EditPerson.py b/gramps2/src/EditPerson.py index 92fe0760d..c56ae024e 100644 --- a/gramps2/src/EditPerson.py +++ b/gramps2/src/EditPerson.py @@ -142,6 +142,8 @@ class EditPerson: self.complete = self.get_widget('complete') self.complete.set_sensitive(mod) + self.private = self.get_widget('private') + self.private.set_sensitive(mod) self.name_delete_btn = self.top.get_widget('aka_delete') self.name_edit_btn = self.top.get_widget('aka_edit') self.web_delete_btn = self.top.get_widget('delete_url') @@ -246,7 +248,8 @@ class EditPerson: self.person_photo = self.get_widget("personPix") self.eventbox = self.get_widget("eventbox1") - self.get_widget("changed").set_text(person.get_change_display()) + self.get_widget("birth_stat").set_sensitive(mod) + self.get_widget("death_stat").set_sensitive(mod) self.prefix_label = self.get_widget('prefix_label') @@ -478,8 +481,8 @@ class EditPerson: self.top.get_widget('edit_src'), self.top.get_widget('del_src')) - if self.person.get_complete_flag(): - self.complete.set_active(1) + self.complete.set_active(self.person.get_complete_flag()) + self.private.set_active(self.person.get_privacy()) self.eventbox.connect('button-press-event',self.image_button_press) @@ -1509,6 +1512,8 @@ class EditPerson: if self.complete.get_active() != self.person.get_complete_flag(): changed = True + if self.private.get_active() != self.person.get_privacy(): + changed = True if self.person.get_gramps_id() != idval: changed = True @@ -1999,8 +2004,8 @@ class EditPerson: if format != self.person.get_note_format(): self.person.set_note_format(format) - if self.complete.get_active() != self.person.get_complete_flag(): - self.person.set_complete_flag(self.complete.get_active()) + self.person.set_complete_flag(self.complete.get_active()) + self.person.set_privacy(self.private.get_active()) if not self.lds_not_loaded: self.check_lds() diff --git a/gramps2/src/GrampsBSDDB.py b/gramps2/src/GrampsBSDDB.py index 8299aad92..a7847d488 100644 --- a/gramps2/src/GrampsBSDDB.py +++ b/gramps2/src/GrampsBSDDB.py @@ -33,6 +33,8 @@ from RelLib import * from GrampsDbBase import * from bsddb import dbshelve, db +_DBVERSION = 1 + def find_surname(key,data): return str(data[3].get_surname()) @@ -166,7 +168,11 @@ class GrampsBSDDB(GrampsDbBase): self.event_map.associate(self.eventnames, find_eventname, openflags) self.undodb = db.DB() self.undodb.open(self.undolog, db.DB_RECNO, db.DB_CREATE) - + + if self.metadata.get('version') == None: + self.metadata['version'] == _DBVERSION + + self.metadata = self.dbopen(name, "meta") self.bookmarks = self.metadata.get('bookmarks') if self.bookmarks == None: self.bookmarks = [] diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index da58d71b7..5beb9d63b 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -297,7 +297,7 @@ class DataObj(SourceNote): """ return self.private -class Person(PrimaryObject,SourceNote): +class Person(PrimaryObject,DataObj): """ Introduction ============ @@ -332,6 +332,7 @@ class Person(PrimaryObject,SourceNote): handle. """ PrimaryObject.__init__(self) + DataObj.__init__(self) SourceNote.__init__(self) self.primary_name = Name() self.event_list = [] @@ -350,7 +351,8 @@ class Person(PrimaryObject,SourceNote): self.lds_endow = None self.lds_seal = None self.complete = False - + self.private = False + # We hold a reference to the GrampsDB so that we can maintain # its genderStats. It doesn't get set here, but from # GenderStats.count_person. @@ -378,7 +380,8 @@ class Person(PrimaryObject,SourceNote): self.event_list, self.family_list, self.parent_family_list, self.media_list, self.address_list, self.attribute_list, self.urls, self.lds_bapt, self.lds_endow, self.lds_seal, - self.complete, self.source_list, self.note, self.change) + self.complete, self.source_list, self.note, self.change, + self.private) def unserialize(self,data): """ @@ -395,7 +398,7 @@ class Person(PrimaryObject,SourceNote): self.parent_family_list, self.media_list, self.address_list, self.attribute_list, self.urls, self.lds_bapt, self.lds_endow, self.lds_seal, self.complete, self.source_list, self.note, - self.change) = data + self.change,self.private) = (data + (False,))[0:23] def set_complete_flag(self,val): """ diff --git a/gramps2/src/ReportUtils.py b/gramps2/src/ReportUtils.py index 90decceac..6585ed87d 100644 --- a/gramps2/src/ReportUtils.py +++ b/gramps2/src/ReportUtils.py @@ -260,15 +260,24 @@ def sanitize_person(db,person): @rtype: Person """ new_person = RelLib.Person() - name = person.get_primary_name() # copy gender new_person.set_gender(person.get_gender()) # copy names if not private - if not name.get_privacy(): - new_person.set_primary_name(name) + if name.get_privacy() or person.get_privacy(): + name = RelLib.Name() + name.set_first_name(_('Private')) + name.set_surname(_('Private')) + else: + name = person.get_primary_name() new_person.set_nick_name(person.get_nick_name()) + + if person.get_privacy(): + return new_person + + new_person.set_primary_name(name) + for name in person.get_alternate_names(): if not name.get_privacy(): new_person.add_alternate_name(name) diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade index 5f7dbf4ab..66d3ea9d4 100644 --- a/gramps2/src/gramps.glade +++ b/gramps2/src/gramps.glade @@ -1318,7 +1318,7 @@ 0 True - * + * False @@ -4330,7 +4330,7 @@ Other 0 True - * + * False @@ -4523,7 +4523,7 @@ Other 0 True - * + * False @@ -4997,7 +4997,7 @@ Other 0 True - * + * False @@ -5177,7 +5177,7 @@ Other 0 True - * + * False @@ -5586,7 +5586,7 @@ Other 0 True - * + * False @@ -5607,7 +5607,7 @@ Other 0 True - * + * False @@ -5653,7 +5653,7 @@ Other 0 True - * + * False @@ -5674,7 +5674,7 @@ Other 0 True - * + * False @@ -6666,7 +6666,7 @@ Other 0 True - * + * False @@ -6912,7 +6912,7 @@ Other 0 True - * + * False @@ -7384,7 +7384,7 @@ Other 0 True - * + * True @@ -7537,7 +7537,7 @@ Other 0 True - * + * False @@ -7708,7 +7708,7 @@ Other 0 True - * + * False @@ -8402,7 +8402,7 @@ Other 0 True - * + * False @@ -8424,7 +8424,7 @@ Other 0 True - * + * False @@ -8446,7 +8446,7 @@ Other 0 True - * + * False @@ -8618,7 +8618,7 @@ Other 0 True - * + * False @@ -8741,7 +8741,7 @@ Other 0 True - * + * False @@ -8762,7 +8762,7 @@ Other 0 True - * + * False @@ -8788,91 +8788,6 @@ Other - - - 6 - True - True - Information i_s complete - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - 5 - 16 - 17 - fill - - - - - - - True - False - 0 - - - - True - Last changed: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - True - True - - - - - 6 - 11 - 16 - 17 - fill - fill - - - True @@ -8888,7 +8803,7 @@ Other 0 True - * + * False @@ -8943,7 +8858,7 @@ Other 0 True - * + * False @@ -8966,7 +8881,7 @@ Other 0 True - * + * False @@ -9019,7 +8934,7 @@ Other 0 True - * + * False @@ -9153,7 +9068,7 @@ Other 0 True - * + * False @@ -9251,6 +9166,51 @@ Other fill + + + + 6 + True + True + Information i_s complete + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 5 + 16 + 17 + + + + + + + + True + True + Information is pri_vate + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 6 + 11 + 16 + 17 + + + + 0 @@ -12562,7 +12522,7 @@ Other 0 True - * + * False @@ -12686,7 +12646,7 @@ Other 0 True - * + * False @@ -12832,7 +12792,7 @@ Other 0 True - * + * False @@ -12853,7 +12813,7 @@ Other 0 True - * + * False @@ -12942,7 +12902,7 @@ Other 0 True - * + * False @@ -13035,7 +12995,7 @@ Other 0 True - * + * False @@ -13446,7 +13406,7 @@ Other 0 True - * + * False @@ -15179,7 +15139,7 @@ Other 0 True - * + * False @@ -15686,7 +15646,7 @@ Other 0 True - * + * False @@ -15707,7 +15667,7 @@ Other 0 True - * + * False @@ -15728,7 +15688,7 @@ Other 0 True - * + * False @@ -15749,7 +15709,7 @@ Other 0 True - * + * False @@ -15770,7 +15730,7 @@ Other 0 True - * + * False @@ -15791,7 +15751,7 @@ Other 0 True - * + * False @@ -15812,7 +15772,7 @@ Other 0 True - * + * False @@ -15833,7 +15793,7 @@ Other 0 True - * + * False @@ -15903,7 +15863,7 @@ Other 0 True - * + * False @@ -15949,7 +15909,7 @@ Other 0 True - * + * False @@ -18679,7 +18639,7 @@ Text Beside Icons 0 True - * + * False @@ -18700,7 +18660,7 @@ Text Beside Icons 0 True - * + * False @@ -18721,7 +18681,7 @@ Text Beside Icons 0 True - * + * False @@ -18742,7 +18702,7 @@ Text Beside Icons 0 True - * + * False @@ -18763,7 +18723,7 @@ Text Beside Icons 0 True - * + * False @@ -18784,7 +18744,7 @@ Text Beside Icons 0 True - * + * False @@ -18805,7 +18765,7 @@ Text Beside Icons 0 True - * + * False @@ -18826,7 +18786,7 @@ Text Beside Icons 0 True - * + * False @@ -19044,7 +19004,7 @@ Text Beside Icons 0 I True - * + * False @@ -19065,7 +19025,7 @@ Text Beside Icons 0 F True - * + * False @@ -19086,7 +19046,7 @@ Text Beside Icons 0 P True - * + * False @@ -19107,7 +19067,7 @@ Text Beside Icons 0 S True - * + * False @@ -19128,7 +19088,7 @@ Text Beside Icons 0 O True - * + * False @@ -19816,7 +19776,7 @@ Text Beside Icons 0 True - * + * False @@ -21146,7 +21106,7 @@ Very High 0 True - * + * False @@ -21814,7 +21774,7 @@ Very High 0 True - * + * False @@ -21835,7 +21795,7 @@ Very High 0 True - * + * False @@ -21856,7 +21816,7 @@ Very High 0 True - * + * False @@ -22201,7 +22161,7 @@ Very High 0 True - * + * False @@ -22541,7 +22501,7 @@ Very High 0 True - * + * False @@ -23095,7 +23055,7 @@ Very High 0 True - * + * False @@ -23116,7 +23076,7 @@ Very High 0 True - * + * False @@ -23137,7 +23097,7 @@ Very High 0 True - * + * False @@ -23158,7 +23118,7 @@ Very High 0 True - * + * False @@ -24377,7 +24337,7 @@ Very High 0 True - * + * False @@ -24447,7 +24407,7 @@ Very High 0 True - * + * False @@ -24474,7 +24434,7 @@ Very High 0 True - * + * False @@ -26725,7 +26685,7 @@ Very High 0 True - * + * False @@ -26746,7 +26706,7 @@ Very High 0 True - * + * False @@ -26767,7 +26727,7 @@ Very High 0 True - * + * False @@ -26788,7 +26748,7 @@ Very High 0 True - * + * False @@ -27841,7 +27801,7 @@ Very High 0 True - * + * False @@ -28511,7 +28471,7 @@ Very High 0 True - * + * False @@ -28532,7 +28492,7 @@ Very High 0 True - * + * False @@ -28553,7 +28513,7 @@ Very High 0 True - * + * False @@ -28574,7 +28534,7 @@ Very High 0 True - * + * False @@ -28595,7 +28555,7 @@ Very High 0 True - * + * False @@ -28641,7 +28601,7 @@ Very High 0 True - * + * False @@ -28687,7 +28647,7 @@ Very High 0 True - * + * False @@ -29045,7 +29005,7 @@ Very High 0 True - * + * False @@ -29066,7 +29026,7 @@ Very High 0 True - * + * False @@ -29087,7 +29047,7 @@ Very High 0 True - * + * False @@ -29108,7 +29068,7 @@ Very High 0 True - * + * False @@ -29129,7 +29089,7 @@ Very High 0 True - * + * False @@ -29150,7 +29110,7 @@ Very High 0 True - * + * False @@ -29196,7 +29156,7 @@ Very High 0 True - * + * False @@ -29829,7 +29789,7 @@ Very High 0 True - * + * False @@ -29851,7 +29811,7 @@ Very High 0 True - * + * False @@ -30181,7 +30141,7 @@ Very High 0 True - * + * False @@ -30202,7 +30162,7 @@ Very High 0 True - * + * False @@ -30223,7 +30183,7 @@ Very High 0 True - * + * False @@ -30244,7 +30204,7 @@ Very High 0 True - * + * False @@ -30334,7 +30294,7 @@ Very High 0 True - * + * False @@ -30414,7 +30374,7 @@ Very High 0 True - * + * False @@ -31131,7 +31091,7 @@ Family name Given name 0 True - * + * False @@ -32226,7 +32186,7 @@ Family name Given name 0 True - * + * False @@ -32386,7 +32346,7 @@ Family name Given name 0 True - * + * False