From b31ebf5ee34818f951a8c427a2ce04041cd4c64d Mon Sep 17 00:00:00 2001 From: Richard Taylor Date: Fri, 18 Mar 2005 12:16:41 +0000 Subject: [PATCH] 2005-03-18 Richard Taylor * src/plugins/ScratchPad.py: Tidy up of drag target type handling. * src/EditPerson.py (x_drag_data_received): fixed problem with drag and drop of objects that have srcrefs. svn: r4206 --- gramps2/ChangeLog | 5 +++++ gramps2/src/EditPerson.py | 6 +++--- gramps2/src/plugins/ScratchPad.py | 28 +++++++++++++++------------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index a81650e7d..fda441777 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2005-03-18 Richard Taylor + * src/plugins/ScratchPad.py: Tidy up of drag target type handling. + * src/EditPerson.py (x_drag_data_received): fixed problem with + drag and drop of objects that have srcrefs. + 2005-03-17 Martin Hawlisch * src/GrampsGconfKeys.py (get_bool,get_int,get_string): Raise exception when default value could not be get from gconf schema diff --git a/gramps2/src/EditPerson.py b/gramps2/src/EditPerson.py index 56f2ab8bf..f37f237c7 100644 --- a/gramps2/src/EditPerson.py +++ b/gramps2/src/EditPerson.py @@ -807,7 +807,7 @@ class EditPerson: for src in foo.get_source_references(): base_handle = src.get_base_handle() newbase = self.db.get_source_from_handle(base_handle) - src.set_base_handle(newbase) + src.set_base_handle(newbase.get_handle()) place = foo.get_place_handle() if place: foo.set_place_handle(place.get_handle()) @@ -885,7 +885,7 @@ class EditPerson: for src in foo.get_source_references(): base_handle = src.get_base_handle() newbase = self.db.get_source_from_handle(base_handle) - src.set_base_handle(newbase) + src.set_base_handle(newbase.get_handle()) self.alist.append(foo) self.lists_changed = True self.redraw_attr_list() @@ -918,7 +918,7 @@ class EditPerson: for src in foo.get_source_references(): base_handle = src.get_base_handle() newbase = self.db.get_source_from_handle(base_handle) - src.set_base_handle(newbase) + src.set_base_handle(newbase.get_handle()) self.plist.insert(row,foo) self.lists_changed = True diff --git a/gramps2/src/plugins/ScratchPad.py b/gramps2/src/plugins/ScratchPad.py index 3d3285d01..4b80a771c 100644 --- a/gramps2/src/plugins/ScratchPad.py +++ b/gramps2/src/plugins/ScratchPad.py @@ -60,6 +60,12 @@ text_targets = ['text/plain', 'COMPOUND_TEXT', 'UTF8_STRING'] +text_tgts = [('text/plain',0,0), + ('TEXT', 0, 1), + ('STRING', 0, 2), + ('COMPOUND_TEXT', 0, 3), + ('UTF8_STRING', 0, 4)] + gramps_targets = ['url', 'pevent', 'pattr', @@ -70,21 +76,17 @@ pycode_tgts = [('url', 0, 0), ('pevent', 0, 1), ('pattr', 0, 2), ('paddr', 0, 3), - ('srcref', 0, 4), - ('text/plain',0,0), - ('TEXT', 0, 1), - ('STRING', 0, 2), - ('COMPOUND_TEXT', 0, 3), - ('UTF8_STRING', 0, 4)] + ('srcref', 0, 4)] + text_tgts + TEXT_TARGET = 'TEXT' -target_map = {'url':('url', 0, 0), - 'pevent': ('pevent', 0, 1), - 'pattr': ('pattr', 0, 2), - 'paddr': ('paddr', 0, 3), - 'srcref': ('srcref', 0, 4), - TEXT_TARGET: ('TEXT', 0, 1)} +target_map = {'url':[('url', 0, 0)], + 'pevent': [('pevent', 0, 1)], + 'pattr': [('pattr', 0, 2)], + 'paddr': [('paddr', 0, 3)], + 'srcref': [('srcref', 0, 4)], + TEXT_TARGET: text_tgts} @@ -281,7 +283,7 @@ class ScratchPadWindow: target = target_map[TEXT_TARGET] self.object_list.drag_source_unset() - self.object_list.drag_source_set(BUTTON1_MASK, [target], ACTION_COPY) + self.object_list.drag_source_set(BUTTON1_MASK, target, ACTION_COPY) def on_update_object_clicked(self, obj):