From fdc39792782ba57d0fc8af71a65fa0709ef30bb6 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 17 Jun 2005 17:32:54 +0000 Subject: [PATCH] * 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 --- gramps2/ChangeLog | 12 +++++++++ gramps2/src/WriteGedcom.py | 16 ++++++++---- gramps2/src/plugins/ExportVCalendar.py | 34 ++++++++++++++++--------- gramps2/src/plugins/ExportVCard.py | 35 ++++++++++++++++---------- gramps2/src/plugins/GraphViz.py | 10 ++++---- gramps2/src/plugins/IndivComplete.py | 12 ++++----- gramps2/src/plugins/NavWebPage.py | 12 ++++----- gramps2/src/plugins/StatisticsChart.py | 10 ++++---- gramps2/src/plugins/WebPage.py | 12 ++++----- gramps2/src/plugins/WriteFtree.py | 15 +++++++---- gramps2/src/plugins/WriteGeneWeb.py | 18 ++++++++----- 11 files changed, 117 insertions(+), 69 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index aadbb3bbc..127583e25 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -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 * src/gramps_main.py (on_merge_activate,on_fast_merge_activate): only merge if exactly two persons have been selected diff --git a/gramps2/src/WriteGedcom.py b/gramps2/src/WriteGedcom.py index 06cabb948..37774617f 100644 --- a/gramps2/src/WriteGedcom.py +++ b/gramps2/src/WriteGedcom.py @@ -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): diff --git a/gramps2/src/plugins/ExportVCalendar.py b/gramps2/src/plugins/ExportVCalendar.py index d9a18157c..036e7cc0d 100644 --- a/gramps2/src/plugins/ExportVCalendar.py +++ b/gramps2/src/plugins/ExportVCalendar.py @@ -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') diff --git a/gramps2/src/plugins/ExportVCard.py b/gramps2/src/plugins/ExportVCard.py index b9085fca6..75e831c46 100644 --- a/gramps2/src/plugins/ExportVCard.py +++ b/gramps2/src/plugins/ExportVCard.py @@ -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') diff --git a/gramps2/src/plugins/GraphViz.py b/gramps2/src/plugins/GraphViz.py index ad9a7aaf1..346c6c105 100644 --- a/gramps2/src/plugins/GraphViz.py +++ b/gramps2/src/plugins/GraphViz.py @@ -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] diff --git a/gramps2/src/plugins/IndivComplete.py b/gramps2/src/plugins/IndivComplete.py index 0f385ffa3..4b8028fe2 100644 --- a/gramps2/src/plugins/IndivComplete.py +++ b/gramps2/src/plugins/IndivComplete.py @@ -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] diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 931bf5c84..e8de2d3d4 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -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] diff --git a/gramps2/src/plugins/StatisticsChart.py b/gramps2/src/plugins/StatisticsChart.py index 92bab7079..3f3b6bdf4 100755 --- a/gramps2/src/plugins/StatisticsChart.py +++ b/gramps2/src/plugins/StatisticsChart.py @@ -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] diff --git a/gramps2/src/plugins/WebPage.py b/gramps2/src/plugins/WebPage.py index 25f89cb01..2e398f97c 100644 --- a/gramps2/src/plugins/WebPage.py +++ b/gramps2/src/plugins/WebPage.py @@ -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] diff --git a/gramps2/src/plugins/WriteFtree.py b/gramps2/src/plugins/WriteFtree.py index 457576719..1b7ae948e 100644 --- a/gramps2/src/plugins/WriteFtree.py +++ b/gramps2/src/plugins/WriteFtree.py @@ -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: diff --git a/gramps2/src/plugins/WriteGeneWeb.py b/gramps2/src/plugins/WriteGeneWeb.py index 7b5fb43b3..705a3b889 100644 --- a/gramps2/src/plugins/WriteGeneWeb.py +++ b/gramps2/src/plugins/WriteGeneWeb.py @@ -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)