[nautilus] Remove "Create Launcher" entry option



commit 475ed89d6e6ac99f46700babd16671f88bd1386c
Author: Didier Roche <didrocks ubuntu com>
Date:   Mon Jul 25 13:12:48 2011 +0200

    Remove "Create Launcher" entry option
    
    "Create launcher" entry from nautilus seems weird as nautilus doesn't draw the
    desktop for GNOME Shell, and this rely on a gnome-panel binary. This brings
    inconsistency between the two sessions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654848
    https://bugs.launchpad.net/bugs/723861

 src/nautilus-actions.h                |    2 -
 src/nautilus-desktop-icon-view-ui.xml |    1 -
 src/nautilus-desktop-icon-view.c      |   32 ----------------
 src/nautilus-directory-view-ui.xml    |    2 -
 src/nautilus-view.c                   |   66 +--------------------------------
 src/nautilus-view.h                   |    2 +-
 6 files changed, 2 insertions(+), 103 deletions(-)
---
diff --git a/src/nautilus-actions.h b/src/nautilus-actions.h
index dfb3c60..8b1a5e1 100644
--- a/src/nautilus-actions.h
+++ b/src/nautilus-actions.h
@@ -81,8 +81,6 @@
 #define NAUTILUS_ACTION_COPY_TO_DESKTOP "Copy to Desktop"
 #define NAUTILUS_ACTION_MOVE_TO_DESKTOP "Move to Desktop"
 #define NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO "LocationPasteFilesInto"
-#define NAUTILUS_ACTION_NEW_LAUNCHER "New Launcher"
-#define NAUTILUS_ACTION_NEW_LAUNCHER_DESKTOP "New Launcher Desktop"
 #define NAUTILUS_ACTION_RENAME "Rename"
 #define NAUTILUS_ACTION_DUPLICATE "Duplicate"
 #define NAUTILUS_ACTION_CREATE_LINK "Create Link"
diff --git a/src/nautilus-desktop-icon-view-ui.xml b/src/nautilus-desktop-icon-view-ui.xml
index d437801..9735b0c 100644
--- a/src/nautilus-desktop-icon-view-ui.xml
+++ b/src/nautilus-desktop-icon-view-ui.xml
@@ -4,7 +4,6 @@
                 <placeholder name="New Window Items">
                 </placeholder>
                 <placeholder name="New Object Items">
-                        <menuitem name="New Launcher" action="New Launcher Desktop"/>
                 </placeholder>
         </placeholder>
         <placeholder name="After Zoom Items">
diff --git a/src/nautilus-desktop-icon-view.c b/src/nautilus-desktop-icon-view.c
index 778fed2..7a8661b 100644
--- a/src/nautilus-desktop-icon-view.c
+++ b/src/nautilus-desktop-icon-view.c
@@ -646,23 +646,6 @@ nautilus_desktop_icon_view_init (NautilusDesktopIconView *desktop_icon_view)
 }
 
 static void
