HasCommonANcestorWith patch from Alexandre Duret-Lutz

svn: r1159
This commit is contained in:
Don Allingham
2002-11-02 21:02:27 +00:00
parent 7112c67963
commit 7341d29757
7 changed files with 152 additions and 62 deletions

View File

@@ -93,7 +93,11 @@ class GraphVizDialog(ReportDialog):
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([self.person.getId()]))
return [all,des,ans]
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(GenericFilter.HasCommonAncestorWith([self.person.getId()]))
return [all,des,ans,com]
def add_user_options(self):
self.arrowstyle_optionmenu = gtk.GtkOptionMenu()
@@ -270,7 +274,7 @@ class GraphVizDialog(ReportDialog):
file = open(self.target_path,"w")
ind_list = self.filter.apply(self.db.getPersonMap().values())
ind_list = self.filter.apply(self.db, self.db.getPersonMap().values())
write_dot(file, ind_list, self.orien, width, height,
self.tb_margin, self.lr_margin, self.hpages,
@@ -443,4 +447,3 @@ register_report(
category=_("Graphical Reports"),
description=get_description()
)

View File

@@ -336,7 +336,7 @@ class IndivComplete:
self.d.end_cell()
def write_report(self):
ind_list = self.filter.apply(self.database.getPersonMap().values())
ind_list = self.filter.apply(self.database,self.database.getPersonMap().values())
count = 0
for self.person in ind_list:
self.write_person(count)
@@ -480,11 +480,15 @@ class IndivSummaryDialog(TextReportDialog):
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([self.person.getId()]))
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(GenericFilter.HasCommonAncestorWith([self.person.getId()]))
all = GenericFilter.GenericFilter()
all.set_name(_("Entire Database"))
all.add_rule(GenericFilter.Everyone([]))
return [id,des,ans,all]
return [id,des,ans,com,all]
#------------------------------------------------------------------------
#
@@ -659,11 +663,3 @@ register_report(
description=_("Produces a complete report on the selected people."),
xpm=get_xpm_image()
)

View File

@@ -766,7 +766,7 @@ class WebReport(Report):
image_dir_name)
return
ind_list = self.filter.apply(self.db.getPersonMap().values())
ind_list = self.filter.apply(self.db,self.db.getPersonMap().values())
self.progress_bar_setup(float(len(ind_list)))
doc = HtmlLinkDoc(self.selected_style,None,self.template_name,None)
@@ -925,7 +925,11 @@ class WebReportDialog(ReportDialog):
ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([self.person.getId()]))
return [all,des,df,ans]
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name)
com.add_rule(GenericFilter.HasCommonAncestorWith([self.person.getId()]))
return [all,des,df,ans,com]
#------------------------------------------------------------------------
#
@@ -1253,4 +1257,3 @@ register_report(
description=_("Generates web (HTML) pages for individuals, or a set of individuals."),
xpm=get_xpm_image()
)

View File

@@ -340,7 +340,12 @@ class GedcomWriter:
ans.set_name(_("Ancestors of %s") % person.getPrimaryName().getName())
ans.add_rule(GenericFilter.IsAncestorOf([person.getId()]))
self.filter_menu = GenericFilter.build_filter_menu([all,des,ans])
com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") %
person.getPrimaryName().getName())
com.add_rule(GenericFilter.HasCommonAncestorWith([person.getId()]))
self.filter_menu = GenericFilter.build_filter_menu([all,des,ans,com])
filter_obj.set_menu(self.filter_menu)
gedmap = GedcomInfoDB()
@@ -388,7 +393,7 @@ class GedcomWriter:
for p in self.db.getPersonKeys():
self.plist[p] = 1
else:
for p in cfilter.apply(self.db.getPersonMap().values()):
for p in cfilter.apply(self.db,self.db.getPersonMap().values()):
self.plist[p.getId()] = 1
self.flist = {}