From 332e1059acc95506afc49bc2d7cf3b43c730f7e7 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 30 Mar 2010 18:33:51 +0200 Subject: [PATCH] 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 --- 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 0997a15..1d867df 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -7775,10 +7775,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; @@ -7798,6 +7794,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; } @@ -7845,10 +7847,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; } @@ -7867,6 +7865,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 95c06eb..6dc2df7 100644 --- a/src/nautilus-places-sidebar.c +++ b/src/nautilus-places-sidebar.c @@ -1317,7 +1317,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; } } @@ -1349,6 +1349,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) { -- 1.7.0