2006-09-12 Don Allingham <don@gramps-project.org>
* src/DataViews/_RelationView.py: provide a waring if a broken family is detected * src/plugins/Check.py: Don't remove families with no parents unless no children exist svn: r7321
This commit is contained in:
parent
86ba2f1338
commit
43fc029947
@ -1,3 +1,9 @@
|
||||
2006-09-12 Don Allingham <don@gramps-project.org>
|
||||
* src/DataViews/_RelationView.py: provide a waring if a broken
|
||||
family is detected
|
||||
* src/plugins/Check.py: Don't remove families with no parents
|
||||
unless no children exist
|
||||
|
||||
2006-09-12 Alex Roitman <shura@gramps-project.org>
|
||||
* src/plugins/TestcaseGenerator.py (fill_object): Use integer
|
||||
confidence level; (generate_date_tests): Remove invalid dates.
|
||||
|
@ -723,20 +723,30 @@ class RelationshipView(PageView.PersonNavView):
|
||||
|
||||
if dobj:
|
||||
if pname:
|
||||
self.write_data(vbox, _('%(event_type)s: %(date)s in %(place)s') %
|
||||
self.write_data(
|
||||
vbox, _('%(event_type)s: %(date)s in %(place)s') %
|
||||
value, start_col, stop_col)
|
||||
else:
|
||||
self.write_data(vbox, _('%(event_type)s: %(date)s') % value,
|
||||
self.write_data(
|
||||
vbox, _('%(event_type)s: %(date)s') % value,
|
||||
start_col, stop_col)
|
||||
elif pname:
|
||||
self.write_data(vbox, _('%(event_type)s: %(place)s') % value,
|
||||
self.write_data(
|
||||
vbox, _('%(event_type)s: %(place)s') % value,
|
||||
start_col, stop_col)
|
||||
else:
|
||||
self.write_data(vbox, _('%(event_type)s:') % value,
|
||||
start_col, stop_col)
|
||||
self.write_data(
|
||||
vbox, _('%(event_type)s:') % value, start_col, stop_col)
|
||||
|
||||
def write_family(self, family_handle):
|
||||
family = self.dbstate.db.get_family_from_handle(family_handle)
|
||||
if family == None:
|
||||
from QuestionDialog import WarningDialog
|
||||
WarningDialog(
|
||||
_('Broken family detected'),
|
||||
_('Please run the Check and Repair Database tool'))
|
||||
return
|
||||
|
||||
father_handle = family.get_father_handle()
|
||||
mother_handle = family.get_mother_handle()
|
||||
if self.dbstate.active.handle == father_handle:
|
||||
|
@ -514,24 +514,10 @@ class CheckIntegrity:
|
||||
father_handle = family.get_father_handle()
|
||||
mother_handle = family.get_mother_handle()
|
||||
|
||||
if not father_handle and not mother_handle:
|
||||
if not father_handle and not mother_handle and \
|
||||
len(family.get_child_ref_list()) == 0:
|
||||
self.empty_family.append(family_id)
|
||||
self.delete_empty_family(family_handle)
|
||||
continue
|
||||
elif not father_handle and len(family.get_child_ref_list()) == 0:
|
||||
person = self.db.get_person_from_handle(mother_handle)
|
||||
person.remove_family_handle(family_handle)
|
||||
self.db.commit_person(person,self.trans)
|
||||
self.db.remove_family(family_handle,self.trans)
|
||||
self.empty_family.append(family_id)
|
||||
continue
|
||||
elif not mother_handle and len(family.get_child_ref_list()) == 0:
|
||||
person = self.db.get_person_from_handle(father_handle)
|
||||
person.remove_family_handle(family_handle)
|
||||
self.db.commit_person(person,self.trans)
|
||||
self.db.remove_family(family_handle,self.trans)
|
||||
self.empty_family.append(family_id)
|
||||
continue
|
||||
|
||||
def delete_empty_family(self,family_handle):
|
||||
for key in self.db.get_person_handles(sort_handles=False):
|
||||
|
Loading…
Reference in New Issue
Block a user