Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pippy_app.py
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@laptop.org>2007-12-27 06:06:31 (GMT)
committer C. Scott Ananian <cscott@laptop.org>2008-05-20 19:05:58 (GMT)
commit3daf1636c1b24826f88cda324949c958a71750fa (patch)
tree76bd8f84ca4d6855b804a48baf587ae21b26f67e /pippy_app.py
parent1f2346b0df62ba73099197a903588cf8adec821f (diff)
Support copy, paste, & drop in generated activities. Support drop on VTE in Pippy.
Diffstat (limited to 'pippy_app.py')
-rw-r--r--pippy_app.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pippy_app.py b/pippy_app.py
index b311c0a..15d13b0 100644
--- a/pippy_app.py
+++ b/pippy_app.py
@@ -31,7 +31,7 @@ from gettext import gettext as _
from dbus.service import method, signal
from dbus.gobject_service import ExportedGObject
-from activity import ViewSourceActivity
+from activity import ViewSourceActivity, TARGET_TYPE_TEXT
from sugar.activity.activity import ActivityToolbox, \
get_bundle_path, get_bundle_name
from sugar.presence import presenceservice
@@ -183,6 +183,10 @@ class PippyActivity(ViewSourceActivity):
[])
self._vte.connect('child_exited', self.child_exited_cb)
self._child_exited_handler = None
+ self._vte.drag_dest_set(gtk.DEST_DEFAULT_ALL,
+ [ ( "text/plain", 0, TARGET_TYPE_TEXT ) ],
+ gtk.gdk.ACTION_COPY)
+ self._vte.connect('drag_data_received', self.vte_drop_cb)
outbox.pack_start(self._vte)
outsb = gtk.VScrollbar(self._vte.get_adjustment())
@@ -224,6 +228,9 @@ class PippyActivity(ViewSourceActivity):
# we've already joined
self._joined_cb()
+ def vte_drop_cb(self, widget, context, x, y, selection, targetType, time):
+ if targetType == TARGET_TYPE_TEXT:
+ self._vte.feed_child(selection.data)
def selection_cb(self, column):
self.save()
model, _iter = column.get_selected()