From fc01bc440da94efd57992702e92749cfd0043de3 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 2 Apr 2005 17:53:37 +0000 Subject: [PATCH] * src/SourceView.py: fix multiple selection problem. svn: r4285 --- gramps2/ChangeLog | 3 +++ gramps2/src/SourceView.py | 35 +++++++++++++++++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 1d23de16b..d82029726 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-04-02 Don Allingham + * src/SourceView.py: fix multiple selection problem. + 2005-04-02 Martin Hawlisch * src/EditPerson.py: Remove unneeded arguments. * src/Marriage.py: Remove unneeded arguments. diff --git a/gramps2/src/SourceView.py b/gramps2/src/SourceView.py index 1f800fded..8a2ed876e 100644 --- a/gramps2/src/SourceView.py +++ b/gramps2/src/SourceView.py @@ -171,28 +171,27 @@ class SourceView: self.topWindow) def on_delete_clicked(self,obj): - store,node = self.selection.get_selected() - if not node: - return - - handle = store.get_value(node,_HANDLE_COL) - source = self.parent.db.get_source_from_handle(handle) + mlist = [] + self.selection.selected_foreach(self.blist,mlist) - the_lists = Utils.get_source_referents(handle,self.parent.db) - ans = EditSource.DelSrcQuery(source,self.parent.db,the_lists, + for handle in mlist: + source = self.parent.db.get_source_from_handle(handle) + + the_lists = Utils.get_source_referents(handle,self.parent.db) + ans = EditSource.DelSrcQuery(source,self.parent.db,the_lists, self.model.delete_row_by_handle) - if filter(None,the_lists): # quick test for non-emptiness - msg = _('This source is currently being used. Deleting it ' - 'will remove it from the database and from all ' - 'records that reference it.') - else: - msg = _('Deleting source will remove it from the database.') + if filter(None,the_lists): # quick test for non-emptiness + msg = _('This source is currently being used. Deleting it ' + 'will remove it from the database and from all ' + 'records that reference it.') + else: + msg = _('Deleting source will remove it from the database.') - msg = "%s %s" % (msg,Utils.data_recover_msg) - QuestionDialog(_('Delete %s?') % source.get_title(), msg, - _('_Delete Source'),ans.query_response, - self.topWindow) + msg = "%s %s" % (msg,Utils.data_recover_msg) + QuestionDialog(_('Delete %s?') % source.get_title(), msg, + _('_Delete Source'),ans.query_response, + self.topWindow) def on_edit_clicked(self,obj): list_store, node = self.selection.get_selected()