b0f4880
--- nautilus-2.15.2/src/file-manager/fm-directory-view.c.format	2006-06-13 10:35:04.000000000 -0400
b0f4880
+++ nautilus-2.15.2/src/file-manager/fm-directory-view.c	2006-06-13 10:49:07.000000000 -0400
b0f4880
@@ -6315,6 +6315,8 @@
b0f4880
 	GList *selection, *l;
b0f4880
 	GnomeVFSDrive *drive;
b0f4880
 	FMDirectoryView *view;
b0f4880
+        char *device_path;
b0f4880
+        char *cmdline;
b0f4880
 
b0f4880
         view = FM_DIRECTORY_VIEW (data);
b0f4880
 	
b0f4880
@@ -6324,9 +6326,18 @@
b0f4880
 
b0f4880
 		if (nautilus_file_has_drive (file)) {
b0f4880
 			drive = nautilus_file_get_drive (file);
b0f4880
+                        device_path = gnome_vfs_drive_get_device_path (drive);
b0f4880
+
b0f4880
 			if (gnome_vfs_drive_get_device_type (drive) == GNOME_VFS_DEVICE_TYPE_FLOPPY) {
b0f4880
-				g_spawn_command_line_async ("gfloppy", NULL);
b0f4880
+                                cmdline = g_strconcat ("gfloppy ", device_path, NULL);
b0f4880
+
b0f4880
 			}
b0f4880
+                        else {
b0f4880
+                               cmdline = g_strconcat ("userformat ", device_path, NULL);
b0f4880
+                        }
b0f4880
+                        g_spawn_command_line_async (cmdline, NULL);
b0f4880
+                        g_free (cmdline);
b0f4880
+                        g_free (device_path);
b0f4880
 		}
b0f4880
 	}	
b0f4880
 	nautilus_file_list_free (selection);
b0f4880
@@ -7188,17 +7199,18 @@
b0f4880
 	} else if (nautilus_file_has_drive (file)) {
b0f4880
 		drive = nautilus_file_get_drive (file);
b0f4880
 		*show_eject = eject_for_type (gnome_vfs_drive_get_device_type (drive));
b0f4880
+		if ((gnome_vfs_drive_get_device_type (drive) == GNOME_VFS_DEVICE_TYPE_FLOPPY &&
b0f4880
+		     g_find_program_in_path ("gfloppy")) ||
b0f4880
+		    g_find_program_in_path ("userformat")) {
b0f4880
+			*show_format = TRUE;
b0f4880
+		}
b0f4880
 		if (gnome_vfs_drive_is_mounted (drive)) {
b0f4880
 			*show_unmount = TRUE;
b0f4880
+			*show_format = FALSE;
b0f4880
 		} else {
b0f4880
 			*show_mount = TRUE;
b0f4880
 		}
b0f4880
 
b0f4880
-		if (gnome_vfs_drive_get_device_type (drive) == GNOME_VFS_DEVICE_TYPE_FLOPPY &&
b0f4880
-		    !gnome_vfs_drive_is_mounted (drive) &&
b0f4880
-		    g_find_program_in_path ("gfloppy")) {
b0f4880
-			*show_format = TRUE;
b0f4880
-		}
b0f4880
 	} else if (nautilus_file_is_nautilus_link (file)) {
b0f4880
 		uri = nautilus_file_get_activation_uri (file);
b0f4880
 		if (uri != NULL &&