[nautilus] view: don't show stray Empty Document entry in New Document menu



commit 9323dde5c0f06b048b1daaf2cc683991d6b7d076
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Nov 5 16:36:10 2012 -0500

    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, 0 insertions(+), 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 40d05c5..8f874fd 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -2097,15 +2097,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)
 {
@@ -7120,11 +7111,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"),
@@ -7377,27 +7363,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)
@@ -7460,9 +7425,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);



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