From 03644b93cffb7a1980e54ee2472fa4ed56530173 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 11 Oct 2003 03:13:41 +0000 Subject: [PATCH] * src/plugins/Verify.py: add ability to disable age estimation * src/plugins/verify.glade: add ability to disable age estimation svn: r2226 --- gramps2/src/plugins/Verify.py | 49 +++++++++---------- gramps2/src/plugins/verify.glade | 80 ++++++++++++++++++++------------ 2 files changed, 73 insertions(+), 56 deletions(-) diff --git a/gramps2/src/plugins/Verify.py b/gramps2/src/plugins/Verify.py index a98169c93..c3555b729 100644 --- a/gramps2/src/plugins/Verify.py +++ b/gramps2/src/plugins/Verify.py @@ -106,7 +106,8 @@ def on_apply_clicked(obj): yngdad = int(verifySettings.get_widget("yngdad").get_text()) wedder = int(verifySettings.get_widget("wedder").get_text()) lngwdw = int(verifySettings.get_widget("lngwdw").get_text()) - + estimate_age = verifySettings.get_widget("estimate").get_active() + oldunm = 99 # maximum age at death for unmarried person error = cStringIO.StringIO() @@ -116,6 +117,7 @@ def on_apply_clicked(obj): idstr = person.getPrimaryName().getName() + " (" + person.getId() + ")" # individual checks + ageatdeath = 0 byear = get_year( person.getBirth() ) bapyear = 0 dyear = get_year( person.getDeath() ) @@ -178,47 +180,38 @@ def on_apply_clicked(obj): if person.getGender() == RelLib.Person.female: error.write( _("Buried before baptism: %(female_name)s baptized %(bapyear)d, buried %(buryear)d.\n") % { 'female_name' : idstr, 'bapyear' : bapyear, 'buryear' : buryear } ) - if byear == 0: - byear = bapyear # guess baptism = birth - if dyear == 0: - dyear = buryear # guess burial = death - if byear>0 and dyear>0: - ageatdeath = dyear - byear - else: - ageatdeath = 0 + if byear == 0 and estimate_age: + byear = bapyear # guess baptism = birth + if dyear == 0 and estimate_age: + dyear = buryear # guess burial = death + if byear>0 and dyear>0: + ageatdeath = dyear - byear + else: + ageatdeath = 0 if ageatdeath > oldage: - if person.getGender() == RelLib.Person.male: - warn.write( _("Old age: %(male_name)s born %(byear)d, died %(dyear)d, at the age of %(ageatdeath)d.\n") % { - 'male_name' : idstr, 'byear' : byear, 'dyear' : dyear, 'ageatdeath' : ageatdeath } ) - if person.getGender() == RelLib.Person.female: - warn.write( _("Old age: %(female_name)s born %(byear)d, died %(dyear)d, at the age of %(ageatdeath)d.\n") % { - 'female_name' : idstr, 'byear' : byear, 'dyear' : dyear, 'ageatdeath' : ageatdeath } ) + if person.getGender() == RelLib.Person.male: + warn.write( _("Old age: %(male_name)s born %(byear)d, died %(dyear)d, at the age of %(ageatdeath)d.\n") % { + 'male_name' : idstr, 'byear' : byear, 'dyear' : dyear, 'ageatdeath' : ageatdeath } ) + if person.getGender() == RelLib.Person.female: + warn.write( _("Old age: %(female_name)s born %(byear)d, died %(dyear)d, at the age of %(ageatdeath)d.\n") % { + 'female_name' : idstr, 'byear' : byear, 'dyear' : dyear, 'ageatdeath' : ageatdeath } ) # gender checks -#FIXME if person.getGender() == RelLib.Person.female: -# parstr = _("mother ") oldpar = oldmom yngpar = yngmom -# waswidstr = _(" was a widow ") if person.getGender() == RelLib.Person.male: -# parstr = _("father ") oldpar = olddad yngpar = yngdad -# waswidstr = _(" was a widower ") if (person.getGender() != RelLib.Person.female) and (person.getGender() != RelLib.Person.male): warn.write( _("Unknown gender for %s.\n") % idstr ) -# parstr = _("parent ") oldpar = olddad yngpar = yngdad -# waswidstr = _(" was a widow ") if (person.getGender() == RelLib.Person.female) and (person.getGender() == RelLib.Person.male): error.write( _("Ambiguous gender for %s.\n") % idstr ) -# parstr = _("parent ") oldpar = olddad yngpar = yngdad -# waswidstr = _(" was a widow ") # multiple parentage check if( len( person.getParentList() ) > 1 ): @@ -264,13 +257,15 @@ def on_apply_clicked(obj): spouse = family.getFather() if spouse != None: if person.getGender() == RelLib.Person.male and \ - person.getPrimaryName().getSurname() == spouse.getPrimaryName().getSurname(): - warn.write( _("Husband and wife with the same surname: %s in family %s, and %s.\n") % ( idstr,family.getId(), spouse.getPrimaryName().getName() ) ) + person.getPrimaryName().getSurname() == spouse.getPrimaryName().getSurname(): + warn.write( _("Husband and wife with the same surname: %s in family %s, and %s.\n") % ( + idstr,family.getId(), spouse.getPrimaryName().getName() ) ) sdyear = get_year( spouse.getDeath() ) if sdyear == 0: sdyear = 0 # burial year maryear = get_year( family.getMarriage() ) - if maryear == 0: # estimate marriage year + + if maryear == 0 and estimate_age: # estimate marriage year cnum=0 for child in family.getChildList(): cnum = cnum + 1 diff --git a/gramps2/src/plugins/verify.glade b/gramps2/src/plugins/verify.glade index 27b377e22..5c94e32b9 100644 --- a/gramps2/src/plugins/verify.glade +++ b/gramps2/src/plugins/verify.glade @@ -2,6 +2,7 @@ + True @@ -173,7 +174,7 @@ 12 True - 17 + 18 3 False 6 @@ -588,8 +589,8 @@ 0 3 - 9 - 10 + 10 + 11 fill @@ -612,8 +613,8 @@ 1 2 - 10 - 11 + 11 + 12 fill @@ -634,8 +635,8 @@ 2 3 - 10 - 11 + 11 + 12 @@ -658,8 +659,8 @@ 1 2 - 11 - 12 + 12 + 13 fill @@ -682,8 +683,8 @@ 1 2 - 12 - 13 + 13 + 14 fill @@ -704,8 +705,8 @@ 2 3 - 11 - 12 + 12 + 13 @@ -726,8 +727,8 @@ 2 3 - 12 - 13 + 13 + 14 @@ -750,8 +751,8 @@ 0 3 - 13 - 14 + 14 + 15 fill @@ -774,8 +775,8 @@ 1 2 - 14 - 15 + 15 + 16 fill @@ -796,8 +797,8 @@ 2 3 - 14 - 15 + 15 + 16 @@ -820,8 +821,8 @@ 1 2 - 15 - 16 + 16 + 17 fill @@ -844,8 +845,8 @@ 1 2 - 16 - 17 + 17 + 18 fill @@ -866,8 +867,8 @@ 2 3 - 15 - 16 + 16 + 17 @@ -888,12 +889,33 @@ 2 3 - 16 - 17 + 17 + 18 + + + + True + True + Estimate missing dates + True + GTK_RELIEF_NORMAL + False + False + True + + + 1 + 3 + 9 + 10 + fill + + + 0