* src/PeopleModel.py: clear data cache

svn: r5907
This commit is contained in:
Don Allingham 2006-02-09 05:10:20 +00:00
parent 3b92398870
commit 57359f125d
3 changed files with 23 additions and 19 deletions

View File

@ -1,4 +1,5 @@
2006-02-08 Don Allingham <don@gramps-project.org>
* src/PeopleModel.py: clear data cache
* src/EditFamily.py: set focus on surname
* src/EditPerson.py: hook up add child
* src/PersonView.py: fix delete person dispay

View File

@ -170,6 +170,9 @@ class PeopleModel(gtk.GenericTreeModel):
self.temp_top_path2iter = locale_sort(self.temp_sname_sub.keys())
for name in self.temp_top_path2iter:
self.build_sub_entry(name)
def clear_cache(self):
self.prev_handle = None
def build_sub_entry(self,name):
self.prev_handle = None

View File

@ -484,6 +484,7 @@ class PersonView(PageView.PersonNavView):
pickle.dumps(selected_ids))
def person_added(self,handle_list):
self.model.clear_cache()
for node in handle_list:
person = self.dbstate.db.get_person_from_handle(node)
top = person.get_primary_name().get_group_name()
@ -500,25 +501,26 @@ class PersonView(PageView.PersonNavView):
self.model.row_inserted(path,pnode)
def person_removed(self,handle_list):
for node in handle_list:
person = self.dbstate.db.get_person_from_handle(node)
top = person.get_primary_name().get_group_name()
mylist = self.model.sname_sub.get(top,[])
self.model.calculate_data()
if mylist:
try:
path = self.model.on_get_path(node)
self.model.row_deleted(path)
print "delete",path
if len(mylist) == 1:
path = self.model.on_get_path(top)
print "delete",path
self.model.row_deleted(path)
except KeyError:
pass
self.model.assign_data()
self.model.clear_cache()
self.build_tree()
# for node in handle_list:
# person = self.dbstate.db.get_person_from_handle(node)
# top = person.get_primary_name().get_group_name()
# mylist = self.model.sname_sub.get(top,[])
# self.model.calculate_data()
# if mylist:
# try:
# path = self.model.on_get_path(node)
# self.model.row_deleted(path)
# if len(mylist) == 1:
# path = self.model.on_get_path(top)
# self.model.row_deleted(path)
# except KeyError:
# pass
# self.model.assign_data()
def person_updated(self,handle_list):
self.model.clear_cache()
for node in handle_list:
person = self.dbstate.db.get_person_from_handle(node)
try:
@ -577,10 +579,8 @@ class PersonView(PageView.PersonNavView):
path = self.model.on_get_path(node)
pnode = self.model.get_iter(path)
self.model.row_inserted(path,pnode)
self.goto_active_person()
def get_selected_objects(self):
(mode,paths) = self.selection.get_selected_rows()
mlist = []