From acd784ec9ee0e8fa7112a8fa1d7e0b8e34f2f79d Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 27 Nov 2004 19:48:25 +0000 Subject: [PATCH] * src/gramps.glade: add privacy fields and fix add/edit/remove buttons * src/Sources.py: add support for privacy flags * src/Witness.py: add support for privacy flags * src/RelLib.py: add support for privacy flags svn: r3758 --- gramps2/ChangeLog | 7 + gramps2/src/RelLib.py | 21 +- gramps2/src/Sources.py | 12 +- gramps2/src/Witness.py | 4 + gramps2/src/gramps.glade | 1108 +++++++++++++++++++++++++++++--------- 5 files changed, 886 insertions(+), 266 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index e346f696a..30771d045 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,10 @@ +2004-11-27 Don Allingham + * src/gramps.glade: add privacy fields and fix add/edit/remove + buttons + * src/Sources.py: add support for privacy flags + * src/Witness.py: add support for privacy flags + * src/RelLib.py: add support for privacy flags + 2004-11-26 Don Allingham * src/DisplayModels.py: fix Source column display * src/GrampsDbBase.py: change default display columns diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index 7fb3130c7..f51f2c1e0 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -201,7 +201,7 @@ class DataObj(SourceNote): if source: self.private = source.private else: - self.private = 0 + self.private = False def set_privacy(self,val): """Sets or clears the privacy flag of the data""" @@ -2115,6 +2115,15 @@ class Witness: self.set_type(type) self.set_value(val) self.set_comment(comment) + self.private = False + + def set_privacy(self,val): + """Sets or clears the privacy flag of the data""" + self.private = val + + def get_privacy(self): + """Returns the privacy level of the data""" + return self.private def set_type(self,type): self.type = type @@ -2147,6 +2156,7 @@ class SourceRef: self.date = Date.Date(source.date) self.comments = Note(source.comments.get()) self.text = source.text + self.private = source.private else: self.confidence = CONF_NORMAL self.ref = None @@ -2154,6 +2164,15 @@ class SourceRef: self.date = Date.Date() self.comments = Note() self.text = "" + self.private = False + + def set_privacy(self,val): + """Sets or clears the privacy flag of the data""" + self.private = val + + def get_privacy(self): + """Returns the privacy level of the data""" + return self.private def set_confidence_level(self,val): """Sets the confidence level""" diff --git a/gramps2/src/Sources.py b/gramps2/src/Sources.py index 960936912..207892785 100644 --- a/gramps2/src/Sources.py +++ b/gramps2/src/Sources.py @@ -332,6 +332,7 @@ class SourceEditor: self.title_menu = self.get_widget("source_title") self.title_menu.set_data("o",self) self.conf_menu = self.get_widget("conf") + self.private = self.get_widget("priv") self.ok = self.get_widget("ok") Utils.build_confidence_menu(self.conf_menu) self.conf_menu.set_history(srcref.get_confidence_level()) @@ -351,15 +352,16 @@ class SourceEditor: self.active_source = self.db.get_source_from_handle(self.source_ref.get_base_handle()) self.date_obj = self.source_ref.get_date() self.date_entry_field.set_text(self.dd.display(self.date_obj)) + self.private.set_active(self.source_ref.get_privacy()) else: self.date_obj = Date.Date() self.active_source = None date_stat = self.get_widget("date_stat") self.date_check = DateEdit.DateEdit(self.date_obj, - self.date_entry_field, - date_stat, - self.sourceDisplay) + self.date_entry_field, + date_stat, + self.sourceDisplay) self.draw(self.active_source) self.set_button() @@ -495,6 +497,7 @@ class SourceEditor: self.source_ref.set_text(text) self.source_ref.set_comments(comments) self.source_ref.set_confidence_level(conf) + self.source_ref.set_privacy(self.private.get_active()) if self.update: self.update(self.parent,self.source_ref) @@ -518,5 +521,6 @@ class SourceEditor: def add_src_clicked(self,obj): import EditSource - EditSource.EditSource(RelLib.Source(),self.db, self,self.sourceDisplay, self.update_display) + EditSource.EditSource(RelLib.Source(),self.db, self, + self.sourceDisplay, self.update_display) diff --git a/gramps2/src/Witness.py b/gramps2/src/Witness.py index b97a4e1da..2c47b9db1 100644 --- a/gramps2/src/Witness.py +++ b/gramps2/src/Witness.py @@ -141,6 +141,7 @@ class WitnessEditor: self.window = self.show_witness.get_widget('witness_edit') self.name = self.show_witness.get_widget("name") + self.private = self.show_witness.get_widget("priv") self.select = self.show_witness.get_widget("select") self.select.connect('clicked',self.choose) self.ok = self.show_witness.get_widget("ok") @@ -157,6 +158,7 @@ class WitnessEditor: self.name.set_text(self.ref.get_value()) self.in_db.set_active(0) self.comment.get_buffer().set_text(self.ref.get_comment()) + self.private.set_active(self.ref.get_privacy()) self.on_toggled(None) Utils.set_titles(self.show_witness.get_widget('witness_edit'), @@ -241,6 +243,8 @@ class WitnessEditor: c = self.comment.get_buffer() self.ref.set_comment(unicode(c.get_text(c.get_start_iter(),c.get_end_iter(),gtk.FALSE))) + self.ref.set_privacy(self.private.get_active()) + if self.update: self.update() self.close(obj) diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade index 03708a52a..a8eafe322 100644 --- a/gramps2/src/gramps.glade +++ b/gramps2/src/gramps.glade @@ -3668,11 +3668,21 @@ True True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -4068,11 +4078,21 @@ Other True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14010,13 +14030,22 @@ Other True Add new event for this marriage - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14029,11 +14058,20 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14046,13 +14084,22 @@ Other True Delete selected event - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14408,13 +14455,22 @@ Other True Create a new attribute for this marriage - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14427,11 +14483,20 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14444,13 +14509,22 @@ Other True Delete the selected attribute - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14698,12 +14772,21 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14716,10 +14799,19 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14732,10 +14824,20 @@ Other True True - _Delete... - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14826,13 +14928,22 @@ Other True Add a new media object to the database and place it in this gallery - True True - _Add from file... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14845,13 +14956,22 @@ Other True Select an existing media object from the database and place it in this gallery - True True - Add from _database... - True GTK_RELIEF_NORMAL True + + + + True + gtk-index + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14865,11 +14985,20 @@ Other True Edit the properties of the selected objects True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -14882,13 +15011,22 @@ Other True Remove selected object from this gallery only - True True - _Remove - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16345,13 +16483,22 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16364,11 +16511,20 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16380,13 +16536,22 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16653,12 +16818,21 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16671,10 +16845,19 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16686,12 +16869,21 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16808,13 +17000,22 @@ Other True Add a new media object to the database and place it in this gallery - True True - _Add from file... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16827,13 +17028,22 @@ Other True Select an existing media object from the database and place it in this gallery - True True - Add from _database... - True GTK_RELIEF_NORMAL True + + + + True + gtk-index + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16847,11 +17057,20 @@ Other True Edit the properties of the selected object True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -16864,13 +17083,22 @@ Other True Remove selected object from this gallery only - True True - _Remove - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -17115,13 +17343,22 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -17134,11 +17371,20 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -17156,62 +17402,14 @@ Other - + True + gtk-jump-to + 4 0.5 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-jump-to - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Go - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - + 0 + 0 @@ -17225,13 +17423,22 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -19265,8 +19472,8 @@ Other 12 True - 11 - 5 + 12 + 4 False 6 12 @@ -19642,27 +19849,6 @@ Other - - - True - True - True - True - 0 - - True - * - False - - - 2 - 4 - 8 - 9 - - - - True @@ -19694,7 +19880,7 @@ Other 2 - 5 + 4 7 8 fill @@ -19756,7 +19942,7 @@ Other 2 - 5 + 4 6 7 fill @@ -19794,7 +19980,7 @@ Other 2 - 5 + 4 9 10 fill @@ -19832,7 +20018,7 @@ Other 2 - 5 + 4 10 11 fill @@ -19853,7 +20039,7 @@ Other 3 - 5 + 4 1 2 fill @@ -19861,15 +20047,60 @@ Other + + + True + True + _Private record + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 2 + 3 + 11 + 12 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 2 + 3 + 8 + 9 + + + + True + Invoke date editor True GTK_RELIEF_NONE True + - + True 0.5 0.5 @@ -19879,12 +20110,12 @@ Other - 4 - 5 + 3 + 4 8 9 fill - fill + @@ -20062,13 +20293,22 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -20081,11 +20321,20 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -20097,13 +20346,22 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -20900,46 +21158,72 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + True - True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 False - True + False @@ -23576,13 +23860,22 @@ Other True Creates a new object attribute from the above data - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -23595,11 +23888,20 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -23612,13 +23914,22 @@ Other True Delete the selected attribute - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -23731,12 +24042,21 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -23749,10 +24069,19 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -23764,12 +24093,21 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -24598,13 +24936,22 @@ Other True Creates a new attribute from the above data - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -24617,11 +24964,20 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -24636,11 +24992,21 @@ Other Delete the selected attribute True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -24951,12 +25317,21 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -24969,10 +25344,19 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -24984,12 +25368,21 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -26747,12 +27140,21 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -26765,10 +27167,19 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -26780,12 +27191,21 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27056,12 +27476,21 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27074,10 +27503,19 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27089,12 +27527,21 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27211,13 +27658,22 @@ Other True Add a new media object to the database and place it in this gallery - True True - _Add from file... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27230,13 +27686,22 @@ Other True Select an existing media object from the database and place it in this gallery - True True - Add from _database... - True GTK_RELIEF_NORMAL True + + + + True + gtk-index + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27250,11 +27715,20 @@ Other True Edit the properties of the selected object True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27267,13 +27741,22 @@ Other True Remove selected object from this gallery only - True True - _Remove - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27661,12 +28144,21 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27679,10 +28171,19 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -27694,12 +28195,21 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -28203,7 +28713,7 @@ Other True True 0 - : + True * False @@ -29002,12 +29512,21 @@ Other True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -29020,10 +29539,19 @@ Other True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -29035,12 +29563,21 @@ Other True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -30314,12 +30851,21 @@ Family name Given name True - True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -30332,10 +30878,19 @@ Family name Given name True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + edit_sm.png + 0.5 + 0.5 + 0 + 0 + + 0 @@ -30347,12 +30902,21 @@ Family name Given name True - True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -30700,7 +31264,7 @@ Family name Given name 12 True - 3 + 4 3 False 6 @@ -30873,6 +31437,28 @@ Family name Given name + + + + True + True + _Private record + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 1 + 2 + 3 + 4 + fill + + + 0 @@ -30906,7 +31492,7 @@ Family name Given name False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST - True + False