Filter problem fixes

svn: r4759
This commit is contained in:
Don Allingham 2005-06-02 20:31:39 +00:00
parent aceb486b79
commit bb2e2fd1cc
2 changed files with 20 additions and 20 deletions

View File

@ -1,3 +1,7 @@
2005-06-02 Don Allingham <don@gramps-project.org>
* src/ChooseParents.py: fixed all_males filtering problem, display
all people when a person is blocked by the likely filter
2005-06-02 Alex Roitman <shura@gramps-project.org> 2005-06-02 Alex Roitman <shura@gramps-project.org>
* src/ReadGedcom.py (get_next): Use single space to split the line * src/ReadGedcom.py (get_next): Use single space to split the line
into level, tag, and the field contents; strip extra white space into level, tag, and the field contents; strip extra white space

View File

@ -93,7 +93,7 @@ class ChooseParents:
db.connect('person-add', self.redraw) db.connect('person-add', self.redraw)
db.connect('person-update', self.redraw) db.connect('person-update', self.redraw)
db.connect('person-delete', self.redraw) db.connect('person-delete', self.redraw)
db.connect('person-rebuild', self.redraw2) db.connect('person-rebuild', self.redraw)
# set default filters # set default filters
self.all_males_filter = GenericFilter.GenericFilter() self.all_males_filter = GenericFilter.GenericFilter()
@ -286,14 +286,6 @@ class ChooseParents:
def redraw(self,handle_list): def redraw(self,handle_list):
self.redrawf() self.redrawf()
self.redrawm() self.redrawm()
# self.father_model.rebuild_data()
# self.mother_model.rebuild_data()
def redraw2(self):
self.redrawf()
self.redrawm()
# self.father_model.rebuild_data()
# self.mother_model.rebuild_data()
def redrawf(self): def redrawf(self):
"""Redraws the potential father list""" """Redraws the potential father list"""
@ -326,7 +318,7 @@ class ChooseParents:
def showallf_toggled(self,obj): def showallf_toggled(self,obj):
if self.father_filter == self.likely_males_filter: if self.father_filter == self.likely_males_filter:
self.father_filter = self.all_females_filter self.father_filter = self.all_males_filter
else: else:
self.father_filter = self.likely_males_filter self.father_filter = self.likely_males_filter
self.redrawf() self.redrawf()
@ -529,11 +521,13 @@ class ChooseParents:
self.father_selection.select_path(path) self.father_selection.select_path(path)
self.father_list.scroll_to_cell(path,None,1,0.5,0) self.father_list.scroll_to_cell(path,None,1,0.5,0)
except KeyError: except KeyError:
WarningDialog(_("Added person is not visible"), self.father_filter = self.all_males_filter
_("The person you added is currently " self.showallf_toggled(None)
"not visible due to the chosen filter. " path = self.father_model.on_get_path(handle)
"This may occur if you did not specify " top_path = self.father_model.on_get_path(name)
"a birth date.")) 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)
else: else:
try: try:
path = self.mother_model.on_get_path(handle) path = self.mother_model.on_get_path(handle)
@ -542,11 +536,13 @@ class ChooseParents:
self.mother_selection.select_path(path) self.mother_selection.select_path(path)
self.mother_list.scroll_to_cell(path,None,1,0.5,0) self.mother_list.scroll_to_cell(path,None,1,0.5,0)
except: except:
WarningDialog(_("Added person is not visible"), self.mother_filter = self.all_females_filter
_("The person you added is currently " self.showallm_toggled(None)
"not visible due to the chosen filter. " path = self.mother_model.on_get_path(handle)
"This may occur if you did not specify " top_path = self.mother_model.on_get_path(name)
"a birth date.")) 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)
def add_parent_clicked(self,obj): def add_parent_clicked(self,obj):
"""Called with the Add New Person button is pressed. Calls the QuickAdd """Called with the Add New Person button is pressed. Calls the QuickAdd