Index: src/Nautilus_shell.server.in
===================================================================
RCS file: /cvs/gnome/nautilus/src/Nautilus_shell.server.in,v
retrieving revision 1.19
diff -u -r1.19 Nautilus_shell.server.in
--- src/Nautilus_shell.server.in	18 Apr 2002 18:39:01 -0000	1.19
+++ src/Nautilus_shell.server.in	24 May 2002 23:25:28 -0000
@@ -20,6 +20,7 @@
     <item value="x-directory/normal"/>
     <item value="x-directory/webdav"/>
     <item value="x-directory/webdav-prefer-directory"/>
+    <item value="x-directory/vfolder-desktop"/>
   </oaf_attribute>
   <oaf_attribute name="bonobo:additional_uri_schemes" type="stringv">
     <item value="gnome-trash"/>
@@ -54,6 +55,7 @@
     <item value="x-directory/normal"/>
     <item value="x-directory/webdav"/>
     <item value="x-directory/webdav-prefer-directory"/>
+    <item value="x-directory/vfolder-desktop"/>
   </oaf_attribute>
   <oaf_attribute name="bonobo:additional_uri_schemes" type="stringv">
     <item value="gnome-trash"/>
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.536
diff -u -r1.536 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	23 May 2002 15:35:56 -0000	1.536
+++ src/file-manager/fm-directory-view.c	24 May 2002 23:25:41 -0000
@@ -109,6 +109,8 @@
 #define FM_DIRECTORY_VIEW_COMMAND_OPEN_ALTERNATE        		"/commands/OpenAlternate"
 #define FM_DIRECTORY_VIEW_COMMAND_OPEN_WITH				"/commands/Open With"
 #define FM_DIRECTORY_VIEW_COMMAND_NEW_FOLDER				"/commands/New Folder"
+#define FM_DIRECTORY_VIEW_COMMAND_NEW_LAUNCHER				"/commands/New Launcher"
+#define FM_DIRECTORY_VIEW_COMMAND_EDIT_LAUNCHER				"/commands/Edit Launcher"
 #define FM_DIRECTORY_VIEW_COMMAND_DELETE                    		"/commands/Delete"
 #define FM_DIRECTORY_VIEW_COMMAND_SHOW_TRASH                    	"/commands/Show Trash"
 #define FM_DIRECTORY_VIEW_COMMAND_TRASH                    		"/commands/Trash"
@@ -747,6 +749,39 @@
 }
 
 static void
+edit_launcher (NautilusFile *file)
+{
+	char *uri;
+
+	uri = nautilus_file_get_uri (file);
+
+	nautilus_launch_application_from_command ("gnome-desktop-item-edit", 
+						  "gnome-desktop-item-edit",
+						  uri, 
+						  FALSE);
+	g_free (uri);
+}
+
+static void
+edit_launcher_callback (BonoboUIComponent *component, gpointer callback_data, const char *verb)
+{
+        GList *selection;
+	FMDirectoryView *view;
+
+	g_assert (FM_IS_DIRECTORY_VIEW (callback_data));
+
+	view = FM_DIRECTORY_VIEW (callback_data);
+
+       	selection = fm_directory_view_get_selection (view);
+
+	if (selection_contains_one_item_in_menu_callback (view, selection)) {
+		edit_launcher (NAUTILUS_FILE (selection->data));
+	}
+
+	nautilus_file_list_free (selection);
+}
+
+static void
 trash_or_delete_selected_files (FMDirectoryView *view)
 {
         GList *selection;
@@ -936,6 +971,26 @@
 }
 
 static void
+new_launcher_callback (BonoboUIComponent *component, gpointer callback_data, const char *verb)
+{
+	char *parent_uri;
+	FMDirectoryView *view;
+
+        g_assert (FM_IS_DIRECTORY_VIEW (callback_data));
+
+	view = FM_DIRECTORY_VIEW (callback_data);
+
+	parent_uri = fm_directory_view_get_uri (view);
+
+	nautilus_launch_application_from_command ("gnome-desktop-item-edit", 
+						  "gnome-desktop-item-edit --create-new",
+						  parent_uri, 
+						  FALSE);
+
+	g_free (parent_uri);
+}
+
+static void
 open_properties_window_callback (BonoboUIComponent *component, gpointer callback_data, const char *verb)
 {
         FMDirectoryView *view;
@@ -988,6 +1043,32 @@
 	return result;
 }
 
