[Xfce4-commits] <postler:master> Remember currently visible message part

Christian Dywan noreply at xfce.org
Tue Nov 9 01:52:01 CET 2010


Updating branch refs/heads/master
         to 18e0681ef8ec6fefb1a5b8ee585d08cf756b2695 (commit)
       from 82c6c4b8960798188010bf597b06ea238b1c1059 (commit)

commit 18e0681ef8ec6fefb1a5b8ee585d08cf756b2695
Author: Allen Lowe <lallenlowe at gmail.com>
Date:   Mon Nov 8 17:09:53 2010 -0700

    Remember currently visible message part
    
    Added the Content.current_part property and set it to the correct value when
    the user chooses a part. This fixed a bug where you have to choose a part again
    after choosing to load external images.
    
    Fixes: https://bugs.launchpad.net/postler/+bug/672834

 postler/postler-content.vala |    5 ++++-
 postler/postler-viewer.vala  |    6 ++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index d8a6940..79a2e23 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -28,6 +28,7 @@ public class Postler.Content : WebKit.WebView {
     public string default_charset { get; set; default = "ISO-8859-1"; }
 
     public string? last_location { get; set; }
+    public uint? current_part { get; set; }
     public string? sender { get; set; }
     public string? recipient { get; set; }
     public string? subject { get; set; }
@@ -704,8 +705,10 @@ public class Postler.Content : WebKit.WebView {
                 if (mime_types[part].has_prefix ("text/"))
                     break;
             }
-            if (mime_types[part].has_prefix ("text/"))
+            if (mime_types[part].has_prefix ("text/")) {
                 display_part(part);
+                current_part = part;
+            }
             else
                 throw new GLib.FileError.FAILED (
                     _("No text in the message that can be displayed"));
diff --git a/postler/postler-viewer.vala b/postler/postler-viewer.vala
index 56bda99..6a75f14 100644
--- a/postler/postler-viewer.vala
+++ b/postler/postler-viewer.vala
@@ -86,7 +86,7 @@ public class Postler.Viewer : Gtk.VBox {
     void infobar_response (Gtk.InfoBar infobar, int response) {
         infobar.hide ();
         allow_external_images = true;
-        content.display_part (0);
+        content.display_part (content.current_part);
     }
 
     static string icon_name_for_mime_type (string mime_type, Gtk.Widget widget) {
@@ -138,7 +138,9 @@ public class Postler.Viewer : Gtk.VBox {
             button.set_tooltip_text (part);
             button.set_data ("index", index);
             button.clicked.connect ((button) => {
-                content.display_part (button.get_data ("index")); });
+                uint current_part = button.get_data ("index");
+                content.current_part = current_part;
+                content.display_part (content.current_part); });
             message_parts.pack_start (button, false, false, 0);
             index++;
         }



More information about the Xfce4-commits mailing list