[PATCH] Change the file browser window's icon



From bug 166516 [1]:

'I think it would be better to have the "file-manager.png" icon used for
the file browser windows. Right now it uses the folder icon.'

Proposed patch attached.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=166516

--
Christian Neumair <chris gnome-de org>
Index: src/nautilus-desktop-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-desktop-window.c,v
retrieving revision 1.62
diff -u -p -r1.62 nautilus-desktop-window.c
--- src/nautilus-desktop-window.c	23 Mar 2005 08:10:43 -0000	1.62
+++ src/nautilus-desktop-window.c	20 Jul 2005 13:06:49 -0000
@@ -246,6 +246,12 @@ real_get_title (NautilusWindow *window)
 	return g_strdup (_("Desktop"));
 }
 
+static char *
+real_get_icon_name (NautilusWindow *window)
+{
+	return g_strdup ("gnome-fs-desktop");
+}
+
 static void
 nautilus_desktop_window_class_init (NautilusDesktopWindowClass *class)
 {
@@ -262,4 +268,7 @@ nautilus_desktop_window_class_init (Naut
 		= real_add_current_location_to_history_list;
 	NAUTILUS_WINDOW_CLASS (class)->get_title 
 		= real_get_title;
+	NAUTILUS_WINDOW_CLASS (class)->get_icon_name
+		= real_get_icon_name;
+
 }
Index: src/nautilus-navigation-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-navigation-window.c,v
retrieving revision 1.436
diff -u -p -r1.436 nautilus-navigation-window.c
--- src/nautilus-navigation-window.c	13 Jul 2005 12:23:37 -0000	1.436
+++ src/nautilus-navigation-window.c	20 Jul 2005 13:06:49 -0000
@@ -784,6 +784,12 @@ real_set_title (NautilusWindow *window, 
 	g_free (full_title);
 }
 
+static char *
+real_get_icon_name (NautilusWindow *window)
+{
+	return g_strdup ("file-manager");
+}
+
 static void
 zoom_level_changed_callback (NautilusView *view,
                              NautilusNavigationWindow *window)
@@ -1263,6 +1269,7 @@ nautilus_navigation_window_class_init (N
 	NAUTILUS_WINDOW_CLASS (class)->set_throbber_active = real_set_throbber_active;
 	NAUTILUS_WINDOW_CLASS (class)->prompt_for_location = real_prompt_for_location;
 	NAUTILUS_WINDOW_CLASS (class)->set_title = real_set_title;
+	NAUTILUS_WINDOW_CLASS (class)->get_icon_name = real_get_icon_name;
 	NAUTILUS_WINDOW_CLASS(class)->get_default_size = real_get_default_size;
 	NAUTILUS_WINDOW_CLASS (class)->close = real_window_close;
 }
Index: src/nautilus-spatial-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-spatial-window.c,v
retrieving revision 1.449
diff -u -p -r1.449 nautilus-spatial-window.c
--- src/nautilus-spatial-window.c	13 Jul 2005 10:39:43 -0000	1.449
+++ src/nautilus-spatial-window.c	20 Jul 2005 13:06:52 -0000
@@ -313,6 +313,12 @@ real_prompt_for_location (NautilusWindow
 	gtk_widget_show (dialog);
 }
 
+static char *
+real_get_icon_name (NautilusWindow *window)
+{
+	return nautilus_icon_factory_get_icon_for_file (window->details->viewed_file, FALSE);
+}
+
 static void
 real_set_title (NautilusWindow *window, const char *title)
 {
@@ -853,6 +859,8 @@ nautilus_spatial_window_class_init (Naut
 
 	NAUTILUS_WINDOW_CLASS (class)->prompt_for_location = 
 		real_prompt_for_location;
+	NAUTILUS_WINDOW_CLASS (class)->get_icon_name =
+		real_get_icon_name;
 	NAUTILUS_WINDOW_CLASS (class)->set_title = 
 		real_set_title;
 	NAUTILUS_WINDOW_CLASS (class)->set_content_view_widget = 
Index: src/nautilus-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window.c,v
retrieving revision 1.453
diff -u -p -r1.453 nautilus-window.c
--- src/nautilus-window.c	13 Jul 2005 10:39:44 -0000	1.453
+++ src/nautilus-window.c	20 Jul 2005 13:06:53 -0000
@@ -1109,15 +1109,10 @@ nautilus_window_update_title (NautilusWi
 void
 nautilus_window_update_icon (NautilusWindow *window)
 {
-	char *icon_name = NULL;
+	char *icon_name;
 
-	/* Desktop window special icon */
-	if (NAUTILUS_IS_DESKTOP_WINDOW (window)) {
-		icon_name = g_strdup ("gnome-fs-desktop");
-	} else {
-		icon_name = nautilus_icon_factory_get_icon_for_file (window->details->viewed_file,
-								     FALSE);
-	}
+	icon_name = EEL_CALL_METHOD_WITH_RETURN_VALUE (NAUTILUS_WINDOW_CLASS, window,
+						       get_icon_name, (window));
 
 	if (icon_name != NULL) {
 		gtk_window_set_icon_name (GTK_WINDOW (window), icon_name);
Index: src/nautilus-window.h
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window.h,v
retrieving revision 1.120
diff -u -p -r1.120 nautilus-window.h
--- src/nautilus-window.h	23 Jun 2005 14:16:59 -0000	1.120
+++ src/nautilus-window.h	20 Jul 2005 13:06:54 -0000
@@ -67,6 +67,7 @@ typedef struct {
 
         char * (* get_title) (NautilusWindow *window);
         void   (* set_title) (NautilusWindow *window, const char *title);
+	char * (* get_icon_name) (NautilusWindow *window);
 
         void   (* load_view_as_menu) (NautilusWindow *window);
         void   (* set_content_view_widget) (NautilusWindow *window, 

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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