* src/gramps_main.py (delete_person_response): Add remove_from_history

call before deleting the person.
* src/PeopleView.py (remove_from_history): Add function;
(row_changed) Remove extra change_active_person() call.


svn: r2201
This commit is contained in:
Alex Roitman 2003-10-06 22:49:16 +00:00
parent 3dd61f752a
commit 463d8be93d
3 changed files with 29 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2003-10-06 Alex Roitman <shura@alex.neuro.umn.edu>
* src/gramps_main.py (delete_person_response): Add remove_from_history
call before deleting the person.
* src/PeopleView.py (remove_from_history): Add function;
(row_changed) Remove extra change_active_person() call.
2003-10-06 Tim Waugh <twaugh@redhat.com>
* src/Makefile.am: Ship PeopleView.py and PeopleStore.py.

View File

@ -84,7 +84,6 @@ class PeopleView:
def row_changed(self,obj):
mlist = self.person_tree.get_selected_objects()
if mlist and mlist[0]:
self.parent.change_active_person(self.parent.db.getPerson(mlist[0]))
try:
self.parent.change_active_person(self.parent.db.getPerson(mlist[0]))
except:
@ -160,6 +159,22 @@ class PeopleView:
if person == self.parent.active_person:
self.parent.active_person = None
def remove_from_history(self,person,old_id=None):
pid = person.getId()
if old_id:
del_id = old_id
else:
del_id = pid
hc = self.parent.history.count(del_id)
for c in range(hc):
self.parent.history.remove(del_id)
self.parent.hindex = self.parent.hindex - 1
mhc = self.parent.mhistory.count(del_id)
for c in range(mhc):
self.parent.mhistory.remove(del_id)
def apply_filter_clicked(self):
invert_filter = self.parent.filter_inv.get_active()
qualifer = self.parent.filter_text.get_text()

View File

@ -1507,21 +1507,22 @@ class Gramps:
if family:
family.removeChild(self.active_person)
self.people_view.remove_from_history(self.active_person)
self.db.removePerson(self.active_person.getId())
self.people_view.remove_from_person_list(self.active_person)
self.people_view.person_model.sort_column_changed()
try:
self.mhistory = self.mhistory[:-2]
self.change_active_person(self.mhistory[-2])
except:
self.mhistory = []
self.change_active_person(None)
self.change_active_person(None)
self.redraw_histmenu()
self.update_display(0)
Utils.modified()
def merge_update(self,p1,p2,old_id):
self.people_view.remove_from_person_list(p1,old_id)
self.people_view.remove_from_person_list(p2)
self.people_view.remove_from_history(p1,old_id)
self.people_view.remove_from_history(p2)
self.redraw_histmenu()
self.people_view.redisplay_person_list(p1)
self.update_display(0)