* src/DisplayTabs/_PersonRefEmbedList.py,

* src/DdTargets.py,
* src/ScratchPad.py: Fix support of PersonRef DnD



svn: r7608
This commit is contained in:
Martin Hawlisch 2006-11-10 23:28:40 +00:00
parent 592310d256
commit ed5c45d64e
4 changed files with 27 additions and 5 deletions

View File

@ -13,7 +13,9 @@
self.person_ref_list because they link to persons and sources
* src/DataViews/_PersonView.py (delete_person_response): Remove
person from other persons as well because of PersonRef.
* src/DisplayTabs/_PersonRefEmbedList.py,
* src/DdTargets.py,
* src/ScratchPad.py: Fix support of PersonRef DnD
2006-11-09 Alex Roitman <shura@gramps-project.org>
* src/Filters/Rules/Person/_HasDeath.py (apply): Match any of the

View File

@ -123,6 +123,7 @@ class _DdTargets(object):
self.PERSON_LINK = _DdType(self,'person-link')
self.PERSON_LINK_LIST = _DdType(self,'person-link-list')
self.PERSONREF = _DdType(self,'personref')
self.SOURCE_LINK = _DdType(self,'source-link')
@ -147,7 +148,8 @@ class _DdTargets(object):
self.PLACE_LINK,
self.SOURCE_LINK,
self.PERSON_LINK,
self.PERSON_LINK_LIST]
self.PERSON_LINK_LIST,
self.PERSONREF]
self.CHILD = _DdType(self,'child')
self.SPOUSE = _DdType(self,'spouse')

View File

@ -46,7 +46,7 @@ from _EmbeddedList import EmbeddedList
class PersonRefEmbedList(EmbeddedList):
_HANDLE_COL = 3
_DND_TYPE = DdTargets.PERSON_LINK
_DND_TYPE = DdTargets.PERSONREF
_column_names = [
(_('Name'), 0, 250),
@ -106,8 +106,7 @@ class PersonRefEmbedList(EmbeddedList):
"""
try:
from Editors import EditPersonRef
ref = RelLib.PersonRef()
ref.ref = obj
ref = RelLib.PersonRef(obj)
ref.rel = _('Unknown')
EditPersonRef(
self.dbstate, self.uistate, self.track,

View File

@ -579,6 +579,24 @@ class ScratchPadMediaRef(ScratchPadGrampsTypeWrapper):
def tooltip(self):
return ""
class ScratchPadPersonRef(ScratchPadGrampsTypeWrapper):
DROP_TARGETS = [DdTargets.PERSONREF]
DRAG_TARGET = DdTargets.PERSONREF
ICON = LINK_PIC
def __init__(self, dbstate, obj):
ScratchPadGrampsTypeWrapper.__init__(self, dbstate, obj)
self._type = _("Person Reference")
person = self._db.get_person_from_handle(self._obj.get_reference_handle())
self._title = self._obj.get_relation()
self._value = person.get_primary_name().get_name()
def tooltip(self):
return ""
class ScratchPersonLink(ScratchPadWrapper):
DROP_TARGETS = [DdTargets.PERSON_LINK]
@ -877,6 +895,7 @@ class ScratchPadListView:
self.register_wrapper_class(ScratchSourceLink)
self.register_wrapper_class(ScratchPersonLink)
self.register_wrapper_class(ScratchPersonLinkList)
self.register_wrapper_class(ScratchPadPersonRef)
self.register_wrapper_class(ScratchPadText)
def register_wrapper_class(self,wrapper_class):