* src/DisplayTabs/_PersonRefEmbedList.py,
* src/DdTargets.py, * src/ScratchPad.py: Fix support of PersonRef DnD svn: r7608
This commit is contained in:
parent
592310d256
commit
ed5c45d64e
@ -13,7 +13,9 @@
|
|||||||
self.person_ref_list because they link to persons and sources
|
self.person_ref_list because they link to persons and sources
|
||||||
* src/DataViews/_PersonView.py (delete_person_response): Remove
|
* src/DataViews/_PersonView.py (delete_person_response): Remove
|
||||||
person from other persons as well because of PersonRef.
|
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>
|
2006-11-09 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/Filters/Rules/Person/_HasDeath.py (apply): Match any of the
|
* src/Filters/Rules/Person/_HasDeath.py (apply): Match any of the
|
||||||
|
@ -123,6 +123,7 @@ class _DdTargets(object):
|
|||||||
|
|
||||||
self.PERSON_LINK = _DdType(self,'person-link')
|
self.PERSON_LINK = _DdType(self,'person-link')
|
||||||
self.PERSON_LINK_LIST = _DdType(self,'person-link-list')
|
self.PERSON_LINK_LIST = _DdType(self,'person-link-list')
|
||||||
|
self.PERSONREF = _DdType(self,'personref')
|
||||||
|
|
||||||
self.SOURCE_LINK = _DdType(self,'source-link')
|
self.SOURCE_LINK = _DdType(self,'source-link')
|
||||||
|
|
||||||
@ -147,7 +148,8 @@ class _DdTargets(object):
|
|||||||
self.PLACE_LINK,
|
self.PLACE_LINK,
|
||||||
self.SOURCE_LINK,
|
self.SOURCE_LINK,
|
||||||
self.PERSON_LINK,
|
self.PERSON_LINK,
|
||||||
self.PERSON_LINK_LIST]
|
self.PERSON_LINK_LIST,
|
||||||
|
self.PERSONREF]
|
||||||
|
|
||||||
self.CHILD = _DdType(self,'child')
|
self.CHILD = _DdType(self,'child')
|
||||||
self.SPOUSE = _DdType(self,'spouse')
|
self.SPOUSE = _DdType(self,'spouse')
|
||||||
|
@ -46,7 +46,7 @@ from _EmbeddedList import EmbeddedList
|
|||||||
class PersonRefEmbedList(EmbeddedList):
|
class PersonRefEmbedList(EmbeddedList):
|
||||||
|
|
||||||
_HANDLE_COL = 3
|
_HANDLE_COL = 3
|
||||||
_DND_TYPE = DdTargets.PERSON_LINK
|
_DND_TYPE = DdTargets.PERSONREF
|
||||||
|
|
||||||
_column_names = [
|
_column_names = [
|
||||||
(_('Name'), 0, 250),
|
(_('Name'), 0, 250),
|
||||||
@ -106,8 +106,7 @@ class PersonRefEmbedList(EmbeddedList):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
from Editors import EditPersonRef
|
from Editors import EditPersonRef
|
||||||
ref = RelLib.PersonRef()
|
ref = RelLib.PersonRef(obj)
|
||||||
ref.ref = obj
|
|
||||||
ref.rel = _('Unknown')
|
ref.rel = _('Unknown')
|
||||||
EditPersonRef(
|
EditPersonRef(
|
||||||
self.dbstate, self.uistate, self.track,
|
self.dbstate, self.uistate, self.track,
|
||||||
|
@ -579,6 +579,24 @@ class ScratchPadMediaRef(ScratchPadGrampsTypeWrapper):
|
|||||||
def tooltip(self):
|
def tooltip(self):
|
||||||
return ""
|
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):
|
class ScratchPersonLink(ScratchPadWrapper):
|
||||||
|
|
||||||
DROP_TARGETS = [DdTargets.PERSON_LINK]
|
DROP_TARGETS = [DdTargets.PERSON_LINK]
|
||||||
@ -877,6 +895,7 @@ class ScratchPadListView:
|
|||||||
self.register_wrapper_class(ScratchSourceLink)
|
self.register_wrapper_class(ScratchSourceLink)
|
||||||
self.register_wrapper_class(ScratchPersonLink)
|
self.register_wrapper_class(ScratchPersonLink)
|
||||||
self.register_wrapper_class(ScratchPersonLinkList)
|
self.register_wrapper_class(ScratchPersonLinkList)
|
||||||
|
self.register_wrapper_class(ScratchPadPersonRef)
|
||||||
self.register_wrapper_class(ScratchPadText)
|
self.register_wrapper_class(ScratchPadText)
|
||||||
|
|
||||||
def register_wrapper_class(self,wrapper_class):
|
def register_wrapper_class(self,wrapper_class):
|
||||||
|
Loading…
Reference in New Issue
Block a user