Re: Patch for window titles



On Tue, 2004-04-27 at 17:52 -0400, Dave Camp wrote:
> Looks like a good idea to me, a few comments inline below.

Hi Dave

Thanks for the comments, cleaned up patch is attached. Let me know what
to do with it :)

Cheers
Grahame

? libnautilus-extension/Makefile
? libnautilus-extension/Makefile.in
? libnautilus-extension/libnautilus-extension.pc
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.6181
diff -u -r1.6181 ChangeLog
--- ChangeLog	22 Apr 2004 06:29:02 -0000	1.6181
+++ ChangeLog	28 Apr 2004 02:58:08 -0000
@@ -1,3 +1,8 @@
+2004-04-28  Grahame Bowland  <grahame angrygoats net>
+
+	* src/nautilus-window.c (compute_default_title):
+	Display server name in window title for remote URIs.
+
 2004-04-22  Martin Wehner  <martin wehner epost de>
 
 	* libnautilus-private/nautilus-icon-factory.c (cache_icon_unref):
Index: src/nautilus-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window.c,v
retrieving revision 1.433
diff -u -r1.433 nautilus-window.c
--- src/nautilus-window.c	14 Apr 2004 16:07:25 -0000	1.433
+++ src/nautilus-window.c	28 Apr 2004 02:58:09 -0000
@@ -1140,11 +1140,28 @@
 compute_default_title (const char *text_uri)
 {
 	NautilusFile *file;
-	char *title;
+	GnomeVFSURI *uri;
+	char *title, *displayname;
+	const char *hostname;
+
+	hostname = NULL;
 
 	if (text_uri) {
 		file = nautilus_file_get (text_uri);
-		title = nautilus_file_get_display_name (file);
+		uri = gnome_vfs_uri_new (text_uri);
+		if (uri && !gnome_vfs_uri_is_local (uri)) {
+			hostname = gnome_vfs_uri_get_host_name (uri);
+		}
+		displayname = nautilus_file_get_display_name (file);
+		if (hostname) {
+			title = g_strdup_printf (_("%s on %s"), displayname, hostname);
+			g_free (displayname);
+		} else {
+			title = displayname;
+		}
+		if (uri) {
+			gnome_vfs_uri_unref (uri);
+		}
 		nautilus_file_unref (file);
 	} else {
 		title = g_strdup ("");


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