From e83190dd82f581a589a174243b8d893f37c2907e Mon Sep 17 00:00:00 2001 From: Bastien Jacquet Date: Fri, 31 Oct 2014 18:52:12 +0100 Subject: [PATCH] EditPerson new person calls create_id() to have a handler in clipboard (as in EditFamily) --- gramps/gui/editors/editperson.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/gramps/gui/editors/editperson.py b/gramps/gui/editors/editperson.py index b263593d5..285cbbc2c 100644 --- a/gramps/gui/editors/editperson.py +++ b/gramps/gui/editors/editperson.py @@ -81,6 +81,7 @@ from .displaytabs import (PersonEventEmbedList, NameEmbedList, CitationEmbedList from gramps.gen.plug import CATEGORY_QR_PERSON from gramps.gen.const import URL_MANUAL_PAGE from gramps.gen.constfunc import cuni +from gramps.gen.utils.id import create_id #------------------------------------------------------------------------- # @@ -187,6 +188,10 @@ class EditPerson(EditPrimary): self.obj.get_gender () == Person.UNKNOWN) + self.added = self.obj.handle is None + if self.added: + self.obj.handle = create_id() + self.top = Glade() self.set_window(self.top.toplevel, None, @@ -254,18 +259,17 @@ class EditPerson(EditPrimary): self.eventbox.connect('button-press-event', self._image_button_press) # allow to initiate a drag-and-drop with this person if it has a handle - if self.obj.get_handle(): - tglist = Gtk.TargetList.new([]) - tglist.add(DdTargets.PERSON_LINK.atom_drag_type, - DdTargets.PERSON_LINK.target_flags, - DdTargets.PERSON_LINK.app_id) - self.contexteventbox.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, - [], - Gdk.DragAction.COPY) - self.contexteventbox.drag_source_set_target_list(tglist) - self.contexteventbox.drag_source_set_icon_stock('gramps-person') - self.contexteventbox.connect('drag_data_get', - self._top_drag_data_get) + #if self.obj.get_handle(): + tglist = Gtk.TargetList.new([]) + tglist.add(DdTargets.PERSON_LINK.atom_drag_type, + DdTargets.PERSON_LINK.target_flags, + DdTargets.PERSON_LINK.app_id) + self.contexteventbox.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, + [], + Gdk.DragAction.COPY) + self.contexteventbox.drag_source_set_target_list(tglist) + self.contexteventbox.drag_source_set_icon_stock('gramps-person') + self.contexteventbox.connect('drag_data_get', self._top_drag_data_get) def _connect_db_signals(self): """