From d1202656249dc5db92e0d2f1c0ee72fc7017c15b Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Sat, 28 May 2005 06:21:37 +0000 Subject: [PATCH] * src/gramps_main.py (change_active_person): Dont change to the current active person again. * src/FamilyView.py (drag_data_received): Allow reordering of childs when they were not correctly ordered before. svn: r4725 --- gramps2/ChangeLog | 6 ++++++ gramps2/src/FamilyView.py | 7 ++++++- gramps2/src/SelectChild.py | 1 + gramps2/src/gramps_main.py | 9 +++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 4049757aa..bc0b1c0fc 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,9 @@ +2005-05-28 Martin Hawlisch + * src/gramps_main.py (change_active_person): Dont change to the + current active person again. + * src/FamilyView.py (drag_data_received): Allow reordering of childs + when they were not correctly ordered before. + 2005-05-23 Jens Arvidsson * src/po/sv.po: A few fixes to the Swedish translation. diff --git a/gramps2/src/FamilyView.py b/gramps2/src/FamilyView.py index 2b65b001b..cd0f9647e 100644 --- a/gramps2/src/FamilyView.py +++ b/gramps2/src/FamilyView.py @@ -790,6 +790,7 @@ class FamilyView: self.parent.db.commit_family(family,trans) self.parent.db.commit_person(person,trans) + # TODO: Add child ordered by birth day family.add_child_handle(new_person.get_handle()) new_person.add_parent_family_handle(family.get_handle(), RelLib.Person.CHILD_REL_BIRTH, @@ -1467,11 +1468,15 @@ class FamilyView: src = spath[0] child_list = self.family.get_child_handle_list() + # Check if the children were in order before the attempt to reorder + was_ordered = self.birth_dates_in_order(child_list) + obj = child_list[src] child_list.remove(obj) child_list.insert(row,obj) - if self.birth_dates_in_order(child_list) == 0: + # abort if a valid order was attempt to destroy + if was_ordered and self.birth_dates_in_order(child_list) == False: WarningDialog(_("Attempt to Reorder Children Failed"), _("Children must be ordered by their birth dates.")) return diff --git a/gramps2/src/SelectChild.py b/gramps2/src/SelectChild.py index cdc3553c4..18d201f41 100644 --- a/gramps2/src/SelectChild.py +++ b/gramps2/src/SelectChild.py @@ -308,6 +308,7 @@ class SelectChild: self.top) return + # TODO: Add child ordered by birth day self.family.add_child_handle(select_child.get_handle()) mrel = self.mrel.get_active() diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 157e4e550..ba65bf690 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -1527,6 +1527,15 @@ class Gramps(GrampsDBCallback.GrampsDBCallback): self.people_view.goto_active_person() def change_active_person(self,person,force=0): + nph = "" + if person: + nph = person.get_handle() + oph = "" + if self.active_person: + oph = self.active_person.get_handle() + if nph == oph: # no need to change to the current active person again + return + if person == None: self.set_buttons(0) self.active_person = None