448e56f
Index: src/file-manager/fm-directory-view.c
448e56f
===================================================================
448e56f
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
448e56f
retrieving revision 1.727
448e56f
diff -u -p -r1.727 fm-directory-view.c
448e56f
--- src/file-manager/fm-directory-view.c	12 Dec 2005 16:59:11 -0000	1.727
448e56f
+++ src/file-manager/fm-directory-view.c	13 Dec 2005 17:10:16 -0000
448e56f
@@ -6192,6 +6192,8 @@ action_format_volume_callback (GtkAction
4c7d8fd
 	GList *selection, *l;
4c7d8fd
 	GnomeVFSDrive *drive;
448e56f
 	FMDirectoryView *view;
4c7d8fd
+        char *device_path;
4c7d8fd
+        char *cmdline;
4c7d8fd
 
4c7d8fd
         view = FM_DIRECTORY_VIEW (data);
448e56f
 	
448e56f
@@ -6201,9 +6203,16 @@ action_format_volume_callback (GtkAction
4c7d8fd
 
4c7d8fd
 		if (nautilus_file_has_drive (file)) {
4c7d8fd
 			drive = nautilus_file_get_drive (file);
4c7d8fd
+			device_path = gnome_vfs_drive_get_device_path (drive);
4c7d8fd
 			if (gnome_vfs_drive_get_device_type (drive) == GNOME_VFS_DEVICE_TYPE_FLOPPY) {
4c7d8fd
-				g_spawn_command_line_async ("gfloppy", NULL);
4c7d8fd
+				cmdline = g_strconcat ("gfloppy ", device_path, NULL);
4c7d8fd
 			}
4c7d8fd
+			else {
4c7d8fd
+				cmdline = g_strconcat ("userformat ", device_path, NULL);
4c7d8fd
+			}
4c7d8fd
+ 			g_spawn_command_line_async (cmdline, NULL);
4c7d8fd
+                        g_free (cmdline);
4c7d8fd
+                        g_free (device_path);
4c7d8fd
 		}
4c7d8fd
 	}	
4c7d8fd
 	nautilus_file_list_free (selection);
448e56f
@@ -6944,15 +6953,17 @@ file_should_show_foreach (NautilusFile *
4c7d8fd
 	} else if (nautilus_file_has_drive (file)) {
4c7d8fd
 		drive = nautilus_file_get_drive (file);
4c7d8fd
 		*show_eject = eject_for_type (gnome_vfs_drive_get_device_type (drive));
4c7d8fd
+                if ((gnome_vfs_drive_get_device_type (drive) == GNOME_VFS_DEVICE_TYPE_FLOPPY &&
4c7d8fd
+                   g_find_program_in_path ("gfloppy")) ||
4c7d8fd
+                   g_find_program_in_path ("userformat")) {
4c7d8fd
+                       *show_format = TRUE;
4c7d8fd
+                }
4c7d8fd
+
4c7d8fd
 		if (gnome_vfs_drive_is_mounted (drive)) {
4c7d8fd
 			*show_unmount = TRUE;
4c7d8fd
+			*show_format = FALSE;
4c7d8fd
 		} else {
4c7d8fd
 			*show_mount = TRUE;
448e56f
-		}
4c7d8fd
-
4c7d8fd
-                if (gnome_vfs_drive_get_device_type (drive) == GNOME_VFS_DEVICE_TYPE_FLOPPY &&
4c7d8fd
-		    g_find_program_in_path ("gfloppy")) {
4c7d8fd
-			*show_format = TRUE;
448e56f
 		}
4c7d8fd
 	} else if (nautilus_file_is_nautilus_link (file)) {
4c7d8fd
 		uri = nautilus_file_get_activation_uri (file);