+static gboolean
+we_are_in_vfolder_desktop_dir (FMDirectoryView *view)
+{
+	NautilusFile *file;
+	char *mime_type;
+
+	g_return_val_if_fail (FM_IS_DIRECTORY_VIEW (view), NULL);
+
+	if (view->details->model == NULL) {
+		return FALSE;
+	}
+
+	file = nautilus_directory_get_corresponding_file (vew->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
 bonobo_control_activate_callback (BonoboObject *control, gboolean state, gpointer callback_data)
 {
@@ -4158,11 +4239,13 @@
 		BONOBO_UI_VERB ("Duplicate", duplicate_callback),
 		BONOBO_UI_VERB ("Empty Trash", bonobo_menu_empty_trash_callback),
 		BONOBO_UI_VERB ("New Folder", new_folder_callback),
+		BONOBO_UI_VERB ("New Launcher", new_launcher_callback),
 		BONOBO_UI_VERB ("Open Scripts Folder", open_scripts_folder_callback),
 		BONOBO_UI_VERB ("Open", open_callback),
 		BONOBO_UI_VERB ("OpenAlternate", open_alternate_callback),
 		BONOBO_UI_VERB ("OtherApplication", other_application_callback),
 		BONOBO_UI_VERB ("OtherViewer", other_viewer_callback),
+		BONOBO_UI_VERB ("Edit Launcher", edit_launcher_callback),
 		BONOBO_UI_VERB ("Paste Files", paste_files_callback),
 		BONOBO_UI_VERB ("Remove Custom Icons", remove_custom_icons_callback),
 		BONOBO_UI_VERB ("Reset Background", reset_background_callback),
@@ -4241,6 +4324,7 @@
 	gboolean can_link_files;
 	gboolean can_duplicate_files;
 	gboolean show_separate_delete_command;
+	gboolean vfolder_directory;
 	EelBackground *background;
 
 	if (view->details->ui == NULL) {
@@ -4262,6 +4346,7 @@
 	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);
 
 	bonobo_ui_component_freeze (view->details->ui, NULL);
 
@@ -4440,6 +4525,22 @@
 	nautilus_bonobo_set_sensitive (view->details->ui,
 				       FM_DIRECTORY_VIEW_COMMAND_SHOW_TRASH,
 				       !NAUTILUS_IS_TRASH_DIRECTORY (fm_directory_view_get_model (view)));
+
+	nautilus_bonobo_set_hidden (view->details->ui, 
+				    FM_DIRECTORY_VIEW_COMMAND_NEW_LAUNCHER,
+				    ! vfolder_directory);
+
+	nautilus_bonobo_set_hidden (view->details->ui, 
+				    FM_DIRECTORY_VIEW_COMMAND_EDIT_LAUNCHER,
+				    ! vfolder_directory);
+
+	nautilus_bonobo_set_sensitive (view->details->ui, 
+				       FM_DIRECTORY_VIEW_COMMAND_NEW_LAUNCHER,
+				       can_create_files);
+
+	nautilus_bonobo_set_sensitive (view->details->ui, 
+				       FM_DIRECTORY_VIEW_COMMAND_EDIT_LAUNCHER,
+				       selection_count == 1);
 
 	bonobo_ui_component_thaw (view->details->ui, NULL);
 
Index: src/file-manager/nautilus-directory-view-ui.xml
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/nautilus-directory-view-ui.xml,v
retrieving revision 1.43
diff -u -r1.43 nautilus-directory-view-ui.xml
--- src/file-manager/nautilus-directory-view-ui.xml	8 May 2002 22:06:59 -0000	1.43
+++ src/file-manager/nautilus-directory-view-ui.xml	24 May 2002 23:25:41 -0000
@@ -18,6 +18,12 @@
 	<cmd name="New Folder"
          _label="New Folder"
 	 _tip="Create a new empty folder inside this folder"/>
+        <cmd name="New Launcher"
+         _label="New Launcher"
+         _tip="Create a new launcher"/>
+        <cmd name="Edit Launcher"
+         _label="Edit Launcher"
+         _tip="Edit the launcher information"/>
 	<cmd name="Open"
          _label="Open"
 	 _tip="Open the selected item in this window"/>
@@ -81,6 +87,10 @@
 			  	  accel="*Shift**Control*n"
 				  pixtype="stock" pixname="gtk-new"
 				  verb="New Folder"/>
+			<menuitem name="New Launcher"
+				  _label="New La_uncher"
+				  pixtype="stock" pixname="gtk-new"
+				  verb="New Launcher"/>
 		</placeholder>
 		<placeholder name="Open Placeholder">
 			<menuitem name="Open"
@@ -105,6 +115,8 @@
 					  _label="Other _Viewer..."
 					  verb="OtherViewer"/>
 			</submenu>
+			<menuitem name="Edit Launcher"
+				  verb="Edit Launcher"/>
 			<submenu name="Scripts"
 				 _label="Scripts"
 				 _tip="Run or manage scripts from ~/Nautilus/scripts">
@@ -196,6 +208,9 @@
 				<menuitem name="New Folder" 
 				  pixtype="stock" pixname="gtk-new"
 				 verb="New Folder"/>
+				<menuitem name="New Launcher"
+				 pixtype="stock" pixname="gtk-new"
+				 verb="New Launcher"/>
 			</placeholder>
                         <submenu name="Scripts"
 				 _label="Scripts"
@@ -242,6 +257,8 @@
 				<placeholder name="Viewers Placeholder" delimit="none"/>
 				<menuitem name="OtherViewer" verb="OtherViewer"/>
 			</submenu>
+			<menuitem name="Edit Launcher"
+				  verb="Edit Launcher"/>
 			<submenu name="Scripts"
 				 _label="Scripts"
 				 _tip="Run or manage scripts from ~/Nautilus/scripts"
