* src/WriteGedcom.py: Pass gramps_id to filter rules.

* src/plugins/ExportVCalendar.py: Pass gramps_id to filter rules.
* src/plugins/ExportVCard.py: Pass gramps_id to filter rules.
* src/plugins/GraphViz.py: Pass gramps_id to filter rules.
* src/plugins/IndivComplete.py: Pass gramps_id to filter rules.
* src/plugins/NavWebPage.py: Pass gramps_id to filter rules.
* src/plugins/StatisticsChart.py: Pass gramps_id to filter rules.
* src/plugins/TimeLine.py: Pass gramps_id to filter rules.
* src/plugins/WebPage.py: Pass gramps_id to filter rules.
* src/plugins/WriteFtree.py: Pass gramps_id to filter rules.
* src/plugins/WriteGeneWeb.py: Pass gramps_id to filter rules.


svn: r4838
This commit is contained in:
Alex Roitman 2005-06-17 17:32:54 +00:00
parent 880c3e7751
commit fdc3979278
11 changed files with 117 additions and 69 deletions

View File

@ -3,6 +3,18 @@
creator; (write_person): write person sources; (sid): return
gramps_id; (write_families): write family sources.
* src/WriteGedcom.py: Pass gramps_id to filter rules.
* src/plugins/ExportVCalendar.py: Pass gramps_id to filter rules.
* src/plugins/ExportVCard.py: Pass gramps_id to filter rules.
* src/plugins/GraphViz.py: Pass gramps_id to filter rules.
* src/plugins/IndivComplete.py: Pass gramps_id to filter rules.
* src/plugins/NavWebPage.py: Pass gramps_id to filter rules.
* src/plugins/StatisticsChart.py: Pass gramps_id to filter rules.
* src/plugins/TimeLine.py: Pass gramps_id to filter rules.
* src/plugins/WebPage.py: Pass gramps_id to filter rules.
* src/plugins/WriteFtree.py: Pass gramps_id to filter rules.
* src/plugins/WriteGeneWeb.py: Pass gramps_id to filter rules.
2005-06-16 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/gramps_main.py (on_merge_activate,on_fast_merge_activate):
only merge if exactly two persons have been selected

View File

