[nautilus] Do not show Unmount when showing Eject/Safe removal



commit add025f7d1502d97062a9fdce8eff85fcd27205e
Author: Martin Pitt <martin pitt ubuntu com>
Date:   Tue Mar 30 18:33:51 2010 +0200

    Do not show Unmount when showing Eject/Safe removal
    
    Having three menu entries (unmount/eject/safe removal) in a volume/drive menu
    entry is too confusing. Unmount only really makes sense for internal drives,
    for external ones it is pretty much a "geek" option. Geeks can use palimpsest
    or "unmount /media/foo" from the CLI if they really want to, for everyone else
    it is just an unintuitive and hard to to explain menu entry.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=598690
    Bug-Ubuntu: https://launchpad.net/bugs/453072
    (cherry picked from commit 0a5cc4c4e5b01eb8aa38dfae926502ce920efc94)

 src/file-manager/fm-directory-view.c |   20 ++++++++++++--------
 src/nautilus-places-sidebar.c        |    5 ++++-
 2 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index f5f6fb5..6096aed 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -7808,10 +7808,6 @@ file_should_show_foreach (NautilusFile        *file,
 		*show_eject = TRUE;
 	}
 
-	if (nautilus_file_can_unmount (file)) {
-		*show_unmount = TRUE;
-	}
-
 	if (nautilus_file_can_mount (file)) {
 		*show_mount = TRUE;
 
@@ -7831,6 +7827,12 @@ file_should_show_foreach (NautilusFile        *file,
 		*show_stop = TRUE;
 	}
 
+	/* Dot not show both Unmount and Eject/Safe Removal; too confusing to
+	 * have too many menu entries */
+	if (nautilus_file_can_unmount (file) && !*show_eject && !*show_stop) {
+		*show_unmount = TRUE;
+	}
+
 	if (nautilus_file_can_poll_for_media (file) && !nautilus_file_is_media_check_automatic (file)) {
 		*show_poll = TRUE;
 	}
@@ -7878,10 +7880,6 @@ file_should_show_self (NautilusFile        *file,
 		*show_eject = TRUE;
 	}
 
-	if (nautilus_file_can_unmount (file)) {
-		*show_unmount = TRUE;
-	}
-
 	if (nautilus_file_can_mount (file)) {
 		*show_mount = TRUE;
 	}
@@ -7900,6 +7898,12 @@ file_should_show_self (NautilusFile        *file,
 		*show_stop = TRUE;
 	}
 
+	/* Dot not show both Unmount and Eject/Safe Removal; too confusing to
+	 * have too many menu entries */
+	if (nautilus_file_can_unmount (file) && !*show_eject && !*show_stop) {
+		*show_unmount = TRUE;
+	}
+
 	if (nautilus_file_can_poll_for_media (file) && !nautilus_file_is_media_check_automatic (file)) {
 		*show_poll = TRUE;
 	}
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index 1683891..f520d01 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -1331,7 +1331,7 @@ check_unmount_and_eject (GMount *mount,
 	}
 	if (mount != NULL) {
 		*show_eject |= g_mount_can_eject (mount);
-		*show_unmount = g_mount_can_unmount (mount);
+		*show_unmount = g_mount_can_unmount (mount) && !*show_eject;
 	}
 }
 
@@ -1363,6 +1363,9 @@ check_visibility (GMount           *mount,
 
 		*show_start = g_drive_can_start (drive) || g_drive_can_start_degraded (drive);
 		*show_stop  = g_drive_can_stop (drive);
+
+		if (*show_stop)
+			*show_unmount = FALSE;
 	}
 
 	if (volume != NULL) {



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