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

* src/plugins/ScratchPad.py (on_object_select_row): fixed the drop of
	text into TextView widgets.


svn: r4250
This commit is contained in:
Richard Taylor 2005-03-29 15:19:26 +00:00
parent 91ffd57ee5
commit cc8eb16bfc
2 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2005-03-29 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
* src/plugins/ScratchPad.py (on_object_select_row): fixed the drop of
text into TextView widgets.
2005-03-29 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
* src/DdTargets.py: add family targets to target list functions
* src/Marriage.py (at_dest_drag_data_received, ev_dest_drag_data_received,

View File

@ -196,14 +196,21 @@ class ScratchPadWindow:
exec 'data = %s' % o[0]['data']
exec 'mytype = "%s"' % data[0]
target = DdTargets.get_dd_type_from_type_name(mytype).target()
self.object_list.drag_source_unset()
self.object_list.drag_source_set(BUTTON1_MASK, [target], ACTION_COPY)
# Union with text targets
elif len([target for target \
in obj_targets if DdTargets.is_text_type(target)]) > 0:
target = DdTargets.TEXT.target()
targets = DdTargets.all_text_targets()
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, targets, ACTION_COPY)
else:
self.object_list.drag_source_unset()
def on_update_object_clicked(self, obj):
@ -216,6 +223,7 @@ class ScratchPadWindow:
o = self.otree.get_selected_objects()
if len(o):
bits_per = 8; # we're going to pass a string
@ -225,6 +233,7 @@ class ScratchPadWindow:
if len([target for target \
in obj_targets if DdTargets.is_gramps_type(target)]) > 0:
exec 'data = %s' % o[0]['data']
exec 'mytype = "%s"' % data[0]
exec 'person = "%s"' % data[1]
@ -235,6 +244,7 @@ class ScratchPadWindow:
# Union with text targets
elif len([target for target \
in obj_targets if DdTargets.is_text_type(target)]) > 0:
send_data = str(o[0]['data'])
sel_data.set(sel_data.target, bits_per, send_data)