diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-04-11 18:45:38 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-04-11 18:45:38 +0000 |
commit | 16ffc264309aa692ae8b20618a0b9b98cfa371c9 (patch) | |
tree | 22d986ad96ac636626751cfb42462e79b3eb9c11 | |
parent | bca6fc7d2bcc0e5302a3cb7a297ed9f09471529f (diff) | |
download | nautilus-16ffc264309aa692ae8b20618a0b9b98cfa371c9.tar.gz |
Show both unmount and eject in menus. We need to show eject for a lot of
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.
svn path=/trunk/; revision=15176
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | src/file-manager/fm-directory-view.c | 18 | ||||
-rw-r--r-- | src/file-manager/fm-tree-view.c | 10 | ||||
-rw-r--r-- | src/nautilus-places-sidebar.c | 4 |
4 files changed, 28 insertions, 17 deletions
@@ -1,3 +1,16 @@ +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. + 2009-04-09 Cosimo Cecchi <cosimoc@gnome.org> * cut-n-paste-code/libegg/eggsmclient.c: diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 61f2e2442..21171cca3 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -7107,7 +7107,7 @@ file_should_show_foreach (NautilusFile *file, gboolean *show_unmount, gboolean *show_eject, gboolean *show_connect, - gboolean *show_format) + gboolean *show_format) { char *uri; @@ -7119,14 +7119,16 @@ file_should_show_foreach (NautilusFile *file, 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 @@ file_should_show_foreach (NautilusFile *file, *show_connect = TRUE; } g_free (uri); - } + } } static void @@ -7163,13 +7165,15 @@ file_should_show_self (NautilusFile *file, 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; } diff --git a/src/file-manager/fm-tree-view.c b/src/file-manager/fm-tree-view.c index 272c321f9..a256f69ea 100644 --- a/src/file-manager/fm-tree-view.c +++ b/src/file-manager/fm-tree-view.c @@ -732,17 +732,13 @@ button_pressed_callback (GtkTreeView *treeview, GdkEventButton *event, } 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 { diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c index 549a4cd6e..b7d3564a4 100644 --- a/src/nautilus-places-sidebar.c +++ b/src/nautilus-places-sidebar.c @@ -1287,9 +1287,7 @@ check_unmount_and_eject (GMount *mount, } 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); } } |