* src/PeopleView.py: broken out of gramps_main.py, fixed

add/delete
* src/gramps_main.py: people view removed, fixed add/delete


svn: r2193
This commit is contained in:
Don Allingham 2003-10-05 04:34:31 +00:00
parent b72945e6f0
commit ac72f0f50c
2 changed files with 14 additions and 14 deletions

View File

@ -153,7 +153,8 @@ class PeopleView:
del_id = pid del_id = pid
if self.id2col.has_key(del_id): if self.id2col.has_key(del_id):
model.remove(self.id2iter[del_id]) (model,iter) = self.id2col[del_id]
model.remove(iter)
del self.id2col[del_id] del self.id2col[del_id]
if person == self.parent.active_person: if person == self.parent.active_person:
@ -189,7 +190,7 @@ class PeopleView:
self.id2col[key] = (model,iter) self.id2col[key] = (model,iter)
if change: if change:
self.change_active_person(person) self.parent.change_active_person(person)
self.goto_active_person() self.goto_active_person()
model.sort() model.sort()
@ -372,4 +373,7 @@ class PeopleView:
menu.append(item) menu.append(item)
menu.popup(None,None,None,0,0) menu.popup(None,None,None,0,0)
def redisplay_person_list(self,person):
self.add_to_person_list(person,1)

View File

@ -642,7 +642,7 @@ class Gramps:
page = self.views.get_current_page() page = self.views.get_current_page()
if page == PERSON_VIEW: if page == PERSON_VIEW:
mlist = self.person_tree.get_selected_objects() mlist = self.people_view.person_tree.get_selected_objects()
if len(mlist) != 2: if len(mlist) != 2:
msg = _("Cannot merge people.") msg = _("Cannot merge people.")
@ -1423,7 +1423,7 @@ class Gramps:
def load_selected_people(self,obj): def load_selected_people(self,obj):
"""Display the selected people in the EditPerson display""" """Display the selected people in the EditPerson display"""
mlist = self.person_tree.get_selected_objects() mlist = self.people_view.person_tree.get_selected_objects()
if mlist and self.active_person == self.db.getPerson(mlist[0]): if mlist and self.active_person == self.db.getPerson(mlist[0]):
self.load_person(self.active_person) self.load_person(self.active_person)
@ -1442,7 +1442,7 @@ class Gramps:
DisplayTrace.DisplayTrace() DisplayTrace.DisplayTrace()
def delete_person_clicked(self,obj): def delete_person_clicked(self,obj):
mlist = self.person_tree.get_selected_objects() mlist = self.people_view.person_tree.get_selected_objects()
for sel in mlist: for sel in mlist:
p = self.db.getPerson(sel) p = self.db.getPerson(sel)
@ -1481,8 +1481,8 @@ class Gramps:
family.removeChild(self.active_person) family.removeChild(self.active_person)
self.db.removePerson(self.active_person.getId()) self.db.removePerson(self.active_person.getId())
self.remove_from_person_list(self.active_person) self.people_view.remove_from_person_list(self.active_person)
self.person_model.sort_column_changed() self.people_view.person_model.sort_column_changed()
try: try:
self.mhistory = self.mhistory[:-2] self.mhistory = self.mhistory[:-2]
self.change_active_person(self.mhistory[-2]) self.change_active_person(self.mhistory[-2])
@ -1493,9 +1493,9 @@ class Gramps:
Utils.modified() Utils.modified()
def merge_update(self,p1,p2,old_id): def merge_update(self,p1,p2,old_id):
self.remove_from_person_list(p1,old_id) self.people_view.remove_from_person_list(p1,old_id)
self.remove_from_person_list(p2) self.people_view.remove_from_person_list(p2)
self.redisplay_person_list(p1) self.people_view.redisplay_person_list(p1)
self.update_display(0) self.update_display(0)
def goto_active_person(self,first=0): def goto_active_person(self,first=0):
@ -1784,10 +1784,6 @@ class Gramps:
self.people_view.redisplay_person_list(person) self.people_view.redisplay_person_list(person)
self.update_display(0) self.update_display(0)
def redisplay_person_list(self,person):
self.people_view.add_to_person_list(person,1)
def load_person(self,person): def load_person(self,person):
if person: if person:
try: try: