2003-07-22 Tim Waugh <twaugh@redhat.com>

* src/plugins/WriteGedcom.py, src/plugins/gedcomexport.glade: New
        option for obscuring names of living people.


svn: r1918
This commit is contained in:
Tim Waugh 2003-07-22 10:14:49 +00:00
parent b83feccfea
commit b0d15a6b01
3 changed files with 84 additions and 16 deletions

View File

@ -1,3 +1,7 @@
2003-07-22 Tim Waugh <twaugh@redhat.com>
* src/plugins/WriteGedcom.py, src/plugins/gedcomexport.glade: New
option for obscuring names of living people.
2003-07-21 Don Allingham <dallingham@users.sourceforge.net> 2003-07-21 Don Allingham <dallingham@users.sourceforge.net>
* src/Sources.py: sort sources by title * src/Sources.py: sort sources by title

View File

@ -370,6 +370,7 @@ class GedcomWriter:
"gnu_free" : self.gnu_free, "gnu_free" : self.gnu_free,
"standard_copyright" : self.standard_copyright, "standard_copyright" : self.standard_copyright,
"no_copyright" : self.no_copyright, "no_copyright" : self.no_copyright,
"on_restrict_toggled": self.on_restrict_toggled,
"on_ok_clicked" : self.on_ok_clicked "on_ok_clicked" : self.on_ok_clicked
}) })
@ -429,10 +430,16 @@ class GedcomWriter:
def no_copyright(self,obj): def no_copyright(self,obj):
self.copy = 2 self.copy = 2
def on_restrict_toggled(self,restrict):
living = self.topDialog.get_widget("living")
living.set_sensitive (restrict.get_active ())
def on_ok_clicked(self,obj): def on_ok_clicked(self,obj):
self.restrict = self.topDialog.get_widget("restrict").get_active() self.restrict = self.topDialog.get_widget("restrict").get_active()
self.living = (self.restrict and
self.topDialog.get_widget("living").get_active())
self.private = self.topDialog.get_widget("private").get_active() self.private = self.topDialog.get_widget("private").get_active()
cfilter = self.filter_menu.get_active().get_data("filter") cfilter = self.filter_menu.get_active().get_data("filter")
@ -762,10 +769,21 @@ class GedcomWriter:
def write_person(self,person): def write_person(self,person):
self.writeln("0 @%s@ INDI" % self.pid(person.getId())) self.writeln("0 @%s@ INDI" % self.pid(person.getId()))
restricted = self.restrict and person.probablyAlive ()
self.prefn(person) self.prefn(person)
self.write_person_name(person.getPrimaryName(),person.getNickName()) primaryname = person.getPrimaryName ()
if restricted and self.living:
primaryname = RelLib.Name (primaryname)
primaryname.setFirstName ("Living")
nickname = ""
else:
primaryname = person.getPrimaryName ()
nickname = person.getNickName ()
if self.altname == GedcomInfo.ALT_NAME_STD: self.write_person_name(primaryname, nickname)
if (self.altname == GedcomInfo.ALT_NAME_STD and
not (restricted and self.living)):
for name in person.getAlternateNames(): for name in person.getAlternateNames():
self.write_person_name(name,"") self.write_person_name(name,"")
@ -774,7 +792,7 @@ class GedcomWriter:
elif person.getGender() == RelLib.Person.female: elif person.getGender() == RelLib.Person.female:
self.writeln("1 SEX F") self.writeln("1 SEX F")
if not self.restrict or not person.probablyAlive(): if not restricted:
birth = person.getBirth() birth = person.getBirth()
if not (self.private and birth.getPrivacy()): if not (self.private and birth.getPrivacy()):
@ -911,18 +929,19 @@ class GedcomWriter:
if family != None and self.flist.has_key(family.getId()): if family != None and self.flist.has_key(family.getId()):
self.writeln("1 FAMS @%s@" % self.fid(family.getId())) self.writeln("1 FAMS @%s@" % self.fid(family.getId()))
if self.obje: if not restricted:
for url in person.getUrlList(): if self.obje:
self.writeln('1 OBJE') for url in person.getUrlList():
self.writeln('2 FORM URL') self.writeln('1 OBJE')
if url.get_description(): self.writeln('2 FORM URL')
self.writeln('2 TITL %s' % url.get_description()) if url.get_description():
if url.get_path(): self.writeln('2 TITL %s' % url.get_description())
self.writeln('2 FILE %s' % url.get_path()) if url.get_path():
self.writeln('2 FILE %s' % url.get_path())
if person.getNote():
self.write_long_text("NOTE",1,self.cnvtxt(person.getNote()))
if person.getNote():
self.write_long_text("NOTE",1,self.cnvtxt(person.getNote()))
def write_long_text(self,tag,level,note): def write_long_text(self,tag,level,note):
if self.conc == GedcomInfo.CONC_OK: if self.conc == GedcomInfo.CONC_OK:
self.write_conc_ok(tag,level,note) self.write_conc_ok(tag,level,note)

View File

@ -91,7 +91,7 @@
<widget class="GtkTable" id="table3"> <widget class="GtkTable" id="table3">
<property name="border_width">12</property> <property name="border_width">12</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">12</property> <property name="n_rows">13</property>
<property name="n_columns">3</property> <property name="n_columns">3</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
@ -418,6 +418,7 @@
<property name="active">True</property> <property name="active">True</property>
<property name="inconsistent">False</property> <property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_restrict_toggled" last_modification_time="Tue, 22 Jul 2003 09:50:16 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
@ -496,6 +497,50 @@
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkDrawingArea" id="drawingarea1">
<property name="visible">True</property>
</widget>
<packing>
<property name="padding">12</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="living">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use _Living as first name</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">12</property>
<property name="bottom_attach">13</property>
<property name="x_options">fill</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>