Re: [PATCH] Remove gtk-delete icon from delete confirmation alerts



Il giorno lun, 13/02/2006 alle 10.30 +0100, Alexander Larsson ha
scritto:
> On Thu, 2006-02-09 at 09:22 +0100, Luca Ferretti wrote:
> > I prepared the attached patch for bug # 325945 [1]: following inputs
> > from Calum Benson and Matthias Clasen on theme list, by now the best way
> > to solve this issue should be:
> > 
> >      1. remove the GTK_STOCK_DELETE icon from confirmation alerts for
> >         delete actions (reason: currently we have no good icon for
> >         delete)
> >      2. switch to "gnome-fs-trash-[empty|full]" named icon in "Move to
> >         Trash" menu entries (reason: use trash icon in move to trash
> >         action)
> > 
> > Unfortunately it seems that gnome-fs-trash-* is non showed in menus at
> > runtime... Any idea?
> 
> I think you need to add it to register_icons() in src/nautilus-main.c.

You are right, but this bring up another issue.

I've added gnome-fs-trash-full to register_icons() in
icons_to_register[], recompiled and installed. Now the trash full icon
is showed near the "Move to Trash" label in popup menu.

Unfortunately, changing icon theme (for example from "GNOME" to
"Tango"), this icon is not updated (GNOME trash is blue, Tango is
green): I've to kill nautilus. 

PS do we really have to register named icons ?

PPS do you think I can propose the attached patch to release team for
2.14?

? cut-n-paste-code/gsequence/.deps
? cut-n-paste-code/gsequence/.libs
? cut-n-paste-code/gsequence/gsequence.lo
? cut-n-paste-code/gsequence/libgsequence.la
? cut-n-paste-code/libegg/.deps
? cut-n-paste-code/libegg/.libs
? cut-n-paste-code/libegg/egg-recent-item.lo
? cut-n-paste-code/libegg/egg-recent-model.lo
? cut-n-paste-code/libegg/eggtreemultidnd.lo
? cut-n-paste-code/libegg/libegg.la
? libbackground/.deps
? libbackground/.libs
? libbackground/applier.lo
? libbackground/libbackground.la
? libbackground/preferences.lo
? po/.intltool-merge-cache
Index: src/nautilus-main.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-main.c,v
retrieving revision 1.151
diff -p -u -r1.151 nautilus-main.c
--- src/nautilus-main.c	15 Dec 2005 14:25:57 -0000	1.151
+++ src/nautilus-main.c	13 Feb 2006 11:21:00 -0000
@@ -137,7 +137,7 @@ register_icons (void)
 	GtkIconSource *source;
 	GtkIconSet *set;
 	GtkIconFactory *factory;
-	const char *icons_to_register[] = {"gnome-fs-client", "gnome-fs-network", "gnome-fs-home", "gnome-fs-trash-empty", "gnome-dev-cdrom", "stock_new-template"};
+	const char *icons_to_register[] = {"gnome-fs-client", "gnome-fs-network", "gnome-fs-home", "gnome-fs-trash-empty", "gnome-fs-trash-full", "gnome-dev-cdrom", "stock_new-template"};
 	struct { int pixel; int gtk; } sizes[] = {
 		{16, GTK_ICON_SIZE_MENU},
 		{18, GTK_ICON_SIZE_SMALL_TOOLBAR},
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.734
diff -p -u -r1.734 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	26 Jan 2006 22:20:59 -0000	1.734
+++ src/file-manager/fm-directory-view.c	13 Feb 2006 11:21:08 -0000
@@ -1011,7 +1011,7 @@ confirm_delete_directly (FMDirectoryView
 		                                   _("If you delete an item, it is permanently lost.")));
 							
 	gtk_dialog_add_button (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-	gtk_dialog_add_button (dialog, GTK_STOCK_DELETE, GTK_RESPONSE_YES);
+	gtk_dialog_add_button (dialog, _("_Delete"), GTK_RESPONSE_YES);
 	gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
 
 	g_free (prompt);
@@ -3734,7 +3734,7 @@ fm_directory_view_confirm_deletion (FMDi
 
 	dialog = eel_show_yes_no_dialog
 		(prompt,
-		 detail, GTK_STOCK_DELETE, GTK_STOCK_CANCEL,
+		 detail, "_Delete", GTK_STOCK_CANCEL,
 		 fm_directory_view_get_containing_window (view));
 	
 	g_free (detail);
@@ -3783,7 +3783,7 @@ confirm_delete_from_trash (FMDirectoryVi
 						  prompt,
 						  _("If you delete an item, it will be permanently lost.")));
 	gtk_dialog_add_button (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-	gtk_dialog_add_button (dialog, GTK_STOCK_DELETE, GTK_RESPONSE_YES);
+	gtk_dialog_add_button (dialog, "_Delete", GTK_RESPONSE_YES);
 
 	gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
 
@@ -6650,7 +6650,7 @@ static const GtkActionEntry directory_vi
     "RenameSelectAll", "<shift>F2",                /* label, accelerator */
     NULL,                   /* tooltip */ 
     G_CALLBACK (action_rename_select_all_callback) },
-  { "Trash", GTK_STOCK_DELETE,                  /* name, stock id */
+  { "Trash", "gnome-fs-trash-full",                  /* name, stock id */
     N_("Mo_ve to Trash"), "<control>T",                /* label, accelerator */
     N_("Move each selected item to the Trash"),                   /* tooltip */ 
     G_CALLBACK (action_trash_callback) },
@@ -6710,7 +6710,7 @@ static const GtkActionEntry directory_vi
     N_("Prepare this folder to be copied with a Paste command"),                   /* tooltip */ 
     G_CALLBACK (action_location_copy_callback) },
 
-  { FM_ACTION_LOCATION_TRASH, GTK_STOCK_DELETE,                  /* name, stock id */
+  { FM_ACTION_LOCATION_TRASH, "gnome-fs-trash-full",                  /* name, stock id */
     N_("Mo_ve to Trash"), "",                /* label, accelerator */
     N_("Move this folder to the Trash"),                   /* tooltip */ 
     G_CALLBACK (action_location_trash_callback) },
Index: src/file-manager/fm-tree-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-tree-view.c,v
retrieving revision 1.23
diff -p -u -r1.23 fm-tree-view.c
--- src/file-manager/fm-tree-view.c	16 Jan 2006 23:48:20 -0000	1.23
+++ src/file-manager/fm-tree-view.c	13 Feb 2006 11:21:09 -0000
@@ -1173,8 +1173,8 @@ create_popup_menu (FMTreeView *view)
 	gtk_menu_shell_append (GTK_MENU_SHELL (popup), separator_item);
 	
 	/* add the "move to trash" menu item */
-	menu_image = gtk_image_new_from_stock (GTK_STOCK_DELETE,
-					       GTK_ICON_SIZE_MENU);
+	menu_image = gtk_image_new_from_icon_name ("gnome-fs-trash-full",
+						   GTK_ICON_SIZE_MENU);
 	gtk_widget_show (menu_image);
 	menu_item = gtk_image_menu_item_new_with_label (_("Move to Trash"));
 	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item),


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