* src/MediaView.py: add mediaobj to DND types

* src/plugins/ScratchPad.py: fill out rest of media details (type,value)


svn: r5089
This commit is contained in:
Don Allingham 2005-08-16 22:49:33 +00:00
parent ee20b5d115
commit e72ca98e22
3 changed files with 8 additions and 2 deletions

View File

@ -5,6 +5,8 @@
* src/plugins/NavWebPage.py: fix paths in surname page
* src/Sources.py: Limit the source title to 40 characters
* src/MergePeople.py: correctly handle selection of first person
* src/MediaView.py: add mediaobj to DND types
* src/plugins/ScratchPad.py: fill out rest of media details (type,value)
2005-08-15 Alex Roitman <shura@gramps-project.org>
* NEWS: Update.

View File

@ -89,6 +89,7 @@ class MediaView:
self.list.set_model(self.model)
DND_TARGETS = [
('mediaobj', 0, 0),
('STRING', 0, 0),
('text/plain',0,0),
('text/uri-list',0,2),

View File

@ -423,8 +423,9 @@ class ScratchMediaObj(ScratchPadWrapper):
ScratchPadWrapper.__init__(self,model,obj)
self._type = _("Media Object")
self._title = ""
self._value = ""
mobj = self._db.get_object_from_handle(obj)
self._title = mobj.get_description()
self._value = mobj.get_path()
def tooltip(self):
global escape
@ -677,6 +678,7 @@ class ScratchPadListView:
return
# Find a wrapper class
possible_wrappers = [target for target in context.targets \
if target in self._target_type_to_wrapper_class_map.keys()]
@ -685,6 +687,7 @@ class ScratchPadListView:
return
# Just select the first match.
wrapper_class = self._target_type_to_wrapper_class_map[str(possible_wrappers[0])]
o = wrapper_class(self._gramps_model,sel_data)