* src/ChooseParents.py: handle the addition of a person correctly.

Warn if the person just added is suppressed by the filter.
* src/MergePeople.py: use __debug__ for print statements

* src/MergePeople.py: fixed name merging, incorporate Martin's
patches.


svn: r4653
This commit is contained in:
Don Allingham
2005-05-22 03:47:00 +00:00
parent a169d828bc
commit 2281e7246f
3 changed files with 108 additions and 41 deletions

View File

@@ -57,7 +57,7 @@ import Date
import NameDisplay
import DateHandler
import GenericFilter
from QuestionDialog import ErrorDialog
from QuestionDialog import ErrorDialog, WarningDialog
#-------------------------------------------------------------------------
#
@@ -284,12 +284,16 @@ class ChooseParents:
gnome.help_display('gramps-manual','gramps-edit-quick')
def redraw(self,handle_list):
self.father_model.rebuild_data()
self.mother_model.rebuild_data()
self.redrawf()
self.redrawm()
# self.father_model.rebuild_data()
# self.mother_model.rebuild_data()
def redraw2(self):
self.father_model.rebuild_data()
self.mother_model.rebuild_data()
self.redrawf()
self.redrawm()
# self.father_model.rebuild_data()
# self.mother_model.rebuild_data()
def redrawf(self):
"""Redraws the potential father list"""
@@ -518,17 +522,31 @@ class ChooseParents:
if self.type == RelLib.Family.CIVIL_UNION:
self.parent_relation_changed(self.prel)
elif person.get_gender() == RelLib.Person.MALE:
path = self.father_model.on_get_path(handle)
top_path = self.father_model.on_get_path(name)
self.father_list.expand_row(top_path,0)
self.father_selection.select_path(path)
self.father_list.scroll_to_cell(path,None,1,0.5,0)
try:
path = self.father_model.on_get_path(handle)
top_path = self.father_model.on_get_path(name)
self.father_list.expand_row(top_path,0)
self.father_selection.select_path(path)
self.father_list.scroll_to_cell(path,None,1,0.5,0)
except KeyError:
WarningDialog(_("Added person is not visible"),
_("The person you added is currently "
"not visible due to the chosen filter. "
"This may occur if you did not specify "
"a birth date."))
else:
path = self.mother_model.on_get_path(handle)
top_path = self.mother_model.on_get_path(name)
self.mother_list.expand_row(top_path,0)
self.mother_selection.select_path(path)
self.mother_list.scroll_to_cell(path,None,1,0.5,0)
try:
path = self.mother_model.on_get_path(handle)
top_path = self.mother_model.on_get_path(name)
self.mother_list.expand_row(top_path,0)
self.mother_selection.select_path(path)
self.mother_list.scroll_to_cell(path,None,1,0.5,0)
except:
WarningDialog(_("Added person is not visible"),
_("The person you added is currently "
"not visible due to the chosen filter. "
"This may occur if you did not specify "
"a birth date."))
def add_parent_clicked(self,obj):
"""Called with the Add New Person button is pressed. Calls the QuickAdd