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:
parent
0bb98262c9
commit
14526ad71d
@ -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>
|
2005-03-29 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
||||||
* src/DdTargets.py: add family targets to target list functions
|
* src/DdTargets.py: add family targets to target list functions
|
||||||
* src/Marriage.py (at_dest_drag_data_received, ev_dest_drag_data_received,
|
* src/Marriage.py (at_dest_drag_data_received, ev_dest_drag_data_received,
|
||||||
|
@ -196,15 +196,22 @@ class ScratchPadWindow:
|
|||||||
exec 'data = %s' % o[0]['data']
|
exec 'data = %s' % o[0]['data']
|
||||||
exec 'mytype = "%s"' % data[0]
|
exec 'mytype = "%s"' % data[0]
|
||||||
target = DdTargets.get_dd_type_from_type_name(mytype).target()
|
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
|
# Union with text targets
|
||||||
elif len([target for target \
|
elif len([target for target \
|
||||||
in obj_targets if DdTargets.is_text_type(target)]) > 0:
|
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_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):
|
def on_update_object_clicked(self, obj):
|
||||||
pass
|
pass
|
||||||
@ -215,6 +222,7 @@ class ScratchPadWindow:
|
|||||||
def object_drag_data_get(self,widget, context, sel_data, info, time):
|
def object_drag_data_get(self,widget, context, sel_data, info, time):
|
||||||
|
|
||||||
o = self.otree.get_selected_objects()
|
o = self.otree.get_selected_objects()
|
||||||
|
|
||||||
|
|
||||||
if len(o):
|
if len(o):
|
||||||
bits_per = 8; # we're going to pass a string
|
bits_per = 8; # we're going to pass a string
|
||||||
@ -225,6 +233,7 @@ class ScratchPadWindow:
|
|||||||
if len([target for target \
|
if len([target for target \
|
||||||
in obj_targets if DdTargets.is_gramps_type(target)]) > 0:
|
in obj_targets if DdTargets.is_gramps_type(target)]) > 0:
|
||||||
|
|
||||||
|
|
||||||
exec 'data = %s' % o[0]['data']
|
exec 'data = %s' % o[0]['data']
|
||||||
exec 'mytype = "%s"' % data[0]
|
exec 'mytype = "%s"' % data[0]
|
||||||
exec 'person = "%s"' % data[1]
|
exec 'person = "%s"' % data[1]
|
||||||
@ -235,6 +244,7 @@ class ScratchPadWindow:
|
|||||||
# Union with text targets
|
# Union with text targets
|
||||||
elif len([target for target \
|
elif len([target for target \
|
||||||
in obj_targets if DdTargets.is_text_type(target)]) > 0:
|
in obj_targets if DdTargets.is_text_type(target)]) > 0:
|
||||||
|
|
||||||
send_data = str(o[0]['data'])
|
send_data = str(o[0]['data'])
|
||||||
|
|
||||||
sel_data.set(sel_data.target, bits_per, send_data)
|
sel_data.set(sel_data.target, bits_per, send_data)
|
||||||
|
Loading…
Reference in New Issue
Block a user