diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index bda911789..49f13d663 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2005-06-16 Martin Hawlisch + * src/gramps_main.py (on_merge_activate,on_fast_merge_activate): + only merge if exactly two persons have been selected + 2005-06-15 Alex Roitman * src/WriteGedcom.py (GedcomWriterOptionBox.get_option_box): Build person-centered filters only if a person is selected. diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 4d735ca37..2f678d651 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -1080,7 +1080,14 @@ class Gramps(GrampsDBCallback.GrampsDBCallback): import MergePeople p1 = self.db.get_person_from_handle(mlist[0]) p2 = self.db.get_person_from_handle(mlist[1]) - merger = MergePeople.MergePeopleUI(self.db,p1,p2,self.merge_update) + if p1 and p2: + merger = MergePeople.MergePeopleUI(self.db,p1,p2,self.merge_update) + else: + msg = _("Cannot merge people.") + msg2 = _("Exactly two people must be selected to perform a merge. " + "A second person can be selected by holding down the " + "control key while clicking on the desired person.") + ErrorDialog(msg,msg2) elif page == PLACE_VIEW: self.place_view.merge() elif page == SOURCE_VIEW: @@ -1103,7 +1110,14 @@ class Gramps(GrampsDBCallback.GrampsDBCallback): import MergePeople p1 = self.db.get_person_from_handle(mlist[0]) p2 = self.db.get_person_from_handle(mlist[1]) - merger = MergePeople.Compare(self.db,p1,p2,self.merge_update) + if p1 and p2: + merger = MergePeople.Compare(self.db,p1,p2,self.merge_update) + else: + msg = _("Cannot merge people.") + msg2 = _("Exactly two people must be selected to perform a merge. " + "A second person can be selected by holding down the " + "control key while clicking on the desired person.") + ErrorDialog(msg,msg2) elif page == PLACE_VIEW: self.place_view.merge() elif page == SOURCE_VIEW: