diff --git a/nautilus-stray-empty-document.patch b/nautilus-stray-empty-document.patch new file mode 100644 index 0000000..da89c30 --- /dev/null +++ b/nautilus-stray-empty-document.patch @@ -0,0 +1,123 @@ +From a0b78f40099e5861a1d6e40b4e2295241bf9a224 Mon Sep 17 00:00:00 2001 +From: Cosimo Cecchi +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 @@ + + + +- +- + + + +@@ -44,8 +42,6 @@ + + + +- +- + + + +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"), "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 + diff --git a/nautilus.changes b/nautilus.changes index 56c1a80..4f3a112 100644 --- a/nautilus.changes +++ b/nautilus.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 14 18:49:07 UTC 2013 - mike.catanzaro@gmail.com + +- Add nautilus-stray-empty-document.patch, don't show a extra Empty + Document entry. (bnc#803649, bgo#687139) + ------------------------------------------------------------------- Thu Dec 20 16:23:26 UTC 2012 - zaitor@opensuse.org diff --git a/nautilus.spec b/nautilus.spec index de9847f..e5246b1 100644 --- a/nautilus.spec +++ b/nautilus.spec @@ -1,7 +1,7 @@ # # spec file for package nautilus # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,6 +32,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch15: nautilus-drives-and-volumes-on-desktop.diff # PATCH-FIX-UPSTREAM nautilus-make-sure-to-always-notify-when-unmounting.patch rh#885133 zaitor@opensuse.org -- fixes notifications when umounting drives. Patch16: nautilus-make-sure-to-always-notify-when-unmounting.patch +# PATCH-FIX-UPSTREAM nautilus-stray-empty-document.patch bnc#803649 bgo#687139 mike.catanzaro@gmail.com -- don't show extra Empty Document entry in the Templates menu +Patch17: nautilus-stray-empty-document.patch # needed for directory ownership BuildRequires: dbus-1 BuildRequires: fdupes @@ -119,6 +121,7 @@ translation-update-upstream ### %patch15 -p1 #gnome-patch-translation-update %patch16 -p1 +%patch17 -p1 %build %configure\