def remove(self, obj): """ Remove a person from the database. """ handles = self.selected_handles() if len(handles) == 1: person = self._lookup_person(handles[0]) msg1 = self._message1_format(person) msg2 = self._message2_format(person) msg2 = "%s %s" % (msg2, data_recover_msg) # This gets person to delete self.active_person: QuestionDialog(msg1, msg2, _('_Delete Person'), self.delete_person_response, parent=self.uistate.window) else: # Ask to delete; option to cancel, delete rest # This gets person to delete from parameter MultiSelectDialog(self._message1_format, self._message2_format, handles, self._lookup_person, yes_func=self.delete_person_response, parent=self.uistate.window)
def remove(self, obj): """ Method called when deleting a family from a family view. """ from gramps.gui.dialog import QuestionDialog, MultiSelectDialog from gramps.gen.utils.string import data_recover_msg handles = self.selected_handles() if len(handles) == 1: family = self.dbstate.db.get_family_from_handle(handles[0]) msg1 = self._message1_format(family) msg2 = self._message2_format(family) msg2 = "%s %s" % (msg2, data_recover_msg) QuestionDialog(msg1, msg2, _('_Delete Family'), lambda: self.delete_family_response(family)) else: MultiSelectDialog(self._message1_format, self._message2_format, handles, self.dbstate.db.get_family_from_handle, yes_func=self.delete_family_response)
def remove(self, *obj): """ Method called when deleting event(s) from the event view. """ handles = self.selected_handles() if len(handles) == 1: event = self.dbstate.db.get_event_from_handle(handles[0]) msg1 = self._message1_format(event) msg2 = self._message2_format(event) msg2 = "%s %s" % (msg2, data_recover_msg) QuestionDialog(msg1, msg2, _('_Delete Event'), lambda: self.delete_event_response(event), parent=self.uistate.window) else: MultiSelectDialog(self._message1_format, self._message2_format, handles, self.dbstate.db.get_event_from_handle, yes_func=self.delete_event_response, parent=self.uistate.window)