fix place deletion

svn: r6223
This commit is contained in:
Don Allingham 2006-03-29 05:01:27 +00:00
parent a40779b03f
commit 5a3c856e4c
2 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,5 @@
2006-03-28 Don Allingham <don@gramps-project.org> 2006-03-28 Don Allingham <don@gramps-project.org>
* src/DataViews/_PlaceView.py: delete place properly
* src/gramps_main.py: remove 2.0.X message * src/gramps_main.py: remove 2.0.X message
* src/ViewManager.py: remove expanduser * src/ViewManager.py: remove expanduser
* src/Exporter.py: remove expanduser * src/Exporter.py: remove expanduser

View File

@ -147,19 +147,18 @@ class PlaceView(PageView.ListView):
pass pass
def remove(self,obj): def remove(self,obj):
for event_handle in self.selected_handles(): for place_handle in self.selected_handles():
db = self.dbstate.db db = self.dbstate.db
person_list = [ handle for handle in person_list = [ handle for handle in
db.get_person_handles(False) db.get_person_handles(False)
if db.get_person_from_handle(handle).has_handle_reference('Place',event_handle) ] if db.get_person_from_handle(handle).has_handle_reference('Place',place_handle) ]
family_list = [ handle for handle in family_list = [ handle for handle in
db.get_family_handles() db.get_family_handles()
if db.get_family_from_handle(handle).has_handle_reference('Place',event_handle) ] if db.get_family_from_handle(handle).has_handle_reference('Place',place_handle) ]
event = db.get_event_from_handle(event_handle) place = db.get_place_from_handle(place_handle)
ans = DeletePlaceQuery(event,db, ans = DeletePlaceQuery(place,db)
person_list,family_list)
if len(person_list) + len(family_list) > 0: if len(person_list) + len(family_list) > 0:
msg = _('This place is currently being used. Deleting it ' msg = _('This place is currently being used. Deleting it '
@ -169,9 +168,9 @@ class PlaceView(PageView.ListView):
msg = _('Deleting place will remove it from the database.') msg = _('Deleting place will remove it from the database.')
msg = "%s %s" % (msg,Utils.data_recover_msg) msg = "%s %s" % (msg,Utils.data_recover_msg)
descr = event.get_description() descr = place.get_title()
if descr == "": if descr == "":
descr = event.get_gramps_id() descr = place.get_gramps_id()
QuestionDialog(_('Delete %s?') % descr, msg, QuestionDialog(_('Delete %s?') % descr, msg,
_('_Delete Place'),ans.query_response) _('_Delete Place'),ans.query_response)