* 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
This commit is contained in:
Don Allingham 2004-11-27 19:48:25 +00:00
parent 2f2d616780
commit 60a27e0c63
5 changed files with 886 additions and 266 deletions

View File

@ -1,3 +1,10 @@
2004-11-27 Don Allingham <dallingham@users.sourceforge.net>
* 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 <dallingham@users.sourceforge.net>
* src/DisplayModels.py: fix Source column display
* src/GrampsDbBase.py: change default display columns

View File

@ -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"""

View File

@ -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)

View File

@ -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)

File diff suppressed because it is too large Load Diff