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