From 541f9bbb11839aefc3acba9a86d0be8af4ecd833 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 5 Aug 2001 19:11:26 +0000 Subject: [PATCH] Improved integrity check, fix parent lists when no active parents svn: r294 --- src/gramps_main.py | 6 ++++-- src/plugins/Check.py | 38 +++++++++++++++++++++++++++++++++----- src/plugins/summary.glade | 2 +- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/gramps_main.py b/src/gramps_main.py index 7b63e2734..7cbadc433 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -589,8 +589,8 @@ def on_choose_parents_clicked(obj): family_window.get_widget("frel").set_text(_(f[2])) break else: - family_window.get_widget("mrel").set_text(_("Unknown")) - family_window.get_widget("frel").set_text(_("Unknown")) + family_window.get_widget("mrel").set_text(_("Birth")) + family_window.get_widget("frel").set_text(_("Birth")) fcombo = family_window.get_widget("prel_combo") prel = family_window.get_widget("prel") @@ -610,6 +610,8 @@ def on_choose_parents_clicked(obj): family_window.get_widget("chooseTitle").set_text(text) if active_parents: prel.set_text(active_parents.getRelationship()) + else: + on_prel_changed(prel) familyDialog.show() #------------------------------------------------------------------------- diff --git a/src/plugins/Check.py b/src/plugins/Check.py index c59223d13..09767d4f5 100644 --- a/src/plugins/Check.py +++ b/src/plugins/Check.py @@ -85,6 +85,7 @@ class CheckIntegrity: if family_type[0] == family: break else: + family.removeChild(child) self.broken_links.append((child,family)) #------------------------------------------------------------------------- @@ -140,6 +141,8 @@ class CheckIntegrity: mother = family.getMother() type = family.getRelationship() + if not father or not mother: + continue if type != "Partners": if father.getGender() == mother.getGender(): family.setRelationship("Partners") @@ -176,10 +179,24 @@ class CheckIntegrity: return text = "" - if blink == 1: - text = text + _("1 broken family link was found\n") - elif blink > 1: - text = text + _("%d broken family links were found\n") % blink + if blink > 0: + if blink == 1: + text = text + _("1 broken family link was fixed\n") + else: + text = text + _("%d broken family links were found\n") % blink + for c in self.broken_links: + cn = c[0].getPrimaryName().getName() + f = c[1].getFather() + m = c[1].getMother() + if f and m: + pn = _("%s and %s") % (f.getPrimaryName().getName(),\ + m.getPrimaryName().getName()) + elif f: + pn = f.getPrimaryName().getName() + else: + pn = m.getPrimaryName().getName() + text = text + '\t' + \ + _("%s was removed from the family of %s\n") % (cn,pn) if efam == 1: text = text + _("1 empty family was found\n") elif efam > 1: @@ -197,7 +214,18 @@ class CheckIntegrity: elif pphotos > 1: text = text + _("%d broken personal images were found\n") % pphotos - GnomeWarningDialog(string.strip(text)) + base = os.path.dirname(__file__) + glade_file = base + os.sep + "summary.glade" + topDialog = GladeXML(glade_file,"summary") + topDialog.signal_autoconnect({ + "destroy_passed_object" : utils.destroy_passed_object, + }) + title = _("Check Integrity") + top = topDialog.get_widget("summary") + textwindow = topDialog.get_widget("textwindow") + topDialog.get_widget("summaryTitle").set_text(title) + textwindow.show_string(text) + top.show() #------------------------------------------------------------------------- # diff --git a/src/plugins/summary.glade b/src/plugins/summary.glade index 60b0a07a3..874b5a821 100644 --- a/src/plugins/summary.glade +++ b/src/plugins/summary.glade @@ -90,7 +90,7 @@ GtkLabel summaryTitle - 400 + 500 16 GTK_JUSTIFY_CENTER