[evolution-patches] set window title to component name



Hi,

Here is a patch that should set the shell window title to the active component name (alias).

This should work IF the component_alias is always ASCII and not translated. As far as I can tell this is true.

Please let me know if this looks ok.

Thanks,
Jon
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1406
diff -p -u -r1.1406 ChangeLog
--- ChangeLog	31 Mar 2004 17:05:51 -0000	1.1406
+++ ChangeLog	31 Mar 2004 18:10:48 -0000
@@ -1,3 +1,8 @@
+2004-03-31  William Jon McCann  <mccann jhu edu>
+
+	* e-shell-window.c (switch_view): set window title to name of
+	current component view.
+
 2004-03-31  Rodney Dawes  <dobey ximian com>
 
 	* e-shell-importer.c (choose_importer_from_list):
Index: e-shell-window.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-window.c,v
retrieving revision 1.18
diff -p -u -r1.18 e-shell-window.c
--- e-shell-window.c	26 Jan 2004 21:56:03 -0000	1.18
+++ e-shell-window.c	31 Mar 2004 18:10:48 -0000
@@ -280,6 +280,7 @@ switch_view (EShellWindow *window, Compo
 {
 	EShellWindowPrivate *priv = window->priv;
 	GConfClient *gconf_client = gconf_client_get_default ();
+	char *title, *capitalized_alias;
 
 	if (component_view->sidebar_widget == NULL) {
 		init_view (window, component_view);
@@ -293,6 +294,13 @@ switch_view (EShellWindow *window, Compo
 		gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->sidebar_notebook), component_view->notebook_page_num);
 		gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->statusbar_notebook), component_view->notebook_page_num);
 	}
+
+	capitalized_alias = g_strdup (component_view->component_alias);
+	*capitalized_alias = toupper ((unsigned char)*capitalized_alias);
+	title = g_strdup_printf ("Evolution %s", capitalized_alias);
+	gtk_window_set_title (GTK_WINDOW (window), title);
+	g_free (title);
+	g_free (capitalized_alias);
 
 	gconf_client_set_string (gconf_client, "/apps/evolution/shell/view_defaults/component_id",
 				 (component_view->component_alias != NULL


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