nautilus r15176 - in trunk: . src src/file-manager



Author: alexl
Date: Sat Apr 11 18:45:38 2009
New Revision: 15176
URL: http://svn.gnome.org/viewvc/nautilus?rev=15176&view=rev

Log:
2009-04-11  Alexander Larsson  <alexl redhat com>

	* src/file-manager/fm-directory-view.c:
	* src/file-manager/fm-tree-view.c:
	* src/nautilus-places-sidebar.c:
	Show both unmount and eject in menus. We need to show eject for
	a lot of devices (that we can't detect ahead of time) so we're
	enabling it much more generally. However, eject sometimes does
	things you don't want (like unmounting all volumes on a drive),
	so we also need to expose unmount.

	For discussion, see bug 574067 and bug 576587.



Modified:
   trunk/ChangeLog
   trunk/src/file-manager/fm-directory-view.c
   trunk/src/file-manager/fm-tree-view.c
   trunk/src/nautilus-places-sidebar.c

Modified: trunk/src/file-manager/fm-directory-view.c
==============================================================================
--- trunk/src/file-manager/fm-directory-view.c	(original)
+++ trunk/src/file-manager/fm-directory-view.c	Sat Apr 11 18:45:38 2009
@@ -7107,7 +7107,7 @@
 			  gboolean     *show_unmount,
 			  gboolean     *show_eject,
 			  gboolean     *show_connect,
-                          gboolean     *show_format)
+			  gboolean     *show_format)
 {
 	char *uri;
 
@@ -7119,14 +7119,16 @@
 
 	if (nautilus_file_can_eject (file)) {
 		*show_eject = TRUE;
-	} else if (nautilus_file_can_unmount (file)) {
+	}
+
+	if (nautilus_file_can_unmount (file)) {
 		*show_unmount = TRUE;
 	}
 
 	if (nautilus_file_can_mount (file)) {
 		*show_mount = TRUE;
 
-#ifdef TODO_GIO		
+#ifdef TODO_GIO
 		if (something &&
 		    g_find_program_in_path ("gfloppy")) {
 			*show_format = TRUE;
@@ -7145,7 +7147,7 @@
 			*show_connect = TRUE;
 		}
 		g_free (uri);
-	} 
+	}
 }
 
 static void
@@ -7163,13 +7165,15 @@
 	if (file == NULL) {
 		return;
 	}
-	
+
 	if (nautilus_file_can_eject (file)) {
 		*show_eject = TRUE;
-	} else if (nautilus_file_can_unmount (file)) {
+	}
+
+	if (nautilus_file_can_unmount (file)) {
 		*show_unmount = TRUE;
 	}
-	
+
 	if (nautilus_file_can_mount (file)) {
 		*show_mount = TRUE;
 	}

Modified: trunk/src/file-manager/fm-tree-view.c
==============================================================================
--- trunk/src/file-manager/fm-tree-view.c	(original)
+++ trunk/src/file-manager/fm-tree-view.c	Sat Apr 11 18:45:38 2009
@@ -732,17 +732,13 @@
 		} else {
 			gtk_widget_hide (view->details->popup_delete);
 		}
-		
+
 		mount = fm_tree_model_get_mount_for_root_node_file (view->details->child_model, view->details->popup_file);
 		if (mount) {
-			/* TODO: show both unmount and eject if there are more than one volume for the drive */
 			show_unmount = g_mount_can_unmount (mount);
 			show_eject = g_mount_can_eject (mount);
-			if (show_eject) {
-				show_unmount = FALSE;
-			}
-		} 
-		
+		}
+
 		if (show_unmount) {
 			gtk_widget_show (view->details->popup_unmount);
 		} else {

Modified: trunk/src/nautilus-places-sidebar.c
==============================================================================
--- trunk/src/nautilus-places-sidebar.c	(original)
+++ trunk/src/nautilus-places-sidebar.c	Sat Apr 11 18:45:38 2009
@@ -1287,9 +1287,7 @@
 	}
 	if (mount != NULL) {
 		*show_eject |= g_mount_can_eject (mount);
-		if (!*show_eject) {
-			*show_unmount = g_mount_can_unmount (mount);
-		}
+		*show_unmount = g_mount_can_unmount (mount);
 	}
 }
 



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