Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--do_it_all.sh4
-rw-r--r--patches/0003-Support-for-image-data-text-and-url-to-clipboard.patch82
2 files changed, 86 insertions, 0 deletions
diff --git a/do_it_all.sh b/do_it_all.sh
index 2b1274b..60ffdfa 100644
--- a/do_it_all.sh
+++ b/do_it_all.sh
@@ -13,6 +13,10 @@ git clone "$git_url" activity
# Build the activity (to generate "generated" files such as locale files).
cd activity
+
+# Pull back to this commit, to compensate for the upstream-bug http://bugs.sugarlabs.org/ticket/4482
+git reset --hard 32eee190d22751e2b5cd1c7909f12e47fb587096
+
python setup.py build
# Now, apply the AC patches.
diff --git a/patches/0003-Support-for-image-data-text-and-url-to-clipboard.patch b/patches/0003-Support-for-image-data-text-and-url-to-clipboard.patch
new file mode 100644
index 0000000..b5a26d9
--- /dev/null
+++ b/patches/0003-Support-for-image-data-text-and-url-to-clipboard.patch
@@ -0,0 +1,82 @@
+From 1f73eec9d8b45c85a8f67a3242fcf6246c184795 Mon Sep 17 00:00:00 2001
+From: Ajay Garg <ajay@activitycentral.com>
+Date: Mon, 13 May 2013 00:20:44 +0530
+Subject: [PATCH] sdxo#3031: Support for image data, text and url to
+ clipboard.
+Organization: Sugar Labs Foundation
+
+
+Signed-off-by: Ajay Garg <ajay@activitycentral.com>
+---
+ activity/activity.info | 2 +-
+ toolbar.py | 36 ++++++++++++++++--------------------
+ 2 files changed, 17 insertions(+), 21 deletions(-)
+
+diff --git a/activity/activity.info b/activity/activity.info
+index 499a708..39e228d 100644
+--- a/activity/activity.info
++++ b/activity/activity.info
+@@ -3,7 +3,7 @@ name = Write
+ bundle_id = org.laptop.AbiWordActivity
+ exec = sugar-activity AbiWordActivity.AbiWordActivity
+ icon = activity-write
+-activity_version = 86.2
++activity_version = 86.3
+ show_launcher = 1
+ mime_types = text/rtf;text/plain;application/x-abiword;text/x-xml-abiword;application/msword;application/rtf;application/xhtml+xml;text/html;application/vnd.oasis.opendocument.text
+ license = GPLv2+
+diff --git a/toolbar.py b/toolbar.py
+index 7f69bf7..60d338a 100644
+--- a/toolbar.py
++++ b/toolbar.py
+@@ -133,31 +133,27 @@ class EditToolbar(Gtk.Toolbar):
+ self._findnext.set_sensitive(False)
+
+ def __paste_button_cb(self, button):
++
+ clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
+
+ if clipboard.wait_is_image_available():
+- pixbuf_sel = clipboard.wait_for_image()
+- size = int(pixbuf_sel.get_width()), int(pixbuf_sel.get_height())
+- activity = self._abiword_canvas.get_toplevel()
+- temp_path = os.path.join(activity.get_activity_root(), 'instance')
+- if not os.path.exists(temp_path):
+- os.makedirs(temp_path)
+- fd, file_path = tempfile.mkstemp(dir=temp_path, suffix='.png')
+- os.close(fd)
+- logging.error('tempfile is %s' % file_path)
+- success, data = pixbuf_sel.save_to_bufferv('png', [], [])
+- if success:
+- px_file = open(file_path, 'w')
+- px_file.write(data)
+- px_file.close()
+- self._abiword_canvas.insert_image(file_path, False)
+-
++ selection = clipboard.wait_for_image()
++
++ if selection != None:
++
++ for pixbuf in selection:
++ self._abiword_canvas.insert_image(pixbuf, False)
++
+ elif clipboard.wait_is_uris_available():
+- selection = clipboard.wait_for_contents('text/uri-list')
++
++ selection = clipboard.wait_for_uris()
++
+ if selection != None:
+- for uri in selection.get_uris():
+- self._abiword_canvas.insert_image(urlparse(uri).path,
+- False)
++
++ for uri in selection:
++ self._abiword_canvas.insert_image(
++ urlparse(uri).path, False)
++
+ else:
+ self._abiword_canvas.paste()
+
+--
+1.7.11.7
+