diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 0f329e3ab..5bda094ba 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-08-17 Richard Taylor + * src/RepositoryView.py: remove method now works again. + 2005-08-17 Richard Taylor * src/ScratchPad.py: fix some issues with new window management and dbstate * src/scratchpad.glade: moved from src/plugins diff --git a/gramps2/src/RepositoryView.py b/gramps2/src/RepositoryView.py index 3187419f0..e1688b71d 100644 --- a/gramps2/src/RepositoryView.py +++ b/gramps2/src/RepositoryView.py @@ -122,33 +122,30 @@ class RepositoryView(PageView.ListView): def remove(self,obj): db = self.dbstate.db -# for event_handle in self.selected_handles(): -# person_list = [ handle for handle in -# db.get_person_handles(False) -# if db.get_person_from_handle(handle).has_handle_reference('Repository',event_handle) ] -# family_list = [ handle for handle in -# db.get_family_handles() -# if db.get_family_from_handle(handle).has_handle_reference('Repository',event_handle) ] - -# event = db.get_event_from_handle(event_handle) + mlist = [] + self.selection.selected_foreach(self.blist,mlist) -# ans = EditRepository.DelRepositoryQuery(event,db, -# person_list,family_list) + for repos_handle in mlist: -# if len(person_list) + len(family_list) > 0: -# msg = _('This place is currently being used. Deleting it ' -# 'will remove it from the database and from all ' -# 'people and families that reference it.') -# else: -# msg = _('Deleting place will remove it from the database.') + source_list = [ src_handle for src_handle \ + in db.get_source_handles() \ + if db.get_source_from_handle(src_handle).has_repo_reference(repos_handle)] + + repository = db.get_repository_from_handle(repos_handle) + + ans = EditRepository.DelRepositoryQuery(repository,db,source_list) + + if len(source_list) > 0: + msg = _('This repository is currently being used. Deleting it ' + 'will remove it from the database and from all ' + 'sources that reference it.') + else: + msg = _('Deleting repository will remove it from the database.') + + msg = "%s %s" % (msg,Utils.data_recover_msg) + QuestionDialog(_('Delete %s?') % repository.get_name(), msg, + _('_Delete Repository'),ans.query_response) -# msg = "%s %s" % (msg,Utils.data_recover_msg) -# descr = event.get_description() -# if descr == "": -# descr = event.get_gramps_id() - -# QuestionDialog(_('Delete %s?') % descr, msg, -# _('_Delete Repository'),ans.query_response) def edit(self,obj): mlist = []