[anjal] BUGFIX: GNOME #589286 - Use subject as tab label



commit 6a0846455304386ce5da3dcf0cc4eefd3ff4acee
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Wed Jul 22 09:57:42 2009 +0530

    BUGFIX: GNOME #589286 - Use subject as tab label

 src/mail-conv-view.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/mail-conv-view.c b/src/mail-conv-view.c
index 437454a..2cbfcba 100644
--- a/src/mail-conv-view.c
+++ b/src/mail-conv-view.c
@@ -47,6 +47,7 @@ struct  _MailConvViewPrivate {
 	gboolean once;
 	MailMessageView *last_child;
 	char *folder_uri;
+	GtkWidget *tab_label;
 };
 
 static void
@@ -392,6 +393,14 @@ mail_conv_view_set_thread (MailConvView *mcv, CamelFolder *folder, const char *u
 	gtk_container_add ((GtkContainer *)mcv->priv->viewport, mcv->child_box);
 	mcv->priv->position = 0;
 	mcv->priv->load_chain = g_malloc0(sizeof (gpointer) * (array->len+1));
+	if (array->len) {
+		CamelMessageInfo *mi = camel_folder_summary_uid (folder->summary, array->pdata[0]);
+		gtk_label_set_text ((GtkLabel *)mcv->priv->tab_label, camel_message_info_subject(mi));
+		gtk_label_set_max_width_chars ((GtkLabel *)mcv->priv->tab_label, 15);
+		gtk_label_set_ellipsize ((GtkLabel *)mcv->priv->tab_label, PANGO_ELLIPSIZE_END);
+		gtk_widget_set_tooltip_text (mcv->priv->tab_label, camel_message_info_subject(mi));
+		camel_message_info_free (mi);
+	}
 	for (i=0, j=0; i<array->len; i++) {
 		GtkWidget *child;
 		
@@ -579,7 +588,7 @@ mail_conv_view_get_tab_widget(MailConvView *mcv)
 	gtk_box_pack_start ((GtkBox *)tab_label, box, FALSE, FALSE, 0);
 	gtk_box_pack_start ((GtkBox *)tab_label, tool, FALSE, FALSE, 0);
 	gtk_widget_show_all (tab_label);
-
+	mcv->priv->tab_label = box;
 	return tab_label;
 	
 }



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