@ -331,17 +331,22 @@ class GedcomWriterOptionBox:
if self.person:
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % NameDisplay.displayer.display(self.person))
des.add_rule(GenericFilter.IsDescendantOf([self.person.get_handle(),1]))
des.set_name(_("Descendants of %s") %
NameDisplay.displayer.display(self.person))
des.add_rule(GenericFilter.IsDescendantOf(
[self.person.get_gramps_id(),1]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % NameDisplay.displayer.display(self.person))
ans.add_rule(GenericFilter.IsAncestorOf([self.person.get_handle(),1]))
ans.set_name(_("Ancestors of %s")
% NameDisplay.displayer.display(self.person))
ans.add_rule(GenericFilter.IsAncestorOf(
[self.person.get_gramps_id(),1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") %
NameDisplay.displayer.display(self.person))
com.add_rule(GenericFilter.HasCommonAncestorWith([self.person.get_handle()]))
com.add_rule(GenericFilter.HasCommonAncestorWith(
[self.person.get_gramps_id()]))
self.filter_menu = GenericFilter.build_filter_menu([all,des,ans,com])
else:
@ -739,6 +744,7 @@ class GedcomWriter:
for srcref in family.get_source_references():
self.write_source_ref(1,srcref)
self.write_change(1,family.get_change_time())
def write_sources(self):

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004 Martin Hawlisch
# Copyright (C) 2005 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -81,20 +82,29 @@ class CalendarWriterOptionBox:
all.set_name(_("Entire Database"))
all.add_rule(GenericFilter.Everyone([]))
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % self.person.get_primary_name().get_name())
des.add_rule(GenericFilter.IsDescendantOf([self.person.get_handle(),1]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % self.person.get_primary_name().get_name())
ans.add_rule(GenericFilter.IsAncestorOf([self.person.get_handle(),1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") %
if person:
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") %
self.person.get_primary_name().get_name())
com.add_rule(GenericFilter.HasCommonAncestorWith([self.person.get_handle()]))
des.add_rule(GenericFilter.IsDescendantOf(
[self.person.get_gramps_id(),1]))
self.filter_menu = GenericFilter.build_filter_menu([all,des,ans,com])
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") %
self.person.get_primary_name().get_name())
ans.add_rule(GenericFilter.IsAncestorOf(
[self.person.get_gramps_id(),1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") %
self.person.get_primary_name().get_name())
com.add_rule(GenericFilter.HasCommonAncestorWith(
[self.person.get_gramps_id()]))
self.filter_menu = GenericFilter.build_filter_menu(
[all,des,ans,com])
else:
self.filter_menu = GenericFilter.build_filter_menu([all])
filter_obj.set_menu(self.filter_menu)
the_box = self.topDialog.get_widget('vbox1')

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004 Martin Hawlisch
# Copyright (C) 2005 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -27,7 +28,6 @@
#
#-------------------------------------------------------------------------
import os
import string
import time
import re
@ -84,20 +84,29 @@ class CardWriterOptionBox:
all.set_name(_("Entire Database"))
all.add_rule(GenericFilter.Everyone([]))
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % self.person.get_primary_name().get_name())
des.add_rule(GenericFilter.IsDescendantOf([self.person.get_handle(),1]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % self.person.get_primary_name().get_name())
ans.add_rule(GenericFilter.IsAncestorOf([self.person.get_handle(),1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") %
if self.person:
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") %
self.person.get_primary_name().get_name())
com.add_rule(GenericFilter.HasCommonAncestorWith([self.person.get_handle()]))
des.add_rule(GenericFilter.IsDescendantOf(
[self.person.get_gramps_id(),1]))
self.filter_menu = GenericFilter.build_filter_menu([all,des,ans,com])
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") %
self.person.get_primary_name().get_name())
ans.add_rule(GenericFilter.IsAncestorOf(
[self.person.get_gramps_id(),1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") %
self.person.get_primary_name().get_name())
com.add_rule(GenericFilter.HasCommonAncestorWith(
[self.person.get_gramps_id()]))
self.filter_menu = GenericFilter.build_filter_menu(
[all,des,ans,com])
else:
self.filter_menu = GenericFilter.build_filter_menu([all])
filter_obj.set_menu(self.filter_menu)
the_box = self.topDialog.get_widget('vbox1')

View File

@ -504,10 +504,10 @@ class GraphVizOptions(ReportOptions.ReportOptions):
"""Set up the list of possible content filters."""
if person:
name = person.get_primary_name().get_name()
handle = person.get_handle()
gramps_id = person.get_gramps_id()
else:
name = 'PERSON'
handle = ''
gramps_id = ''
all = GenericFilter.GenericFilter()
all.set_name(_("Entire Database"))
@ -515,15 +515,15 @@ class GraphVizOptions(ReportOptions.ReportOptions):
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % name)
des.add_rule(GenericFilter.IsDescendantOf([handle,1]))
des.add_rule(GenericFilter.IsDescendantOf([gramps_id,1]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([handle,1]))
ans.add_rule(GenericFilter.IsAncestorOf([gramps_id,1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(GenericFilter.HasCommonAncestorWith([handle]))
com.add_rule(GenericFilter.HasCommonAncestorWith([gramps_id]))
return [all,des,ans,com]

View File

@ -497,14 +497,14 @@ class IndivCompleteOptions(ReportOptions.ReportOptions):
"""Set up the list of possible content filters."""
if person:
name = person.get_primary_name().get_name()
handle = person.get_handle()
gramps_id = person.get_gramps_id()
else:
name = 'PERSON'
handle = ''
gramps_id = ''
filt_id = GenericFilter.GenericFilter()
filt_id.set_name(name)
filt_id.add_rule(GenericFilter.HasIdOf([handle]))
filt_id.add_rule(GenericFilter.HasIdOf([gramps_id]))
all = GenericFilter.GenericFilter()
all.set_name(_("Entire Database"))
@ -512,15 +512,15 @@ class IndivCompleteOptions(ReportOptions.ReportOptions):
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % name)
des.add_rule(GenericFilter.IsDescendantOf([handle,1]))
des.add_rule(GenericFilter.IsDescendantOf([gramps_id,1]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([handle,1]))
ans.add_rule(GenericFilter.IsAncestorOf([gramps_id,1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(GenericFilter.HasCommonAncestorWith([handle]))
com.add_rule(GenericFilter.HasCommonAncestorWith([gramps_id]))
return [filt_id,all,des,ans,com]

View File

@ -1126,10 +1126,10 @@ class WebReportOptions(ReportOptions.ReportOptions):
"""Set up the list of possible content filters."""
if person:
name = person.get_primary_name().get_name()
handle = person.get_handle()
gramps_id = person.get_gramps_id()
else:
name = 'PERSON'
handle = ''
gramps_is = ''
all = GenericFilter.GenericFilter()
all.set_name(_("Entire Database"))
@ -1137,19 +1137,19 @@ class WebReportOptions(ReportOptions.ReportOptions):
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % name)
des.add_rule(GenericFilter.IsDescendantOf([handle,1]))
des.add_rule(GenericFilter.IsDescendantOf([gramps_id,1]))
df = GenericFilter.GenericFilter()
df.set_name(_("Descendant Families of %s") % name)
df.add_rule(GenericFilter.IsDescendantFamilyOf([handle]))
df.add_rule(GenericFilter.IsDescendantFamilyOf([gramps_id]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([handle,1]))
ans.add_rule(GenericFilter.IsAncestorOf([gramps_id,1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(GenericFilter.HasCommonAncestorWith([handle]))
com.add_rule(GenericFilter.HasCommonAncestorWith([gramps_id]))
return [all,des,df,ans,com]

View File

@ -818,10 +818,10 @@ class StatisticsChartOptions(ReportOptions.ReportOptions):
if person:
name = person.get_primary_name().get_name()
handle = person.get_handle()
gramps_id = person.get_gramps_id()
else:
name = 'PERSON'
handle = ''
gramps_id = ''
all = GenericFilter.GenericFilter()
all.set_name(_("Entire Database"))
@ -829,15 +829,15 @@ class StatisticsChartOptions(ReportOptions.ReportOptions):
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % name)
des.add_rule(GenericFilter.IsDescendantOf([handle, 1]))
des.add_rule(GenericFilter.IsDescendantOf([gramps_id, 1]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([handle, 1]))
ans.add_rule(GenericFilter.IsAncestorOf([gramps_id, 1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(GenericFilter.HasCommonAncestorWith([handle]))
com.add_rule(GenericFilter.HasCommonAncestorWith([gramps_id]))
return [all, des, ans, com]

View File

@ -1256,10 +1256,10 @@ class WebReportOptions(ReportOptions.ReportOptions):
"""Set up the list of possible content filters."""
if person:
name = person.get_primary_name().get_name()
handle = person.get_handle()
gramps_id = person.get_gramps_id()
else:
name = 'PERSON'
handle = ''
gramps_id = ''
all = GenericFilter.GenericFilter()
all.set_name(_("Entire Database"))
@ -1267,19 +1267,19 @@ class WebReportOptions(ReportOptions.ReportOptions):
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % name)
des.add_rule(GenericFilter.IsDescendantOf([handle,1]))
des.add_rule(GenericFilter.IsDescendantOf([gramps_id,1]))
df = GenericFilter.GenericFilter()
df.set_name(_("Descendant Families of %s") % name)
df.add_rule(GenericFilter.IsDescendantFamilyOf([handle]))
df.add_rule(GenericFilter.IsDescendantFamilyOf([gramps_id]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([handle,1]))
ans.add_rule(GenericFilter.IsAncestorOf([gramps_id,1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(GenericFilter.HasCommonAncestorWith([handle]))
com.add_rule(GenericFilter.HasCommonAncestorWith([gramps_id]))
return [all,des,df,ans,com]

View File

@ -88,17 +88,22 @@ class FtreeWriterOptionBox:
if self.person:
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % self.person.get_primary_name().get_name())
des.add_rule(GenericFilter.IsDescendantOf([self.person.get_handle(),1]))
des.set_name(_("Descendants of %s") %
self.person.get_primary_name().get_name())
des.add_rule(GenericFilter.IsDescendantOf(
[self.person.get_gramps_id(),1]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % self.person.get_primary_name().get_name())
ans.add_rule(GenericFilter.IsAncestorOf([self.person.get_handle(),1]))
ans.set_name(_("Ancestors of %s")
% self.person.get_primary_name().get_name())
ans.add_rule(GenericFilter.IsAncestorOf(
[self.person.get_gramps_id(),1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") %
self.person.get_primary_name().get_name())
com.add_rule(GenericFilter.HasCommonAncestorWith([self.person.get_handle()]))
com.add_rule(GenericFilter.HasCommonAncestorWith(
[self.person.get_gramps_id()]))
self.filter_menu = GenericFilter.build_filter_menu([all,des,ans,com])
else:

View File

@ -89,19 +89,25 @@ class GeneWebWriterOptionBox:
if self.person:
des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % self.person.get_primary_name().get_name())
des.add_rule(GenericFilter.IsDescendantOf([self.person.get_handle(),1]))
des.set_name(_("Descendants of %s") %
self.person.get_primary_name().get_name())
des.add_rule(GenericFilter.IsDescendantOf(
[self.person.get_gramps_id(),1]))
ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % self.person.get_primary_name().get_name())
ans.add_rule(GenericFilter.IsAncestorOf([self.person.get_handle(),1]))
ans.set_name(_("Ancestors of %s") %
self.person.get_primary_name().get_name())
ans.add_rule(GenericFilter.IsAncestorOf(
[self.person.get_gramps_id(),1]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") %
self.person.get_primary_name().get_name())
com.add_rule(GenericFilter.HasCommonAncestorWith([self.person.get_handle()]))
com.add_rule(GenericFilter.HasCommonAncestorWith(
[self.person.get_gramps_id()]))
self.filter_menu = GenericFilter.build_filter_menu([all,des,ans,com])
self.filter_menu = GenericFilter.build_filter_menu(
[all,des,ans,com])
else:
self.filter_menu = GenericFilter.build_filter_menu([all])
filter_obj.set_menu(self.filter_menu)