* 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
This commit is contained in:
Martin Hawlisch 2005-05-28 06:21:37 +00:00
parent 811014e1c2
commit d120265624
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-05-28 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* 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 <jya@sverige.nu>
* src/po/sv.po: A few fixes to the Swedish translation.

View File

@ -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

View File

@ -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()

View File

@ -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