diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index daf917771..5ea44e5e2 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -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 * NEWS: Update. diff --git a/gramps2/src/MediaView.py b/gramps2/src/MediaView.py index 2bceaf49e..e6da8fc2e 100644 --- a/gramps2/src/MediaView.py +++ b/gramps2/src/MediaView.py @@ -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), diff --git a/gramps2/src/plugins/ScratchPad.py b/gramps2/src/plugins/ScratchPad.py index 502571186..07b462050 100644 --- a/gramps2/src/plugins/ScratchPad.py +++ b/gramps2/src/plugins/ScratchPad.py @@ -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)