* src/SourceView.py: fix source query dialog, fix source deleting
svn: r5894
This commit is contained in:
parent
034e02ecca
commit
92f12f906b
@ -1,5 +1,5 @@
|
|||||||
2006-02-06 Don Allingham <don@gramps-project.org>
|
2006-02-06 Don Allingham <don@gramps-project.org>
|
||||||
* src/SourceView.py: fix source query dialog
|
* src/SourceView.py: fix source query dialog, fix source deleting
|
||||||
* src/ansel_utf8.py: fix unicode conversion
|
* src/ansel_utf8.py: fix unicode conversion
|
||||||
* src/GrampsDb/_GrampsDbBase.py: fix surname detection
|
* src/GrampsDb/_GrampsDbBase.py: fix surname detection
|
||||||
* src/GrampsDb/_ReadGedcomp.py: fix note importation
|
* src/GrampsDb/_ReadGedcomp.py: fix note importation
|
||||||
|
@ -119,21 +119,15 @@ class SourceView(PageView.ListView):
|
|||||||
EditSource.EditSource(self.dbstate, self.uistate, [], RelLib.Source())
|
EditSource.EditSource(self.dbstate, self.uistate, [], RelLib.Source())
|
||||||
|
|
||||||
def remove(self,obj):
|
def remove(self,obj):
|
||||||
for event_handle in self.selected_handles():
|
for source_handle in self.selected_handles():
|
||||||
db = self.dbstate.db
|
db = self.dbstate.db
|
||||||
person_list = [ handle for handle in
|
the_lists = Utils.get_source_referents(source_handle,db)
|
||||||
db.get_person_handles(False)
|
|
||||||
if db.get_person_from_handle(handle).has_handle_reference('Source',event_handle) ]
|
|
||||||
family_list = [ handle for handle in
|
|
||||||
db.get_family_handles()
|
|
||||||
if db.get_family_from_handle(handle).has_handle_reference('Source',event_handle) ]
|
|
||||||
|
|
||||||
event = db.get_event_from_handle(event_handle)
|
|
||||||
|
|
||||||
ans = EditSource.DelSrcQuery(event,db,
|
source = db.get_source_from_handle(source_handle)
|
||||||
person_list,family_list)
|
|
||||||
|
|
||||||
if len(person_list) + len(family_list) > 0:
|
ans = EditSource.DelSrcQuery(source,db,the_lists)
|
||||||
|
|
||||||
|
if filter(None,the_lists): # quick test for non-emptiness
|
||||||
msg = _('This source is currently being used. Deleting it '
|
msg = _('This source is currently being used. Deleting it '
|
||||||
'will remove it from the database and from all '
|
'will remove it from the database and from all '
|
||||||
'people and families that reference it.')
|
'people and families that reference it.')
|
||||||
@ -141,9 +135,9 @@ class SourceView(PageView.ListView):
|
|||||||
msg = _('Deleting source will remove it from the database.')
|
msg = _('Deleting source 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 = source.get_title()
|
||||||
if descr == "":
|
if descr == "":
|
||||||
descr = event.get_gramps_id()
|
descr = source.get_gramps_id()
|
||||||
|
|
||||||
QuestionDialog(_('Delete %s?') % descr, msg,
|
QuestionDialog(_('Delete %s?') % descr, msg,
|
||||||
_('_Delete Source'),ans.query_response)
|
_('_Delete Source'),ans.query_response)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user