From 9734f8091c054b299bf218361e6ad161fa7ebd89 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 15 Feb 2003 23:03:48 +0000 Subject: [PATCH] Plugin clean up svn: r1310 --- configure.in | 2 +- src/const.py | 20 +- src/const.py.in | 20 +- src/plugins/ChangeTypes.py | 1 - src/plugins/DetAncestralReport.py | 273 ++++- src/plugins/DetDescendantReport.py | 160 +-- src/plugins/EventCmp.py | 2 +- src/plugins/Merge.py | 3 +- src/plugins/Verify.py | 2 +- src/plugins/merge.glade | 2 + src/plugins/soundgen.py | 1 - src/plugins/verify.glade | 1804 +++++++++++++++------------- 12 files changed, 1256 insertions(+), 1034 deletions(-) diff --git a/configure.in b/configure.in index c973579bd..77834ba12 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. dnl May need to run automake && aclocal first AC_INIT(src/gramps.py) AM_INIT_AUTOMAKE(gramps, 0.9.0) -RELEASE=rc5 +RELEASE=1 VERSIONSTRING=$VERSION if test x"$RELEASE" != "x" diff --git a/src/const.py b/src/const.py index a61f8886d..366a46801 100644 --- a/src/const.py +++ b/src/const.py @@ -116,15 +116,17 @@ documenters = [ 'Lawrence Allingham' ] -translators = u'Radek Malcic \n' \ - u'Lars Kristian Lundin \n' \ - u'Bernd Schandl \n' \ - u'Andr\xe9s Sep\xfalveda \n' \ - u'Laurent Protois \n' \ - u'Marco Molteni \n' \ - u'Marcos Bedinelli\n' \ - u'Alexander Roitman \n' \ - u'Jens Arvidsson ' \ +translators = u'Radek Malcic - Czech\n' \ + u'Lars Kristian Lundin - Danish (Dansk)\n' \ + u'Bernd Schandl - German (Deutsch)\n' \ + u'Andr\xe9s Sep\xfalveda - Spanish (Espa\xf1ol)\n' \ + u'Laurent Protois - French (Fran\xe7ais)\n' \ + u'Marco Molteni - Italian (Italiano)\n' \ + u'Marcos Bedinelli - Brazilian-Portuguese (Portugu\xeas do Brasil)\n' \ + u'Alex Roitman - Russian\n' \ + u'Jens Arvidsson - Swedish (Svenska)' \ + + #------------------------------------------------------------------------- diff --git a/src/const.py.in b/src/const.py.in index d2d0db1dd..e687b068e 100644 --- a/src/const.py.in +++ b/src/const.py.in @@ -116,15 +116,17 @@ documenters = [ 'Lawrence Allingham' ] -translators = u'Radek Malcic \n' \ - u'Lars Kristian Lundin \n' \ - u'Bernd Schandl \n' \ - u'Andr\xe9s Sep\xfalveda \n' \ - u'Laurent Protois \n' \ - u'Marco Molteni \n' \ - u'Marcos Bedinelli\n' \ - u'Alexander Roitman \n' \ - u'Jens Arvidsson ' \ +translators = u'Radek Malcic - Czech\n' \ + u'Lars Kristian Lundin - Danish (Dansk)\n' \ + u'Bernd Schandl - German (Deutsch)\n' \ + u'Andr\xe9s Sep\xfalveda - Spanish (Espa\xf1ol)\n' \ + u'Laurent Protois - French (Fran\xe7ais)\n' \ + u'Marco Molteni - Italian (Italiano)\n' \ + u'Marcos Bedinelli - Brazilian-Portuguese (Portugu\xeas do Brasil)\n' \ + u'Alex Roitman - Russian\n' \ + u'Jens Arvidsson - Swedish (Svenska)' \ + + #------------------------------------------------------------------------- diff --git a/src/plugins/ChangeTypes.py b/src/plugins/ChangeTypes.py index 6bce6524c..eaa0ca149 100644 --- a/src/plugins/ChangeTypes.py +++ b/src/plugins/ChangeTypes.py @@ -56,7 +56,6 @@ class ChangeTypes: self.glade.signal_autoconnect({ "on_close_clicked" : Utils.destroy_passed_object, - "on_combo_insert_text" : Utils.combo_insert_text, "on_apply_clicked" : self.on_apply_clicked }) diff --git a/src/plugins/DetAncestralReport.py b/src/plugins/DetAncestralReport.py index 391c97590..5ab666668 100644 --- a/src/plugins/DetAncestralReport.py +++ b/src/plugins/DetAncestralReport.py @@ -40,7 +40,7 @@ import gnome.ui # #------------------------------------------------------------------------ class DetAncestorReport(Report): - + #-------------------------------------------------------------------- # # @@ -59,7 +59,7 @@ class DetAncestorReport(Report): try: self.doc.open(output) except IOError,msg: - gnome.ui.GnomeErrorDialog(_("Could not open %s") % output + "\n" + msg) + ErrorDialog(_("Could not open %s") % output + "\n" + msg) #-------------------------------------------------------------------- # @@ -87,6 +87,9 @@ class DetAncestorReport(Report): NAME Born: DATE PLACE Died: DATE e NAME Born: DATE PLACE Died: PLACE d NAME Born: DATE PLACE c + NAME Born: DATE Died: DATE PLACE b + NAME Born: DATE Died: DATE a + NAME Born: DATE Died: PLACE 9 NAME Born: DATE 8 NAME Born: PLACE Died: DATE PLACE 7 NAME Born: PLACE Died: DATE 6 @@ -123,10 +126,8 @@ class DetAncestorReport(Report): childID= child.getId() if self.prevGenIDs.get(childID) != None: name= "[" + str(self.prevGenIDs.get(childID)) + "] "+ name - #print "Child List: <", birth.getDate(), ">", birth.getPlaceName() if birth.getDate() != "": - #print birth.getPlaceName() - if birth.getPlaceName() != None: + if birth.getPlaceName() != "": if death.getDate() != "": if death.getPlaceName() != "": self.doc.write_text(_("- %s Born: %s %s Died: %s %s") % \ @@ -151,13 +152,13 @@ class DetAncestorReport(Report): else: self.doc.write_text(_("- %s Born: %s Died: %s") % \ (name, birth.getDate(), death.getDate())) # a - elif death.PlaceName() != "": + elif death.getPlaceName() != "": self.doc.write_text(_("- %s Born: %s Died: %s") % \ - (name, birth.getDate(), birth.getPlaceName())) # 9 + (name, birth.getDate(), death.getPlaceName())) # 9 else: self.doc.write_text(_("- %s Born: %s") % \ (name, birth.getDate())) # 8 else: - if birth.getPlaceName() != None: + if birth.getPlaceName() != "": if death.getDate() != "": if death.getPlaceName() != "": self.doc.write_text(_("- %s Born: %s Died: %s %s") % \ @@ -167,7 +168,7 @@ class DetAncestorReport(Report): self.doc.write_text(_("- %s Born: %s Died: %s") % \ (name, birth.getPlaceName(), death.getDate())) # 6 elif death.getPlaceName() != "": - self.doc.write_text(_("- %s Born: %s Died: %s") % \ + self.doc.write_text(_("- %s Born: %s %s Died: %s") % \ (name, birth.getPlaceName(), death.getPlaceName())) # 5 else: self.doc.write_text(_("- %s Born: %s") % \ (name, birth.getPlaceName())) # 4 @@ -279,7 +280,7 @@ class DetAncestorReport(Report): else: self.doc.write_text(_(" was born in the year %s.") % date.getYear()) elif place != "": - self.doc.write_text(_(" in %s.") % place) + self.doc.write_text(_(" was born in %s.") % place) else: self.doc.write_text(_(".")) @@ -404,25 +405,25 @@ class DetAncestorReport(Report): if person.getGender() == RelLib.Person.male: if father != "": if mother != "": - self.doc.write_text(_(" %s was the son of %s and %s." % \ - (firstName, father, mother))) + self.doc.write_text(_(" %s was the son of %s and %s.") % \ + (firstName, father, mother)) else: - self.doc.write_text(_(" %s was the son of %s." % \ - (firstName, father))) + self.doc.write_text(_(" %s was the son of %s.") % \ + (firstName, father)) else: - self.doc.write_text(_(" %s was the son of %s." % \ - (firstName, mother))) + self.doc.write_text(_(" %s was the son of %s.") % \ + (firstName, mother)) else: if father != "": if mother != "": - self.doc.write_text(_(" %s was the daughter of %s and %s." % \ - (firstName, father, mother))) + self.doc.write_text(_(" %s was the daughter of %s and %s.") % \ + (firstName, father, mother)) else: - self.doc.write_text(_(" %s was the daughter of %s." % \ - (firstName, father))) + self.doc.write_text(_(" %s was the daughter of %s.") % \ + (firstName, father)) else: - self.doc.write_text(_(" %s was the daughter of %s." % \ - (firstName, mother))) + self.doc.write_text(_(" %s was the daughter of %s.") % \ + (firstName, mother)) def write_marriage(self, person, rptOptions): @@ -430,22 +431,27 @@ class DetAncestorReport(Report): HE/SHE married SPOUSE on FULLDATE in PLACE. HE/SHE married SPOUSE on FULLDATE. HE/SHE married SPOUSE in PLACE. - He/SHE married SPOUSE + HE/SHE married SPOUSE + HE/SHE married on FULLDATE in PLACE. + HE/SHE married on FULLDATE. + HE/SHE married in PLACE. """ famList= person.getFamilyList() if len(famList) > 0: fam_num= 0 + endOfSent= "" for fam in famList: fam_num= fam_num + 1 spouse= "" + t= "" if person.getGender() == RelLib.Person.male: if fam.getMother() != None: spouse= fam.getMother().getPrimaryName().getRegularName() - if fam_num == 1: - heshe= _("He") - elif fam_num < len(famList): - heshe= _(",") - else: heshe= _("and he") + if fam_num == 1: + heshe= _("He") + elif fam_num < len(famList): + heshe= _(",") + else: heshe= _("and he") else: if fam_num == 1: heshe= _("She") @@ -477,25 +483,26 @@ class DetAncestorReport(Report): if spouse != "": if fulldate == "" and place == "": - t= _(" %s married %s" % (heshe, spouse)) + t= _(" %s married %s") % (heshe, spouse) elif fulldate == "" and place != "": - t= _(" %s married %s in %s" % (heshe, spouse, place)) + t= _(" %s married %s in %s") % (heshe, spouse, place) elif fulldate != "" and place == "": - t= _(" %s married %s on %s" % (heshe, spouse, fulldate)) - else: t= _(" %s married %s on %s in %s" % \ - (heshe, spouse, fulldate, place)) + t= _(" %s married %s on %s") % (heshe, spouse, fulldate) + else: t= _(" %s married %s on %s in %s") % \ + (heshe, spouse, fulldate, place) else: - if fulldate == "" and place == "": - t= _(" %s married") - elif fulldate == "" and place != "": - t= _(" %s married in %s" % (heshe, place)) + if fulldate == "" and place != "": + t= _(" %s married in %s") % (heshe, place) elif fulldate != "" and place == "": - t= _(" %s married on %s" % (heshe, fulldate)) - else: t= _(" %s married on %s in %s" % \ - (heshe, fulldate, place)) + t= _(" %s married on %s") % (heshe, fulldate) + elif fulldate != "" and place != "": + t= _(" %s married on %s in %s") % \ + (heshe, fulldate, place) - if t != "": self.doc.write_text(t) - if fam_num == len(famList): self.doc.write_text(".") + if t != "": + self.doc.write_text(t) + endOfSent= "." + if fam_num == len(famList): self.doc.write_text(endOfSent) def write_mate(self, mate, rptOptions): """Output birth, death, parentage, marriage and notes information """ @@ -509,9 +516,9 @@ class DetAncestorReport(Report): ind= fam.getMother() person= fam.getMother().getPrimaryName().getRegularName() firstName= fam.getMother().getPrimaryName().getFirstName() - heshe= _("He") + heshe= _("She") else: - heshe= _("She") + heshe= _("He") if fam.getFather() != None: ind= fam.getFather() person= fam.getFather().getPrimaryName().getRegularName() @@ -598,10 +605,10 @@ class DetAncestorReport(Report): # # #-------------------------------------------------------------------- - def write_report(self): + def write_report(self, rptOpt): self.filter(self.start,1) - rptOpt= reportOptions() + #rptOpt= reportOptions() name = self.start.getPrimaryName().getRegularName() self.doc.start_paragraph("Title") @@ -738,13 +745,145 @@ class DetAncestorReportDialog(TextReportDialog): try: MyReport = DetAncestorReport(self.db, self.person, self.target_path, self.max_gen, self.pg_brk, self.doc) - MyReport.write_report() + + rptOpt= reportOptions() + rptOpt.firstName= self.firstName + rptOpt.fullDate= self.fullDate + rptOpt.listChildren= self.listChildren + rptOpt.includeNotes= self.includeNotes + rptOpt.blankPlace= self.blankPlace + rptOpt.blankDate= self.blankDate + rptOpt.calcAgeFlag= self.calcAgeFlag + rptOpt.dupPersons= self.dupPersons + rptOpt.childRef= self.childRef + rptOpt.addImages= self.addImages + + MyReport.write_report(rptOpt) except Errors.ReportError, msg: ErrorDialog(str(msg)) except: import DisplayTrace DisplayTrace.DisplayTrace() +#*** Begin change + def add_user_options(self): + # Create a GTK Checkbox widgets + + # Pronoun instead of first name + self.first_name_option = gtk.CheckButton(_("Use first names instead of pronouns")) + self.first_name_option.set_active(0) + + # Full date usage + self.full_date_option = gtk.CheckButton(_("Use full dates instead of only the year")) + self.full_date_option.set_active(1) + + # Children List + self.list_children_option = gtk.CheckButton(_("List children")) + self.list_children_option.set_active(1) + + # Print notes + self.include_notes_option = gtk.CheckButton(_("Include notes")) + self.include_notes_option.set_active(1) + + # Replace missing Place with ___________ + self.place_option = gtk.CheckButton(_("Replace Place with ______")) + self.place_option.set_active(0) + + # Replace missing dates with __________ + self.date_option = gtk.CheckButton(_("Replace Dates with ______")) + self.date_option.set_active(0) + + # Add "Died at the age of NN" in text + self.age_option = gtk.CheckButton(_("Compute age")) + self.age_option.set_active(1) + + # Omit duplicate persons, occurs when distant cousins marry + self.dupPersons_option = gtk.CheckButton(_("Omit duplicate ancestors")) + self.dupPersons_option.set_active(1) + + #Add descendant reference in child list + self.childRef_option = gtk.CheckButton(_("Add descendant reference in child list")) + self.childRef_option.set_active(1) + + #Add photo/image reference + self.image_option = gtk.CheckButton(_("Include Photo/Images from Gallery")) + self.image_option.set_active(0) + + # Add new options. The first argument is the tab name for grouping options. + # if you want to put everyting in the generic "Options" category, use + # self.add_option(text,widget) instead of self.add_frame_option(category,text,widget) + + self.add_frame_option('Content','',self.first_name_option) + self.add_frame_option('Content','',self.full_date_option) + self.add_frame_option('Content','',self.list_children_option) + self.add_frame_option('Content','',self.include_notes_option) + self.add_frame_option('Content','',self.place_option) + self.add_frame_option('Content','',self.date_option) + self.add_frame_option('Content','',self.age_option) + self.add_frame_option('Content','',self.dupPersons_option) + self.add_frame_option('Content','',self.childRef_option) + self.add_frame_option('Content','',self.image_option) + + + def parse_report_options_frame(self): + """Parse the report options frame of the dialog. Save the user selected choices for later use.""" + + # call the parent task to handle normal options + ReportDialog.parse_report_options_frame(self) + + # get values from the widgets + if self.first_name_option.get_active(): + self.firstName = reportOptions.Yes + else: + self.firstName = reportOptions.No + + if self.full_date_option.get_active(): + self.fullDate = reportOptions.Yes + else: + self.fullDate = reportOptions.No + + if self.list_children_option.get_active(): + self.listChildren = reportOptions.Yes + else: + self.listChildren = reportOptions.No + + if self.include_notes_option.get_active(): + self.includeNotes = reportOptions.Yes + else: + self.includeNotes = reportOptions.No + + if self.place_option.get_active(): + self.blankPlace = reportOptions.Yes + else: + self.blankPlace = reportOptions.No + + if self.date_option.get_active(): + self.blankDate = reportOptions.Yes + else: + self.blankDate = reportOptions.No + + if self.age_option.get_active(): + self.calcAgeFlag = reportOptions.Yes + else: + self.calcAgeFlag = reportOptions.No + + if self.dupPersons_option.get_active(): + self.dupPersons = reportOptions.Yes + else: + self.dupPersons = reportOptions.No + + if self.childRef_option.get_active(): + self.childRef = reportOptions.Yes + else: + self.childRef = reportOptions.No + + if self.image_option.get_active(): + self.addImages = reportOptions.Yes + else: + self.addImages = reportOptions.No + +#*** End of change + #------------------------------------------------------------------------ # # @@ -820,6 +959,13 @@ def get_xpm_image(): #------------------------------------------------------------------------ from Plugins import register_report +#------------------------------------------------------------------------ +# +# +# +#------------------------------------------------------------------------ +from Plugins import register_report + register_report( report, _("Detailed Ancestral Report"), @@ -831,7 +977,6 @@ register_report( author_email="bdegrasse1@attbi.com" ) - #------------------------------------------------------------------------ # # @@ -840,8 +985,6 @@ register_report( class reportOptions: Yes=1 No= 0 - Left= 2 - Right= 3 def __init__(self): ### Initialize report options### @@ -889,9 +1032,9 @@ class reportOptions: self.calcAgeFlag= reportOptions.Yes #Add Photos and Images to report - self.addImages= reportOptions.No - #self.imageAttrTag= "DetAncestralReport-H" - self.imageAttrTag= "DetAncestralReport-L" + self.addImages= reportOptions.Yes + self.imageAttrTag= "DetAncestralReport-H" + #self.imageAttrTag= "DetAncestralReport-L" #Omit sensitive information such as birth, christening, marriage # for living after XXXXX date. @@ -913,12 +1056,10 @@ class reportOptions: birth= ind.getBirth().getDateObj().get_start_date() death= ind.getDeath().getDateObj().get_start_date() - #print "birth=", birth.__dict__ - #print "death=", death.__dict__ self.t= "" if birth.getYearValid() and death.getYearValid(): self.age= death.getYear() - birth.getYear() - self.units= "year" + self.units= 3 # year if birth.getMonthValid() and death.getMonthValid(): if birth.getMonth() > death.getMonth(): self.age= self.age -1 @@ -929,10 +1070,22 @@ class reportOptions: self.age= death.getMonth() - birth.getMonth() # calc age in months if birth.getDay() > death.getDay(): self.age= self.age - 1 - self.units= "month" + self.units= 2 # month if self.age == 0: self.age= death.getDay() + 31 - birth.getDay() # calc age in days - self.units= "day" - self.t= _(" at the age of %d %s") % (self.age, self.units) - if self.age > 1: self.t= self.t + "s" + self.units= 1 # day + if self.age > 1: + if self.units == 1: + self.t= _(" at the age of %d days") % self.age + elif self.units == 2: + self.t= _(" at the age of %d months") % self.age + else: + self.t= _(" at the age of %d years") % self.age + else: + if self.units == 1: + self.t= _(" at the age of %d day") % self.age + elif self.units == 2: + self.t= _(" at the age of %d month") % self.age + else: + self.t= _(" at the age of %d year") % self.age return self.t diff --git a/src/plugins/DetDescendantReport.py b/src/plugins/DetDescendantReport.py index 035dd0af9..63d171270 100644 --- a/src/plugins/DetDescendantReport.py +++ b/src/plugins/DetDescendantReport.py @@ -1,4 +1,3 @@ - # # Gramps - a GTK+/GNOME based genealogy program # @@ -24,15 +23,15 @@ import RelLib import os import sort +import Errors +from QuestionDialog import ErrorDialog from intl import gettext as _ -import Errors from Report import * from TextDoc import * import gtk import gnome.ui -from QuestionDialog import ErrorDialog #------------------------------------------------------------------------ # @@ -60,7 +59,7 @@ class DetDescendantReport(Report): try: self.doc.open(output) except IOError,msg: - gnome.ui.GnomeErrorDialog(_("Could not open %s") % output + "\n" + msg) + ErrorDialog(_("Could not open %s") % output + "\n" + msg) #-------------------------------------------------------------------- # @@ -98,6 +97,9 @@ class DetDescendantReport(Report): NAME Born: DATE PLACE Died: DATE e NAME Born: DATE PLACE Died: PLACE d NAME Born: DATE PLACE c + NAME Born: DATE Died: DATE PLACE b + NAME Born: DATE Died: DATE a + NAME Born: DATE Died: PLACE 9 NAME Born: DATE 8 NAME Born: PLACE Died: DATE PLACE 7 NAME Born: PLACE Died: DATE 6 @@ -137,7 +139,7 @@ class DetDescendantReport(Report): #print "Child List: <", birth.getDate(), ">", birth.getPlaceName() if birth.getDate() != "": #print birth.getPlaceName() - if birth.getPlaceName() != None: + if birth.getPlaceName() != "": if death.getDate() != "": if death.getPlaceName() != "": self.doc.write_text(_("- %s Born: %s %s Died: %s %s") % \ @@ -162,13 +164,13 @@ class DetDescendantReport(Report): else: self.doc.write_text(_("- %s Born: %s Died: %s") % \ (name, birth.getDate(), death.getDate())) # a - elif death.PlaceName() != "": + elif death.getPlaceName() != "": self.doc.write_text(_("- %s Born: %s Died: %s") % \ - (name, birth.getDate(), birth.getPlaceName())) # 9 + (name, birth.getDate(), death.getPlaceName())) # 9 else: self.doc.write_text(_("- %s Born: %s") % \ (name, birth.getDate())) # 8 else: - if birth.getPlaceName() != None: + if birth.getPlaceName() != "": if death.getDate() != "": if death.getPlaceName() != "": self.doc.write_text(_("- %s Born: %s Died: %s %s") % \ @@ -178,7 +180,7 @@ class DetDescendantReport(Report): self.doc.write_text(_("- %s Born: %s Died: %s") % \ (name, birth.getPlaceName(), death.getDate())) # 6 elif death.getPlaceName() != "": - self.doc.write_text(_("- %s Born: %s %s Died: %s") % \ + self.doc.write_text(_("- %s Born: %s Died: %s") % \ (name, birth.getPlaceName(), death.getPlaceName())) # 5 else: self.doc.write_text(_("- %s Born: %s") % \ (name, birth.getPlaceName())) # 4 @@ -290,7 +292,7 @@ class DetDescendantReport(Report): else: self.doc.write_text(_(" was born in the year %s.") % date.getYear()) elif place != "": - self.doc.write_text(_(" in %s.") % place) + self.doc.write_text(_(" was born in %s.") % place) else: self.doc.write_text(_(".")) @@ -415,25 +417,25 @@ class DetDescendantReport(Report): if person.getGender() == RelLib.Person.male: if father != "": if mother != "": - self.doc.write_text(_(" %s was the son of %s and %s." % \ - (firstName, father, mother))) + self.doc.write_text(_(" %s was the son of %s and %s.") % \ + (firstName, father, mother)) else: - self.doc.write_text(_(" %s was the son of %s." % \ - (firstName, father))) + self.doc.write_text(_(" %s was the son of %s.") % \ + (firstName, father)) else: - self.doc.write_text(_(" %s was the son of %s." % \ - (firstName, mother))) + self.doc.write_text(_(" %s was the son of %s.") % \ + (firstName, mother)) else: if father != "": if mother != "": - self.doc.write_text(_(" %s was the daughter of %s and %s." % \ - (firstName, father, mother))) + self.doc.write_text(_(" %s was the daughter of %s and %s.") % \ + (firstName, father, mother)) else: - self.doc.write_text(_(" %s was the daughter of %s." % \ - (firstName, father))) + self.doc.write_text(_(" %s was the daughter of %s.") % \ + (firstName, father)) else: - self.doc.write_text(_(" %s was the daughter of %s." % \ - (firstName, mother))) + self.doc.write_text(_(" %s was the daughter of %s.") % \ + (firstName, mother)) def write_marriage(self, person, rptOptions): @@ -441,7 +443,7 @@ class DetDescendantReport(Report): HE/SHE married SPOUSE on FULLDATE in PLACE. HE/SHE married SPOUSE on FULLDATE. HE/SHE married SPOUSE in PLACE. - He/SHE married SPOUSE + HE/SHE married SPOUSE """ famList= person.getFamilyList() if len(famList) > 0: @@ -452,11 +454,11 @@ class DetDescendantReport(Report): if person.getGender() == RelLib.Person.male: if fam.getMother() != None: spouse= fam.getMother().getPrimaryName().getRegularName() - if fam_num == 1: - heshe= _("He") - elif fam_num < len(famList): - heshe= _(",") - else: heshe= _("and he") + if fam_num == 1: + heshe= _("He") + elif fam_num < len(famList): + heshe= _(",") + else: heshe= _("and he") else: if fam_num == 1: heshe= _("She") @@ -488,22 +490,22 @@ class DetDescendantReport(Report): if spouse != "": if fulldate == "" and place == "": - t= _(" %s married %s" % (heshe, spouse)) + t= _(" %s married %s") % (heshe, spouse) elif fulldate == "" and place != "": - t= _(" %s married %s in %s" % (heshe, spouse, place)) + t= _(" %s married %s in %s") % (heshe, spouse, place) elif fulldate != "" and place == "": - t= _(" %s married %s on %s" % (heshe, spouse, fulldate)) - else: t= _(" %s married %s on %s in %s" % \ - (heshe, spouse, fulldate, place)) + t= _(" %s married %s on %s") % (heshe, spouse, fulldate) + else: t= _(" %s married %s on %s in %s") % \ + (heshe, spouse, fulldate, place) else: if fulldate == "" and place == "": t= _(" %s married") elif fulldate == "" and place != "": - t= _(" %s married in %s" % (heshe, place)) + t= _(" %s married in %s") % (heshe, place) elif fulldate != "" and place == "": - t= _(" %s married on %s" % (heshe, fulldate)) - else: t= _(" %s married on %s in %s" % \ - (heshe, fulldate, place)) + t= _(" %s married on %s") % (heshe, fulldate) + else: t= _(" %s married on %s in %s") % \ + (heshe, fulldate, place) if t != "": self.doc.write_text(t) if fam_num == len(famList): self.doc.write_text(".") @@ -630,7 +632,6 @@ class DetDescendantReport(Report): spouseName= fam.getFather().getPrimaryName().getFirstName() self.doc.start_paragraph("Title") - #print "title: ", name, spouseName, spouseName if spouseName != "": name = spouseName + " and " + name @@ -643,7 +644,6 @@ class DetDescendantReport(Report): generation = 0 need_header = 1 -# for generation in xrange(self.max_generations): for generation in xrange(len(self.genKeys)): if self.pgbrk and generation > 0: self.doc.page_break() @@ -655,6 +655,7 @@ class DetDescendantReport(Report): self.prevGenIDs= self.genIDs.copy() self.genIDs.clear() + for key in self.genKeys[generation]: person = self.map[key] self.genIDs[person.getId()]= key @@ -763,60 +764,10 @@ class DetDescendantReportDialog(TextReportDialog): """Create the object that will produce the Detailed Ancestral Report. All user dialog has already been handled and the output file opened.""" - try: - MyReport = DetDescendantReport(self.db, self.person, self.target_path, - self.max_gen, self.pg_brk, self.doc) - MyReport.write_report() - except Errors.ReportError, msg: - ErrorDialog(str(msg)) - except: - import DisplayTrace - DisplayTrace.DisplayTrace() + MyReport = DetDescendantReport(self.db, self.person, self.target_path, + self.max_gen, self.pg_brk, self.doc) + MyReport.write_report() - def add_user_options(self): - - # Create a GTK Checkbox widget for pronoun usage - self.first_name_option = gtk.CheckButton(_("Use first names instead of pronouns")) - self.first_name_option.set_active(0) - - # Create a GTK Checkbox widget for full date usage - self.full_date_option = gtk.CheckButton(_("Use full dates instead of only the year")) - self.full_date_option.set_active(1) - - # Create a GTK Checkbox widget for full date usage - self.list_children_option = gtk.CheckButton(_("List children")) - self.list_children_option.set_active(1) - - # Add new options. The first argument is the tab name for grouping options. - # if you want to put everyting in the generic "Options" category, use - # self.add_option(text,widget) instead of self.add_frame_option(category,text,widget) - - self.add_frame_option('Content','',self.first_name_option) - self.add_frame_option('Content','',self.full_date_option) - self.add_frame_option('Content','',self.list_children_option) - - def parse_report_options_frame(self): - """Parse the report options frame of the dialog. Save the - user selected choices for later use.""" - - # call the parent task to handle normal options - ReportDialog.parse_report_options_frame(self) - - # get values from the widgets - if self.first_name_option.get_active(): - self.firstName = reportOptions.Yes - else: - self.firstName = reportOptions.No - - if self.full_date_option.get_active(): - self.fullDate = reportOptions.Yes - else: - self.fullDate = reportOptions.No - - if self.list_children_option.get_active(): - self.listChildren = reportOptions.Yes - else: - self.listChildren = reportOptions.No #------------------------------------------------------------------------ # @@ -904,7 +855,6 @@ register_report( author_email="bdegrasse1@attbi.com" ) - #------------------------------------------------------------------------ # # @@ -960,7 +910,7 @@ class reportOptions: #Add Photos and Images to report self.addImages= reportOptions.No - self.imageAttrTag= "DetDecendantReport" + self.imageAttrTag= "DetDescendantReport" #Omit sensitive information such as birth, christening, marriage # for living after XXXXX date. @@ -987,7 +937,7 @@ class reportOptions: self.t= "" if birth.getYearValid() and death.getYearValid(): self.age= death.getYear() - birth.getYear() - self.units= "year" + self.units= 3 # year if birth.getMonthValid() and death.getMonthValid(): if birth.getMonth() > death.getMonth(): self.age= self.age -1 @@ -998,10 +948,22 @@ class reportOptions: self.age= death.getMonth() - birth.getMonth() # calc age in months if birth.getDay() > death.getDay(): self.age= self.age - 1 - self.units= "month" + self.units= 2 # month if self.age == 0: self.age= death.getDay() + 31 - birth.getDay() # calc age in days - self.units= "day" - self.t= _(" at the age of %d %s") % (self.age, self.units) - if self.age > 1: self.t= self.t + "s" + self.units= 1 # day + if self.age > 1: + if self.units == 1: + self.t= _(" at the age of %d days") % self.age + elif self.units == 2: + self.t= _(" at the age of %d months") % self.age + else: + self.t= _(" at the age of %d years") % self.age + else: + if self.units == 1: + self.t= _(" at the age of %d day") % self.age + elif self.units == 2: + self.t= _(" at the age of %d month") % self.age + else: + self.t= _(" at the age of %d year") % self.age return self.t diff --git a/src/plugins/EventCmp.py b/src/plugins/EventCmp.py index eb2df8218..d3184fd3e 100644 --- a/src/plugins/EventCmp.py +++ b/src/plugins/EventCmp.py @@ -148,7 +148,7 @@ class EventComparison: def on_apply_clicked(self,obj): cfilter = self.filter_menu.get_active().get_data("filter") - plist = cfilter.apply(self.db.getPersonMap().values()) + plist = cfilter.apply(self.db,self.db.getPersonMap().values()) if len(plist) == 0: WarningDialog(_("No matches were found")) diff --git a/src/plugins/Merge.py b/src/plugins/Merge.py index 1690bc9d3..b35bc73dc 100644 --- a/src/plugins/Merge.py +++ b/src/plugins/Merge.py @@ -134,11 +134,10 @@ class Merge: self.show() def progress_update(self,val): - self.progress.set_value(val) + self.progress.update(val/100.0) while gtk.events_pending(): gtk.mainiteration() - def find_potentials(self,thresh): top = gtk.glade.XML(self.glade_file,"message") self.topWin = top.get_widget("message") diff --git a/src/plugins/Verify.py b/src/plugins/Verify.py index aba06ab61..a72e0477f 100644 --- a/src/plugins/Verify.py +++ b/src/plugins/Verify.py @@ -275,7 +275,7 @@ def on_apply_clicked(obj): }) top = verifyResult.get_widget("verify_result") textwindow = verifyResult.get_widget("textwindow") - textwindow.show_string(text) + textwindow.get_buffer().set_text(text) top.show() #------------------------------------------------------------------------- diff --git a/src/plugins/merge.glade b/src/plugins/merge.glade index 78ba052dd..863889699 100644 --- a/src/plugins/merge.glade +++ b/src/plugins/merge.glade @@ -119,6 +119,8 @@ GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False + 450 + 350 True False True diff --git a/src/plugins/soundgen.py b/src/plugins/soundgen.py index 0bac208e1..d0f84746a 100644 --- a/src/plugins/soundgen.py +++ b/src/plugins/soundgen.py @@ -47,7 +47,6 @@ class SoundGen: self.glade = gtk.glade.XML(glade_file,"soundEx") self.glade.signal_autoconnect({ "destroy_passed_object" : Utils.destroy_passed_object, - "on_combo_insert_text" : Utils.combo_insert_text, "on_apply_clicked" : self.on_apply_clicked, }) diff --git a/src/plugins/verify.glade b/src/plugins/verify.glade index a8b430566..269099f99 100644 --- a/src/plugins/verify.glade +++ b/src/plugins/verify.glade @@ -1,906 +1,1010 @@ - + - - - Database Verify - GRAMPS - GTK_WINDOW_TOPLEVEL - no - yes - yes - yes - GTK_WIN_POS_NONE + + True + Database Verify - GRAMPS + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 500 + 400 + True + False + True - - - no - 0 - yes + + + True + False + 0 - - - 10 - yes - 5 - yes + + + True + GTK_BUTTONBOX_END - - - GTK_BUTTONBOX_END - 30 - yes + + + True + GTK_BUTTONBOX_END + 30 - - - yes - yes - GTK_RELIEF_NORMAL - yes - gtk-close - yes - yes + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + + + + + + + + 0 + False + True + GTK_PACK_END + + - - - - - - 0 - yes - yes - - - - - 0 - no - yes - GTK_PACK_END - - + + + True + False + 0 - - - no - 0 - yes + + + True + Database Verify + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 8 + False + False + + - - - Database Verify - GTK_JUSTIFY_CENTER - no - 0.5 - 0.5 - 0 - 0 - 500 - 16 - yes - - - 8 - no - no - - + + + True + + + 4 + False + True + + - - - yes - - - 4 - no - yes - - + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT - - - 0 - yes - yes - - - - - - - Verify - Settings - GTK_WINDOW_TOPLEVEL - no - no - yes - GTK_WIN_POS_NONE - yes + + + True + True + False + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + False + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + + + + 0 + True + True + + + + + - - - no - 0 - yes + + True + Verify - Settings + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False - - - no - 0 - yes + + + True + False + 0 - - - 5 - General - 0.05 - GTK_SHADOW_ETCHED_IN - yes + + + True + False + 0 - - - 5 - no - 2 - 20 - 8 - 2 - yes + + + 5 + True + 0.05 + 0.5 + GTK_SHADOW_ETCHED_IN - - - Maximum age - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 0 - 1 - 0 - 0 - fill - - - + + + 5 + True + 8 + 2 + False + 2 + 20 - - - Maximum husband-wife age difference - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 1 - 2 - 0 - 0 - fill - - - + + + True + Maximum age + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 0 + 1 + fill + + + - - - Minimum age to marry - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 2 - 3 - 0 - 0 - fill - - - + + + True + Maximum husband-wife age difference + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 1 + 2 + fill + + + - - - Maximum age to marry - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 3 - 4 - 0 - 0 - fill - - - + + + True + Minimum age to marry + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 2 + 3 + fill + + + - - - Maximum number of spouses for a person - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 4 - 5 - 0 - 0 - fill - - - + + + True + Maximum age to marry + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 3 + 4 + fill + + + - - - Maximum number of consecutive years of widowhood - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 5 - 6 - 0 - 0 - fill - - - + + + True + Maximum number of spouses for a person + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 4 + 5 + fill + + + - - - Maximum number of years between children - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 6 - 7 - 0 - 0 - fill - - - + + + True + Maximum number of consecutive years of widowhood + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 5 + 6 + fill + + + - - - Maximum span of years for all children - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 7 - 8 - 0 - 0 - fill - - - + + + True + Maximum number of years between children + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 6 + 7 + fill + + + - - - yes - yes - 8 - 50 - 3 - yes - yes - - - 1 - 2 - 6 - 7 - 0 - 6 - - - - + + + True + Maximum span of years for all children + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 7 + 8 + fill + + + - - - yes - yes - 25 - 50 - 3 - yes - yes - - - 1 - 2 - 7 - 8 - 0 - 6 - - - - + + + True + True + True + True + 0 + 8 + True + * + False + + + 1 + 2 + 6 + 7 + 6 + + + + - - - yes - yes - 3 - 50 - 3 - yes - yes - - - 1 - 2 - 4 - 5 - 0 - 6 - - - - + + + True + True + True + True + 0 + 25 + True + * + False + + + 1 + 2 + 7 + 8 + 6 + + + + - - - yes - yes - 50 - 50 - 3 - yes - yes - - - 1 - 2 - 3 - 4 - 0 - 6 - - - - + + + True + True + True + True + 0 + 3 + True + * + False + + + 1 + 2 + 4 + 5 + 6 + + + + - - - yes - yes - 17 - 50 - 3 - yes - yes - - - 1 - 2 - 2 - 3 - 0 - 6 - - - - + + + True + True + True + True + 0 + 50 + True + * + False + + + 1 + 2 + 3 + 4 + 6 + + + + - - - yes - yes - 30 - 50 - 3 - yes - yes - - - 1 - 2 - 1 - 2 - 0 - 6 - - - - + + + True + True + True + True + 0 + 17 + True + * + False + + + 1 + 2 + 2 + 3 + 6 + + + + - - - yes - yes - 90 - 50 - 3 - yes - yes - - - 1 - 2 - 0 - 1 - 0 - 6 - - - - + + + True + True + True + True + 0 + 30 + True + * + False + + + 1 + 2 + 1 + 2 + 6 + + + + - - - yes - yes - 30 - 50 - 3 - yes - yes - - - 1 - 2 - 5 - 6 - 0 - 6 - - - - - - - - - 0 - yes - yes - - + + + True + True + True + True + 0 + 90 + True + * + False + + + 1 + 2 + 0 + 1 + 6 + + + + - - - no - 0 - yes + + + True + True + True + True + 0 + 30 + True + * + False + + + 1 + 2 + 5 + 6 + 6 + + + + + + - - - 5 - Women - 0.05 - GTK_SHADOW_ETCHED_IN - yes + + + True + General + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + label_item + + + + + 0 + True + True + + - - - 5 - no - 2 - 2 - 3 - 2 - yes + + + True + False + 0 - - - Minimum age to bear a child - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 0 - 1 - 0 - 0 - fill - - - + + + 5 + True + 0.05 + 0.5 + GTK_SHADOW_ETCHED_IN - - - Maximum age to bear a child - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 1 - 2 - 0 - 0 - fill - - - + + + 5 + True + 3 + 2 + False + 2 + 2 - - - yes - yes - 17 - 50 - 3 - yes - yes - - - 1 - 2 - 0 - 1 - 0 - 0 - - - - + + + True + Minimum age to bear a child + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 0 + 1 + fill + + + - - - yes - yes - 49 - 50 - 3 - yes - yes - - - 1 - 2 - 1 - 2 - 0 - 0 - - - - + + + True + Maximum age to bear a child + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 1 + 2 + fill + + + - - - Maximum number of children - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 2 - 3 - 0 - 0 - fill - - - + + + True + True + True + True + 0 + 17 + True + * + False + + + 1 + 2 + 0 + 1 + + + + - - - yes - yes - 11 - 50 - 3 - yes - yes - - - 1 - 2 - 2 - 3 - 0 - 0 - - - - - - - - - 0 - yes - yes - - + + + True + True + True + True + 0 + 49 + True + * + False + + + 1 + 2 + 1 + 2 + + + + - - - 5 - Men - 0.05 - GTK_SHADOW_ETCHED_IN - yes + + + True + Maximum number of children + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 2 + 3 + fill + + + - - - 5 - no - 2 - 2 - 3 - 2 - yes + + + True + True + True + True + 0 + 11 + True + * + False + + + 1 + 2 + 2 + 3 + + + + + + - - - Minimum age to father a child - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 0 - 1 - 0 - 0 - fill - - - + + + True + Women + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + label_item + + + + + 0 + True + True + + - - - Maximum age to father a child - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 1 - 2 - 0 - 0 - fill - - - + + + 5 + True + 0.05 + 0.5 + GTK_SHADOW_ETCHED_IN - - - yes - yes - 18 - 50 - 3 - yes - yes - - - 1 - 2 - 0 - 1 - 0 - 0 - - - - + + + 5 + True + 3 + 2 + False + 2 + 2 - - - yes - yes - 65 - 50 - 3 - yes - yes - - - 1 - 2 - 1 - 2 - 0 - 0 - - - - + + + True + Minimum age to father a child + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 0 + 1 + fill + + + - - - Maximum number of children - GTK_JUSTIFY_LEFT - yes - 0 - 0.5 - 2 - 2 - yes - - - 0 - 1 - 2 - 3 - 0 - 0 - fill - - - + + + True + Maximum age to father a child + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 1 + 2 + fill + + + - - - yes - yes - 15 - 50 - 3 - yes - yes - - - 1 - 2 - 2 - 3 - 0 - 0 - - - - - - - - - 0 - yes - yes - - - - - 0 - yes - yes - - - - - 0 - yes - yes - - + + + True + True + True + True + 0 + 18 + True + * + False + + + 1 + 2 + 0 + 1 + + + + - - - GTK_BUTTONBOX_SPREAD - 30 - yes + + + True + True + True + True + 0 + 65 + True + * + False + + + 1 + 2 + 1 + 2 + + + + - - - yes - yes - GTK_RELIEF_NORMAL - yes - gtk-ok - yes - yes + + + True + Maximum number of children + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 2 + 2 + + + 0 + 1 + 2 + 3 + fill + + + - - - + + + True + True + True + True + 0 + 15 + True + * + False + + + 1 + 2 + 2 + 3 + + + + + + - - - yes - yes - GTK_RELIEF_NORMAL - yes - gtk-cancel - yes - yes + + + True + Men + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + GTK_BUTTONBOX_SPREAD + 30 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + + + + + + 0 + False + True + + + + + - - - - - - 0 - no - yes - - - - -