[geary/wip/728002-webkit2: 13/15] Reenable notifiying of inline parts being loaded by the web view.



commit fd6c09c76838dc6d53c8713031a1fdd6e815c4e5
Author: Michael James Gratton <mike vee net>
Date:   Tue Oct 11 01:27:03 2016 +1100

    Reenable notifiying of inline parts being loaded by the web view.
    
    * src/client/components/client-web-view.vala
      (ClientWebView::inline_resource_loaded): New signal to notify of when
      an inline part has been loaded by the web view.
      (ClientWebView::handle_cid_request): Fire new signal when a part is
      loaded.
    
    * src/client/conversation-viewer/conversation-email.vala
      (ConversationEmail::connect_message_view_signals): Hook up new signal.
    
    * src/client/conversation-viewer/conversation-message.vala
      (ConversationMessage): Remove now-unesed attachment_displayed_inline signal.

 src/client/components/client-web-view.vala         |    5 ++++-
 .../conversation-viewer/conversation-email.vala    |    6 +++---
 .../conversation-viewer/conversation-message.vala  |    2 --
 3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/client/components/client-web-view.vala b/src/client/components/client-web-view.vala
index e31c73f..70230ef 100644
--- a/src/client/components/client-web-view.vala
+++ b/src/client/components/client-web-view.vala
@@ -61,6 +61,9 @@ public class ClientWebView : WebKit.WebView {
     /** Emitted when a user clicks a link in this web view. */
     public signal void link_activated(string uri);
 
+    /** Emitted when the web view has loaded an inline part. */
+    public signal void inline_resource_loaded(string cid);
+
 
     public ClientWebView(WebKit.UserContentManager? content_manager = null) {
         WebKit.Settings setts = new WebKit.Settings();
@@ -138,7 +141,7 @@ public class ClientWebView : WebKit.WebView {
         Geary.Memory.Buffer? buf = this.cid_resources[cid];
         if (buf != null) {
             request.finish(buf.get_input_stream(), buf.size, null);
-            attachment_loaded(cid);
+            inline_resource_loaded(cid);
         } else {
             request.finish_error(
                 new FileError.NOENT("Unknown CID: %s".printf(cid))
diff --git a/src/client/conversation-viewer/conversation-email.vala 
b/src/client/conversation-viewer/conversation-email.vala
index 6bb4742..4e837f9 100644
--- a/src/client/conversation-viewer/conversation-email.vala
+++ b/src/client/conversation-viewer/conversation-email.vala
@@ -580,11 +580,11 @@ public class ConversationEmail : Gtk.Box {
     }
 
     private void connect_message_view_signals(ConversationMessage view) {
-        view.attachment_displayed_inline.connect((id) => {
-                inlined_content_ids.add(id);
-            });
         view.flag_remote_images.connect(on_flag_remote_images);
         view.remember_remote_images.connect(on_remember_remote_images);
+        view.web_view.inline_resource_loaded.connect((id) => {
+                this.inlined_content_ids.add(id);
+            });
         view.web_view.notify["load-status"].connect(() => {
                 bool all_loaded = true;
                 message_view_iterator().foreach((view) => {
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index ade1e01..d6a9afa 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -242,8 +242,6 @@ public class ConversationMessage : Gtk.Grid {
     // Message-specific actions
     private SimpleActionGroup message_actions = new SimpleActionGroup();
 
-    /** Fired when an attachment is added for inline display. */
-    public signal void attachment_displayed_inline(string id);
     private int next_replaced_buffer_number = 0;
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]