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
This commit is contained in:
Alexander Larsson 2009-04-11 18:45:38 +00:00 committed by Alexander Larsson
parent bca6fc7d2b
commit 16ffc26430
4 changed files with 28 additions and 17 deletions

View file

@ -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:

View file

@ -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;
}

View file

@ -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 {

View file

@ -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);
}
}