[Xfce4-commits] <postler:master> Go back to using selection to generate message for now

Christian Dywan noreply at xfce.org
Mon Mar 21 01:06:02 CET 2011


Updating branch refs/heads/master
         to ab3f2fa7b19fbf416d65200e28b8920469a30d92 (commit)
       from 337d1beb63b6d58ca59f0051a571efcc5c9b545c (commit)

commit ab3f2fa7b19fbf416d65200e28b8920469a30d92
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Mar 21 01:04:05 2011 +0100

    Go back to using selection to generate message for now

 postler/postler-composer.vala |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/postler/postler-composer.vala b/postler/postler-composer.vala
index a2c393e..39e343f 100644
--- a/postler/postler-composer.vala
+++ b/postler/postler-composer.vala
@@ -240,8 +240,13 @@ public class Postler.Composer : Gtk.Window {
                 + "Content-Type: text/plain; charset=UTF-8\n";
         }
 
-        content.execute_script ("document.title = document.body.innerText;");
-        body = content.title;
+        var clipboard = content.get_clipboard (Gdk.SELECTION_CLIPBOARD);
+        clipboard.set_text ("", 0);
+        content.select_all ();
+        content.copy_clipboard ();
+        string body = clipboard.wait_for_text ();
+        content.execute_script ("window.getSelection ().removeAllRanges ();");
+
         if (attachments.model.get_iter_first (out iter)) {
             string boundary = GLib.Checksum.compute_for_string (
                 GLib.ChecksumType.MD5,



More information about the Xfce4-commits mailing list