[evolution-patches] Patch for Bug 73341



http://bugzilla.ximian.com/show_bug.cgi?id=73341

Patch has been tested. 

Happy Hacking
Madhan Raj
Index: mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.109
diff -u -p -r1.109 mail-component.c
--- mail-component.c	25 Feb 2005 03:39:12 -0000	1.109
+++ mail-component.c	15 Mar 2005 03:12:45 -0000
@@ -128,6 +128,7 @@ struct _MailComponentPrivate {
 	
 	char *context_path;	/* current path for right-click menu */
 	
+	GtkWidget *view_widget_label_info; /* The Label to be displayed above the Folder tree view */
 	CamelStore *local_store;
 };
 
@@ -572,7 +573,7 @@ impl_createControls (PortableServer_Serv
 	BonoboControl *tree_control;
 	BonoboControl *view_control;
 	BonoboControl *statusbar_control;
-	GtkWidget *tree_widget, *vbox, *info;
+	GtkWidget *tree_widget, *vbox;
 	GtkWidget *view_widget;
 	GtkWidget *statusbar_widget;
 	char *uri;
@@ -604,12 +605,12 @@ impl_createControls (PortableServer_Serv
 	gtk_widget_show (statusbar_widget);
 
 	vbox = gtk_vbox_new(FALSE, 0);
-	info = e_info_label_new("stock_mail");
-	e_info_label_set_info((EInfoLabel *)info, _("Mail"), "");
-	gtk_box_pack_start((GtkBox *)vbox, info, FALSE, TRUE, 0);
+	priv->view_widget_label_info = e_info_label_new("stock_mail");
+	e_info_label_set_info((EInfoLabel *)priv->view_widget_label_info, _("Mail"), "");
+	gtk_box_pack_start((GtkBox *)vbox, priv->view_widget_label_info, FALSE, TRUE, 0);
 	gtk_box_pack_start((GtkBox *)vbox, tree_widget, TRUE, TRUE, 0);
 
-	gtk_widget_show(info);
+	gtk_widget_show(priv->view_widget_label_info);
 	gtk_widget_show(vbox);
 
 	tree_control = bonobo_control_new (vbox);
@@ -627,8 +628,8 @@ impl_createControls (PortableServer_Serv
 	g_signal_connect (view_control, "activate", G_CALLBACK (view_control_activate_cb), view_widget);
 	g_signal_connect (tree_widget, "folder-selected", G_CALLBACK (folder_selected_cb), view_widget);
 
-	g_signal_connect(view_widget, "changed", G_CALLBACK(view_changed_cb), info);
-	g_signal_connect(view_widget, "loaded", G_CALLBACK(view_changed_cb), info);
+	g_signal_connect(view_widget, "changed", G_CALLBACK(view_changed_cb), priv->view_widget_label_info);
+	g_signal_connect(view_widget, "loaded", G_CALLBACK(view_changed_cb), priv->view_widget_label_info);
 }
 
 static CORBA_boolean
@@ -949,6 +950,14 @@ mail_component_peek (void)
 	return component;
 }
 
+GtkWidget *
+mail_component_get_view_widget_label_info ()
+{
+	MailComponent *mc = mail_component_peek ();
+
+	return mc->priv->view_widget_label_info;
+}
+
 const char *
 mail_component_peek_base_directory (MailComponent *component)
 {
Index: em-folder-tree.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree.c,v
retrieving revision 1.144
diff -u -p -r1.144 em-folder-tree.c
--- em-folder-tree.c	8 Feb 2005 05:07:42 -0000	1.144
+++ em-folder-tree.c	15 Mar 2005 03:12:53 -0000
@@ -53,6 +53,7 @@
 #include "e-util/e-icon-factory.h"
 
 #include "widgets/misc/e-error.h"
+#include "widgets/misc/e-info-label.h"
 
 #include "em-vfolder-rule.h"
 
@@ -2624,7 +2625,7 @@ emft_popup_delete_response (GtkWidget *d
 	CamelStore *store;
 	CamelException ex;
 	char *full_name;
-	
+	GtkWidget *mc_view_widget_label_info = mail_component_get_view_widget_label_info ();
 	full_name = g_object_get_data ((GObject *) dialog, "full_name");
 	store = g_object_get_data ((GObject *) dialog, "store");
 	
@@ -2637,7 +2638,7 @@ emft_popup_delete_response (GtkWidget *d
 			camel_exception_clear (&ex);
 		}
 	}
-	
+	e_info_label_set_info((EInfoLabel *)mc_view_widget_label_info, _("Mail"), "");	
 	gtk_widget_destroy (dialog);
 }
 
@@ -2690,6 +2691,7 @@ emft_popup_rename_folder (EPopup *ep, EP
 	GtkTreeModel *model;
 	GtkTreeIter iter;
 	size_t base_len;
+	GtkWidget *mc_view_widget_label_info = mail_component_get_view_widget_label_info ();
 	
 	local = mail_component_peek_local_store (NULL);
 	
@@ -2771,6 +2773,9 @@ emft_popup_rename_folder (EPopup *ep, EP
 		
 		g_free (new_name);
 	}
+	
+	if (done)
+		e_info_label_set_info((EInfoLabel *)mc_view_widget_label_info, _("Mail"), "");
 	
 	g_free (full_name);
 	g_free (name);
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3598
diff -u -p -r1.3598 ChangeLog
--- ChangeLog	1 Mar 2005 06:17:19 -0000	1.3598
+++ ChangeLog	15 Mar 2005 03:13:15 -0000
@@ -1,3 +1,15 @@
+2005-03-15  Madhan Raj	<madanraj gmail com>
+
+	* mail/mail-component.c (_MailComponentPrivate): Moved the
+	info widget to this structure.
+	(impl_createControls): removed the info widget and using the
+	info widget from the mailcomponent structure.
+	(mail_component_get_view_widget_label_info): New routine to 
+	get the info widget.
+	* mail/em-folder-tree.c (emft_popup_delete_response): 
+	(emft_popup_rename_folder): once deleted or renamed
+	change the label to the default "Mail"
+	
 2005-02-28  JP Rosevear  <jpr novell com>
 
 	* em-utils.c (em_utils_configure_account): pass in accountDruid


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