Tomas Bzatek 2d9e665
From 9bdd0ef925a1e660031917746f8914a38e352576 Mon Sep 17 00:00:00 2001
Tomas Bzatek 2d9e665
From: Martin Pitt <martin.pitt@ubuntu.com>
Tomas Bzatek 2d9e665
Date: Tue, 30 Mar 2010 16:33:51 +0000
Tomas Bzatek 2d9e665
Subject: Do not show Unmount when showing Eject/Safe removal
Tomas Bzatek 2d9e665
Tomas Bzatek 2d9e665
Having three menu entries (unmount/eject/safe removal) in a volume/drive menu
Tomas Bzatek 2d9e665
entry is too confusing. Unmount only really makes sense for internal drives,
Tomas Bzatek 2d9e665
for external ones it is pretty much a "geek" option. Geeks can use palimpsest
Tomas Bzatek 2d9e665
or "unmount /media/foo" from the CLI if they really want to, for everyone else
Tomas Bzatek 2d9e665
it is just an unintuitive and hard to to explain menu entry.
Tomas Bzatek 2d9e665
Tomas Bzatek 2d9e665
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=598690
Tomas Bzatek 2d9e665
Bug-Ubuntu: https://launchpad.net/bugs/453072
Tomas Bzatek 2d9e665
(cherry picked from commit 0a5cc4c4e5b01eb8aa38dfae926502ce920efc94)
Tomas Bzatek 2d9e665
---
Tomas Bzatek 2d9e665
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
Tomas Bzatek 2d9e665
index d8b9050..361b994 100644
Tomas Bzatek 2d9e665
--- a/src/file-manager/fm-directory-view.c
Tomas Bzatek 2d9e665
+++ b/src/file-manager/fm-directory-view.c
Tomas Bzatek 2d9e665
@@ -7782,10 +7782,6 @@ file_should_show_foreach (NautilusFile        *file,
Tomas Bzatek 2d9e665
 		*show_eject = TRUE;
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
 
Tomas Bzatek 2d9e665
-	if (nautilus_file_can_unmount (file)) {
Tomas Bzatek 2d9e665
-		*show_unmount = TRUE;
Tomas Bzatek 2d9e665
-	}
Tomas Bzatek 2d9e665
-
Tomas Bzatek 2d9e665
 	if (nautilus_file_can_mount (file)) {
Tomas Bzatek 2d9e665
 		*show_mount = TRUE;
Tomas Bzatek 2d9e665
 
Tomas Bzatek 2d9e665
@@ -7805,6 +7801,12 @@ file_should_show_foreach (NautilusFile        *file,
Tomas Bzatek 2d9e665
 		*show_stop = TRUE;
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
 
Tomas Bzatek 2d9e665
+	/* Dot not show both Unmount and Eject/Safe Removal; too confusing to
Tomas Bzatek 2d9e665
+	 * have too many menu entries */
Tomas Bzatek 2d9e665
+	if (nautilus_file_can_unmount (file) && !*show_eject && !*show_stop) {
Tomas Bzatek 2d9e665
+		*show_unmount = TRUE;
Tomas Bzatek 2d9e665
+	}
Tomas Bzatek 2d9e665
+
Tomas Bzatek 2d9e665
 	if (nautilus_file_can_poll_for_media (file) && !nautilus_file_is_media_check_automatic (file)) {
Tomas Bzatek 2d9e665
 		*show_poll = TRUE;
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
@@ -7852,10 +7854,6 @@ file_should_show_self (NautilusFile        *file,
Tomas Bzatek 2d9e665
 		*show_eject = TRUE;
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
 
Tomas Bzatek 2d9e665
-	if (nautilus_file_can_unmount (file)) {
Tomas Bzatek 2d9e665
-		*show_unmount = TRUE;
Tomas Bzatek 2d9e665
-	}
Tomas Bzatek 2d9e665
-
Tomas Bzatek 2d9e665
 	if (nautilus_file_can_mount (file)) {
Tomas Bzatek 2d9e665
 		*show_mount = TRUE;
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
@@ -7874,6 +7872,12 @@ file_should_show_self (NautilusFile        *file,
Tomas Bzatek 2d9e665
 		*show_stop = TRUE;
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
 
Tomas Bzatek 2d9e665
+	/* Dot not show both Unmount and Eject/Safe Removal; too confusing to
Tomas Bzatek 2d9e665
+	 * have too many menu entries */
Tomas Bzatek 2d9e665
+	if (nautilus_file_can_unmount (file) && !*show_eject && !*show_stop) {
Tomas Bzatek 2d9e665
+		*show_unmount = TRUE;
Tomas Bzatek 2d9e665
+	}
Tomas Bzatek 2d9e665
+
Tomas Bzatek 2d9e665
 	if (nautilus_file_can_poll_for_media (file) && !nautilus_file_is_media_check_automatic (file)) {
Tomas Bzatek 2d9e665
 		*show_poll = TRUE;
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
Tomas Bzatek 2d9e665
index 95c06eb..6dc2df7 100644
Tomas Bzatek 2d9e665
--- a/src/nautilus-places-sidebar.c
Tomas Bzatek 2d9e665
+++ b/src/nautilus-places-sidebar.c
Tomas Bzatek 2d9e665
@@ -1317,7 +1317,7 @@ check_unmount_and_eject (GMount *mount,
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
 	if (mount != NULL) {
Tomas Bzatek 2d9e665
 		*show_eject |= g_mount_can_eject (mount);
Tomas Bzatek 2d9e665
-		*show_unmount = g_mount_can_unmount (mount);
Tomas Bzatek 2d9e665
+		*show_unmount = g_mount_can_unmount (mount) && !*show_eject;
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
 }
Tomas Bzatek 2d9e665
 
Tomas Bzatek 2d9e665
@@ -1349,6 +1349,9 @@ check_visibility (GMount           *mount,
Tomas Bzatek 2d9e665
 
Tomas Bzatek 2d9e665
 		*show_start = g_drive_can_start (drive) || g_drive_can_start_degraded (drive);
Tomas Bzatek 2d9e665
 		*show_stop  = g_drive_can_stop (drive);
Tomas Bzatek 2d9e665
+
Tomas Bzatek 2d9e665
+		if (*show_stop)
Tomas Bzatek 2d9e665
+			*show_unmount = FALSE;
Tomas Bzatek 2d9e665
 	}
Tomas Bzatek 2d9e665
 
Tomas Bzatek 2d9e665
 	if (volume != NULL) {
Tomas Bzatek 2d9e665
--
Tomas Bzatek 2d9e665
cgit v0.8.3.1