Exemplo n.º 1
0
 def new_child_added(self, person):
     ref = ChildRef()
     ref.ref = person.get_handle()
     self.family.add_child_ref(ref)
     self.rebuild()
     GLib.idle_add(self.tree.scroll_to_cell, len(self.family.get_child_ref_list()) - 1)
     self.call_edit_childref(ref)
Exemplo n.º 2
0
 def new_child_added(self, person):
     ref = ChildRef()
     ref.ref = person.get_handle()
     self.family.add_child_ref(ref)
     self.rebuild()
     GLib.idle_add(self.tree.scroll_to_cell,
                   len(self.family.get_child_ref_list()) - 1)
     self.call_edit_childref(ref)
Exemplo n.º 3
0
    def callback_add_child(self, person, family_handle):
        ref = ChildRef()
        ref.ref = person.get_handle()
        family = self.dbstate.db.get_family_from_handle(family_handle)
        family.add_child_ref(ref)

        with DbTxn(_("Add Child to Family"), self.dbstate.db) as trans:
            #add parentref to child
            person.add_parent_family_handle(family_handle)
            #default relationship is used
            self.dbstate.db.commit_person(person, trans)
            #add child to family
            self.dbstate.db.commit_family(family, trans)
Exemplo n.º 4
0
    def add_parent_family(self, obj, event, handle):
        if button_activated(event, _LEFT_BUTTON):
            family = Family()
            person = self.dbstate.db.get_person_from_handle(self.get_handle())

            ref = ChildRef()
            ref.ref = person.handle
            family.add_child_ref(ref)

            try:
                EditFamily(self.dbstate, self.uistate, [], family)
            except WindowActiveError:
                pass
Exemplo n.º 5
0
    def add_parents(self, *obj):
        family = Family()
        person = self.dbstate.db.get_person_from_handle(self.handle)

        if not person:
            return

        ref = ChildRef()
        ref.ref = person.handle
        family.add_child_ref(ref)

        try:
            EditFamily(self.dbstate, self.uistate, [], family)
        except WindowActiveError:
            pass
Exemplo n.º 6
0
    def share_button_clicked(self, obj=None):
        # it only makes sense to skip those who are already in the family
        skip_list = [self.family.get_father_handle(), self.family.get_mother_handle()]
        skip_list.extend(x.ref for x in self.family.get_child_ref_list())

        sel = SelectPerson(self.dbstate, self.uistate, self.track, _("Select Child"), skip=skip_list)
        person = sel.run()

        if person:
            ref = ChildRef()
            ref.ref = person.get_handle()
            self.family.add_child_ref(ref)
            self.rebuild()
            GLib.idle_add(self.tree.scroll_to_cell, len(self.family.get_child_ref_list()) - 1)
            self.call_edit_childref(ref)
Exemplo n.º 7
0
    def share_button_clicked(self, obj=None):
        # it only makes sense to skip those who are already in the family
        skip_list = [self.family.get_father_handle(),
                     self.family.get_mother_handle()]
        skip_list.extend(x.ref for x in self.family.get_child_ref_list())

        sel = SelectPerson(self.dbstate, self.uistate, self.track,
                           _("Select Child"), skip=skip_list)
        person = sel.run()

        if person:
            ref = ChildRef()
            ref.ref = person.get_handle()
            self.family.add_child_ref(ref)
            self.rebuild()
            GLib.idle_add(self.tree.scroll_to_cell,
                             len(self.family.get_child_ref_list()) - 1)
            self.call_edit_childref(ref)