* src/ChooseParents.py: optimize the add of a person to the models
svn: r4842
This commit is contained in:
parent
74f29ec489
commit
295b7d1a2b
@ -1,4 +1,5 @@
|
|||||||
2005-06-17 Don Allingham <don@gramps-project.org>
|
2005-06-17 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/ChooseParents.py: optimize the add of a person to the models
|
||||||
* src/EditPlace.py: check to make sure a duplicate title is not
|
* src/EditPlace.py: check to make sure a duplicate title is not
|
||||||
entered
|
entered
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ class ChooseParents:
|
|||||||
self.parent_selected = 0
|
self.parent_selected = 0
|
||||||
self.renderer = gtk.CellRendererText()
|
self.renderer = gtk.CellRendererText()
|
||||||
|
|
||||||
db.connect('person-add', self.redraw)
|
db.connect('person-add', self.person_added)
|
||||||
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.redraw)
|
db.connect('person-rebuild', self.redraw)
|
||||||
@ -283,6 +283,26 @@ class ChooseParents:
|
|||||||
"""Display the relevant portion of GRAMPS manual"""
|
"""Display the relevant portion of GRAMPS manual"""
|
||||||
gnome.help_display('gramps-manual','gramps-edit-quick')
|
gnome.help_display('gramps-manual','gramps-edit-quick')
|
||||||
|
|
||||||
|
def person_added(self,handle_list):
|
||||||
|
self.person_added_base(handle_list,self.father_model, self.father_filter)
|
||||||
|
self.person_added_base(handle_list,self.mother_model, self.mother_filter)
|
||||||
|
|
||||||
|
def person_added_base(self,handle_list,model,data_filter):
|
||||||
|
for node in handle_list:
|
||||||
|
person = self.db.get_person_from_handle(node)
|
||||||
|
top = person.get_primary_name().get_group_name()
|
||||||
|
model.rebuild_data(data_filter)
|
||||||
|
if not model.is_visable(node):
|
||||||
|
continue
|
||||||
|
if (not model.sname_sub.has_key(top) or
|
||||||
|
len(model.sname_sub[top]) == 1):
|
||||||
|
path = model.on_get_path(top)
|
||||||
|
pnode = model.get_iter(path)
|
||||||
|
model.row_inserted(path,pnode)
|
||||||
|
path = model.on_get_path(node)
|
||||||
|
pnode = model.get_iter(path)
|
||||||
|
model.row_inserted(path,pnode)
|
||||||
|
|
||||||
def redraw(self,handle_list):
|
def redraw(self,handle_list):
|
||||||
self.redrawf()
|
self.redrawf()
|
||||||
self.redrawm()
|
self.redrawm()
|
||||||
@ -522,7 +542,7 @@ class ChooseParents:
|
|||||||
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:
|
||||||
self.father_filter = self.all_males_filter
|
self.father_filter = self.all_males_filter
|
||||||
self.showallf_toggled(None)
|
self.redrawf()
|
||||||
path = self.father_model.on_get_path(handle)
|
path = self.father_model.on_get_path(handle)
|
||||||
top_path = self.father_model.on_get_path(name)
|
top_path = self.father_model.on_get_path(name)
|
||||||
self.father_list.expand_row(top_path,0)
|
self.father_list.expand_row(top_path,0)
|
||||||
@ -537,7 +557,7 @@ class ChooseParents:
|
|||||||
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:
|
||||||
self.mother_filter = self.all_females_filter
|
self.mother_filter = self.all_females_filter
|
||||||
self.showallm_toggled(None)
|
self.redrawm()
|
||||||
path = self.mother_model.on_get_path(handle)
|
path = self.mother_model.on_get_path(handle)
|
||||||
top_path = self.mother_model.on_get_path(name)
|
top_path = self.mother_model.on_get_path(name)
|
||||||
self.mother_list.expand_row(top_path,0)
|
self.mother_list.expand_row(top_path,0)
|
||||||
|
Loading…
Reference in New Issue
Block a user