diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 1c5d9ade1..63960ca69 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2006-04-06 Don Allingham + * src/DataViews/_FamilyView.py: add select parents function + 2006-04-06 Alex Roitman * various: Revert back to using gettext except for the modules that need context -- those will use TransUtils.sgettext diff --git a/gramps2/src/DataViews/_FamilyView.py b/gramps2/src/DataViews/_FamilyView.py index 640a4cc20..807cf1c16 100644 --- a/gramps2/src/DataViews/_FamilyView.py +++ b/gramps2/src/DataViews/_FamilyView.py @@ -424,6 +424,11 @@ class FamilyView(PageView.PersonNavView): add = GrampsWidgets.IconButton(call_fcn,None,gtk.STOCK_ADD) hbox.pack_start(add,False) + + if is_parent: + add = GrampsWidgets.IconButton(self.select_family,None,gtk.STOCK_INDEX) + hbox.pack_start(add,False) + if family: edit = GrampsWidgets.IconButton(self.edit_family,family.handle, gtk.STOCK_EDIT) @@ -682,6 +687,27 @@ class FamilyView(PageView.PersonNavView): except Errors.WindowActiveError: pass + def select_family(self, obj, event, handle): + if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: + from SelectFamily import SelectFamily + + dialog = SelectFamily(self.dbstate.db, _('Select Family')) + family = dialog.run() + + person = self.dbstate.db.get_person_from_handle(self.dbstate.active.handle) + + family.add_child_handle(person.handle) + + person.add_parent_family_handle( + family.handle, + (RelLib.Person.CHILD_BIRTH,''), + (RelLib.Person.CHILD_BIRTH,'')) + + trans = self.dbstate.db.transaction_begin() + self.dbstate.db.commit_person(person,trans) + self.dbstate.db.commit_family(family,trans) + self.dbstate.db.transaction_commit(trans,_("Add Family")) + def add_parent_family(self,obj,event,handle): if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: from Editors import EditFamily