[geary/wip/765516-gtk-widget-conversation-viewer: 169/187] Add ConversationEmail::message_bodies_loaded prop, hook it up.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/765516-gtk-widget-conversation-viewer: 169/187] Add ConversationEmail::message_bodies_loaded prop, hook it up.
- Date: Sat, 24 Sep 2016 16:20:16 +0000 (UTC)
commit 8b3c8a5e837c2e6d1e8541e1ae1c5124dc79d520
Author: Michael James Gratton <mike vee net>
Date: Mon Sep 12 15:07:42 2016 +1000
Add ConversationEmail::message_bodies_loaded prop, hook it up.
.../conversation-viewer/conversation-email.vala | 21 ++++++++++++++++++-
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-email.vala
b/src/client/conversation-viewer/conversation-email.vala
index 12e2f05..c77e911 100644
--- a/src/client/conversation-viewer/conversation-email.vala
+++ b/src/client/conversation-viewer/conversation-email.vala
@@ -257,6 +257,9 @@ public class ConversationEmail : Gtk.Box {
owned get { return this._attached_messages.read_only_view; }
}
+ /** Determines if all message's web views have finished loading. */
+ public bool message_bodies_loaded { get; private set; default = false; }
+
/** The embedded composer for this email, if any. */
public ComposerEmbed composer { get; private set; default = null; }
@@ -596,11 +599,25 @@ public class ConversationEmail : Gtk.Box {
}
private void connect_message_view_signals(ConversationMessage view) {
- view.flag_remote_images.connect(on_flag_remote_images);
- view.remember_remote_images.connect(on_remember_remote_images);
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.notify["load-status"].connect(() => {
+ bool all_loaded = true;
+ message_view_iterator().foreach((view) => {
+ if (view.web_view.load_status !=
+ WebKit.LoadStatus.FINISHED) {
+ all_loaded = false;
+ return false;
+ }
+ return true;
+ });
+ if (all_loaded == true) {
+ this.message_bodies_loaded = true;
+ }
+ });
view.web_view.selection_changed.connect(() => {
on_message_selection_changed(view);
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]