File nautilus-stray-empty-document.patch of Package nautilus

From a0b78f40099e5861a1d6e40b4e2295241bf9a224 Mon Sep 17 00:00:00 2001
From: Cosimo Cecchi <cosimoc@gnome.org>
Date: Mon, 5 Nov 2012 16:36:10 -0500
Subject: [PATCH] view: don't show stray Empty Document entry in New Document
 menu

This now reflects files in the templates directory - no point in adding
yet another "stock" entry with this model.

https://bugzilla.gnome.org/show_bug.cgi?id=687139
---
 src/nautilus-actions.h             |  1 -
 src/nautilus-directory-view-ui.xml |  4 ----
 src/nautilus-view.c                | 38 --------------------------------------
 3 files changed, 43 deletions(-)

diff --git a/src/nautilus-actions.h b/src/nautilus-actions.h
index 012589c..0132454 100644
--- a/src/nautilus-actions.h
+++ b/src/nautilus-actions.h
@@ -118,7 +118,6 @@
 #define NAUTILUS_ACTION_SCRIPTS "Scripts"
 #define NAUTILUS_ACTION_OPEN_SCRIPTS_FOLDER "Open Scripts Folder"
 #define NAUTILUS_ACTION_NEW_DOCUMENTS "New Documents"
-#define NAUTILUS_ACTION_NEW_EMPTY_DOCUMENT "New Empty Document"
 #define NAUTILUS_ACTION_EMPTY_TRASH_CONDITIONAL "Empty Trash Conditional"
 #define NAUTILUS_ACTION_MANUAL_LAYOUT "Manual Layout"
 #define NAUTILUS_ACTION_REVERSED_ORDER "Reversed Order"
diff --git a/src/nautilus-directory-view-ui.xml b/src/nautilus-directory-view-ui.xml
index 9950137..efdb9d1 100644
--- a/src/nautilus-directory-view-ui.xml
+++ b/src/nautilus-directory-view-ui.xml
@@ -16,8 +16,6 @@
     <menuitem name="New Folder with Selection" action="New Folder with Selection"/>
     <menu action="New Documents">
       <placeholder name="New Documents Placeholder"/>
-      <separator name="After New Documents"/>
-      <menuitem name="New Empty Document" action="New Empty Document"/>
     </menu>
   </placeholder>
   <placeholder name="Global File Items Placeholder">
@@ -44,8 +42,6 @@
       <menuitem name="New Folder" action="New Folder"/>
       <menu action="New Documents">
         <placeholder name="New Documents Placeholder"/>
-        <separator name="After New Documents"/>
-        <menuitem name="New Empty Document" action="New Empty Document"/>
       </menu>
     </placeholder>
     <separator name="Clipboard separator"/>
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index f01442a..76f2f66 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -2099,15 +2099,6 @@ action_new_folder_with_selection_callback (GtkAction *action,
 }
 
 static void
-action_new_empty_file_callback (GtkAction *action,
-				gpointer callback_data)
-{                
-        g_assert (NAUTILUS_IS_VIEW (callback_data));
-
-	nautilus_view_new_file (NAUTILUS_VIEW (callback_data), NULL, NULL);
-}
-
-static void
 action_properties_callback (GtkAction *action,
 			    gpointer callback_data)
 {
@@ -7145,11 +7136,6 @@ static const GtkActionEntry directory_view_entries[] = {
   /* label, accelerator */       N_("New Folder with Selection"), NULL,
   /* tooltip */                  N_("Create a new folder containing the selected items"),
 				 G_CALLBACK (action_new_folder_with_selection_callback) },
-  /* name, stock id */         { NAUTILUS_ACTION_NEW_EMPTY_DOCUMENT, NULL,
-    /* translators: this is used to indicate that a document doesn't contain anything */
-  /* label, accelerator */       N_("_Empty Document"), NULL,
-  /* tooltip */                  N_("Create a new empty document inside this folder"),
-				 G_CALLBACK (action_new_empty_file_callback) },
   /* name, stock id */         { NAUTILUS_ACTION_OPEN, NULL,
   /* label, accelerator */       N_("_Open"), "<control>o",
   /* tooltip */                  N_("Open the selected item in this window"),
@@ -7402,27 +7388,6 @@ static const GtkToggleActionEntry directory_view_toggle_entries[] = {
 };
 
 static void
-connect_proxy (NautilusView *view,
-	       GtkAction *action,
-	       GtkWidget *proxy,
-	       GtkActionGroup *action_group)
-{
-	GdkPixbuf *pixbuf;
-	GtkWidget *image;
-
-	if (strcmp (gtk_action_get_name (action), NAUTILUS_ACTION_NEW_EMPTY_DOCUMENT) == 0 &&
-	    GTK_IS_IMAGE_MENU_ITEM (proxy)) {
-		pixbuf = nautilus_ui_get_menu_icon ("text-x-generic");
-		if (pixbuf != NULL) {
-			image = gtk_image_new_from_pixbuf (pixbuf);
-			gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), image);
-
-			g_object_unref (pixbuf);
-		}
-	}
-}
-
-static void
 pre_activate (NautilusView *view,
 	      GtkAction *action,
 	      GtkActionGroup *action_group)
@@ -7485,9 +7450,6 @@ real_merge_menus (NautilusView *view)
 	g_object_unref (action);
 	g_free (tooltip);
 
-	g_signal_connect_object (action_group, "connect-proxy",
-				 G_CALLBACK (connect_proxy), G_OBJECT (view),
-				 G_CONNECT_SWAPPED);
 	g_signal_connect_object (action_group, "pre-activate",
 				 G_CALLBACK (pre_activate), G_OBJECT (view),
 				 G_CONNECT_SWAPPED);
-- 
1.8.0.1

openSUSE Build Service is sponsored by