2005-03-18 Richard Taylor <rjt-gramps@thegrindstone.me.uk>

* 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
This commit is contained in:
Richard Taylor 2005-03-18 12:16:41 +00:00
parent a384bc20b7
commit 25e6c350c8
3 changed files with 23 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2005-03-18 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
* 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 <Martin.Hawlisch@gmx.de>
* src/GrampsGconfKeys.py (get_bool,get_int,get_string): Raise
exception when default value could not be get from gconf schema

View File

@ -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

View File

@ -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):