-action_new_launcher_callback (GtkAction *action, gpointer data)
-{
-	char *desktop_directory;
-
-        g_assert (NAUTILUS_VIEW (data));
-
-	desktop_directory = nautilus_get_desktop_directory ();
-
-	nautilus_launch_application_from_command (gtk_widget_get_screen (GTK_WIDGET (data)),
-						  "gnome-desktop-item-edit",
-						  FALSE,
-						  "--create-new", desktop_directory, NULL);
-	g_free (desktop_directory);
-
-}
-
-static void
 action_change_background_callback (GtkAction *action, 
 				   gpointer data)
 {
@@ -717,7 +700,6 @@ real_update_menus (NautilusView *view)
 {
 	NautilusDesktopIconView *desktop_view;
 	char *label;
-	gboolean disable_command_line;
 	gboolean include_empty_trash;
 	GtkAction *action;
 
@@ -727,13 +709,6 @@ real_update_menus (NautilusView *view)
 
 	desktop_view = NAUTILUS_DESKTOP_ICON_VIEW (view);
 
-	/* New Launcher */
-	disable_command_line = g_settings_get_boolean (gnome_lockdown_preferences, NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE);
-	action = gtk_action_group_get_action (desktop_view->details->desktop_action_group,
-					      NAUTILUS_ACTION_NEW_LAUNCHER_DESKTOP);
-	gtk_action_set_visible (action,
-				!disable_command_line);
-
 	/* Empty Trash */
 	include_empty_trash = trash_link_is_selection (view);
 	action = gtk_action_group_get_action (desktop_view->details->desktop_action_group,
@@ -751,13 +726,6 @@ real_update_menus (NautilusView *view)
 
 static const GtkActionEntry desktop_view_entries[] = {
 	/* name, stock id */
-	{ "New Launcher Desktop", NULL,
-	  /* label, accelerator */
-	  N_("Create L_auncher..."), NULL,
-	  /* tooltip */
-	  N_("Create a new launcher"),
-	  G_CALLBACK (action_new_launcher_callback) },
-	/* name, stock id */
 	{ "Change Background", NULL,
 	  /* label, accelerator */
 	  N_("Change Desktop _Background"), NULL,
diff --git a/src/nautilus-directory-view-ui.xml b/src/nautilus-directory-view-ui.xml
index 9ed18bf..62d1a1b 100644
--- a/src/nautilus-directory-view-ui.xml
+++ b/src/nautilus-directory-view-ui.xml
@@ -13,7 +13,6 @@
 				 <separator name="After New Documents"/>
 				 <menuitem name="New Empty Document" action="New Empty Document"/>
 			</menu>
-			<menuitem name="New Launcher" action="New Launcher"/>
 		</placeholder>
 		<placeholder name="Open Placeholder">
 			<menuitem name="Open" action="Open"/>
@@ -95,7 +94,6 @@
 	<placeholder name="Before Zoom Items">
 		<placeholder name="New Object Items">
 			<menuitem name="New Folder" action="New Folder"/>
-			<menuitem name="New Launcher" action="New Launcher"/>
 			<menu action="New Documents">
 		         	<menuitem name="No Templates" action="No Templates"/>
 			 	<placeholder name="New Documents Placeholder"/>
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 7712518..86e352c 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -391,7 +391,7 @@ real_get_backing_uri (NautilusView *view)
  * nautilus_view_get_backing_uri:
  *
  * Returns the URI for the target location of new directory, new file, new
- * link, new launcher, and paste operations.
+ * link and paste operations.
  */
 
 char *
@@ -2108,30 +2108,6 @@ action_new_empty_file_callback (GtkAction *action,
 }
 
 static void
-action_new_launcher_callback (GtkAction *action,
-			      gpointer callback_data)
-{
-	char *parent_uri;
-	NautilusView *view;
-	GtkWindow *window;
-
-	g_assert (NAUTILUS_IS_VIEW (callback_data));
-
-	view = NAUTILUS_VIEW (callback_data);
-
-	parent_uri = nautilus_view_get_backing_uri (view);
-
-	window = nautilus_view_get_containing_window (view);
-	DEBUG ("Create new launcher in window=%p: %s", window, parent_uri);
-	nautilus_launch_application_from_command (gtk_widget_get_screen (GTK_WIDGET (view)),
-						  "gnome-desktop-item-edit",
-						  FALSE,
-						  "--create-new", parent_uri, NULL);
-
-	g_free (parent_uri);
-}
-
-static void
 action_properties_callback (GtkAction *action,
 			    gpointer callback_data)
 {
@@ -2210,32 +2186,6 @@ all_selected_items_in_trash (NautilusView *view)
 	return result;
 }
 
-static gboolean
-we_are_in_vfolder_desktop_dir (NautilusView *view)
-{
-	NautilusFile *file;
-	char *mime_type;
-
-	g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
-
-	if (view->details->model == NULL) {
-		return FALSE;
-	}
-
-	file = nautilus_directory_get_corresponding_file (view->details->model);
-	mime_type = nautilus_file_get_mime_type (file);
-	nautilus_file_unref (file);
-
-	if (mime_type != NULL
-	    && strcmp (mime_type, "x-directory/vfolder-desktop") == 0) {
-		g_free (mime_type);
-		return TRUE;
-	} else {
-		g_free (mime_type);
-		return FALSE;
-	}
-}
-
 static void
 click_policy_changed_callback (gpointer callback_data)
 {
@@ -6979,10 +6929,6 @@ static const GtkActionEntry directory_view_entries[] = {
   /* 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 */         { "New Launcher", NULL,
-  /* label, accelerator */       N_("Create L_auncher..."), NULL,
-  /* tooltip */                  N_("Create a new launcher"),
-				 G_CALLBACK (action_new_launcher_callback) },
   /* name, stock id */         { "Open", NULL,
   /* label, accelerator */       N_("_Open"), "<control>o",
   /* tooltip */                  N_("Open the selected item in this window"),
@@ -8296,8 +8242,6 @@ real_update_menus (NautilusView *view)
 	gboolean can_link_files;
 	gboolean can_duplicate_files;
 	gboolean show_separate_delete_command;
-	gboolean vfolder_directory;
-	gboolean disable_command_line;
 	gboolean show_open_alternate;
 	gboolean show_open_in_new_tab;
 	gboolean can_open;
@@ -8331,8 +8275,6 @@ real_update_menus (NautilusView *view)
 	can_duplicate_files = can_create_files && can_copy_files;
 	can_link_files = can_create_files && can_copy_files;
 	
-	vfolder_directory = we_are_in_vfolder_desktop_dir (view);
-
 	action = gtk_action_group_get_action (view->details->dir_action_group,
 					      NAUTILUS_ACTION_RENAME);
 	/* rename sensitivity depending on selection */
@@ -8598,12 +8540,6 @@ real_update_menus (NautilusView *view)
 
 	real_update_paste_menu (view, selection, selection_count);
 
-	disable_command_line = g_settings_get_boolean (gnome_lockdown_preferences, NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE);
-	action = gtk_action_group_get_action (view->details->dir_action_group,
-					      NAUTILUS_ACTION_NEW_LAUNCHER);
-	gtk_action_set_visible (action, vfolder_directory && !disable_command_line);
-	gtk_action_set_sensitive (action, can_create_files);
-
 	real_update_menus_volumes (view, selection, selection_count);
 
 	nautilus_file_list_free (selection);
diff --git a/src/nautilus-view.h b/src/nautilus-view.h
index bd3c6d7..8d2e124 100644
--- a/src/nautilus-view.h
+++ b/src/nautilus-view.h
@@ -145,7 +145,7 @@ struct NautilusViewClass {
 	/* get_backing uri is a function pointer for subclasses to
 	 * override. Subclasses may replace it with a function that
 	 * returns the URI for the location where to create new folders,
-	 * files, links, launchers, and paste the clipboard to.
+	 * files, links and paste the clipboard to.
 	 */
 
 	char *	(* get_backing_uri)		(NautilusView *view);



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