[anjal] Differentiate Downloading and formatting. Show spinners appropriately.



commit 35a2fbc6394acab005bf713fe21a2226fff4dbbc
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Wed Apr 22 00:44:31 2009 +0530

    Differentiate Downloading and formatting. Show spinners appropriately.
---
 src/mail-message-view.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/mail-message-view.c b/src/mail-message-view.c
index 9ade1ec..23a4a61 100644
--- a/src/mail-message-view.c
+++ b/src/mail-message-view.c
@@ -56,6 +56,7 @@ struct  _MailMessageViewPrivate {
 	GtkWidget *header_row;
 	const char *active_color;
 	GtkWidget *spinner;
+	GtkWidget *spinner_label;
 	GtkWidget *unread_image;
 	char *bold[2];
 	char *normal[2];
@@ -441,16 +442,24 @@ mark_mail_read  (GtkWidget *w, GdkEventExpose *event, MailMessageView *mmv)
 
 #if HAVE_WEBKIT
 static void
-mmv_finished_webkit (WebKitWebView  *webkitwebview, WebKitWebFrame *arg1, gpointer user_data)
+mmv_finished_loading_webkit (WebKitWebView  *webkitwebview, WebKitWebFrame *arg1, gpointer user_data)
 {
 	 MailMessageView *mmview = (MailMessageView *) user_data;
-	//gtk_widget_set_size_request (webkitwebview, -1, webkit_web_frame_get_height(arg1));
-
+	 gtk_widget_hide(mmview->priv->spinner);
+	gtk_widget_set_size_request (webkitwebview, -1, webkit_web_frame_get_height(arg1));
 	/* Connect on expose, and mark mail as read on expose, when the mail is actually seen */
 	g_signal_connect (webkitwebview, "expose-event" , mark_mail_read, mmview);
 	g_signal_emit (mmview, signals[MESSAGE_LOADED], 0);
 
 }
+
+static void
+mmv_finished_webkit (WebKitWebView  *webkitwebview, WebKitWebFrame *arg1, gpointer user_data)
+{
+	 MailMessageView *mmview = (MailMessageView *) user_data;
+	 gtk_label_set_text (mmview->priv->spinner_label, _("Formatting message"));
+	 gtk_widget_show(mmview->priv->spinner);
+}
 #endif
 
 #if HAVE_MOZILLA
@@ -644,7 +653,8 @@ mmv_create_webview (MailMessageView *mmv, GtkWidget *box)
 {
 	WebKitWebView *web = webkit_web_view_new ();
 
-	g_signal_connect (web, "load-finished", G_CALLBACK(mmv_finished_webkit), mmv);
+	g_signal_connect (web, "load-started", G_CALLBACK(mmv_finished_webkit), mmv);
+	g_signal_connect (web, "load-finished", G_CALLBACK(mmv_finished_loading_webkit), mmv);
 
 	gtk_box_pack_start (box, web, FALSE, FALSE, 0);
 	webkit_web_view_set_editable (web, FALSE);
@@ -1036,6 +1046,7 @@ mail_message_view_set_message (MailMessageView *mmview, CamelFolder *folder, con
 	//gtk_widget_hide (mmview->priv->spinner);
 
 	tmp = gtk_label_new (_("Downloading message"));
+	mmview->priv->spinner_label = tmp;
 	vbox = gtk_hbox_new (FALSE, 0);
 	gtk_box_pack_start (vbox, e_spinner_new_spinning_small_shown (), FALSE, FALSE, 3);
 	gtk_box_pack_start (vbox, tmp, FALSE, FALSE, 3);



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