From f026e09735b1d9f14c34b7437f080c6f37c530b9 Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann <jannis@xfce.org> Date: Mon, 10 Jan 2011 22:30:01 +0100 Subject: [PATCH] Only show the eject context menu action when the volume is present. --- NEWS | 2 ++ thunar/thunar-shortcuts-view.c | 6 +++--- thunar/thunar-tree-view.c | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index d42d5e523..6d0bd61b4 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ 1.1.x ===== - Properly try alternative names when creating links (bug #6867). +- Only show the "Eject Volume" context menu action when the volume is + present. 1.1.6 ===== diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c index 8ef7cddc9..17e712d63 100644 --- a/thunar/thunar-shortcuts-view.c +++ b/thunar/thunar-shortcuts-view.c @@ -1,7 +1,7 @@ /* vi:set et ai sw=2 sts=2 ts=2: */ /*- * Copyright (c) 2005-2007 Benedikt Meurer <benny@xfce.org> - * Copyright (c) 2009-2010 Jannis Pohlmann <jannis@xfce.org> + * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -854,8 +854,8 @@ thunar_shortcuts_view_context_menu (ThunarShortcutsView *view, gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); - /* check if the volume is ejectable */ - if (thunar_g_volume_is_removable (volume)) + /* check if the volume is present and can be ejected */ + if (thunar_g_volume_is_present (volume) && thunar_g_volume_is_removable (volume)) { /* append the "Eject Volume" menu action */ item = gtk_image_menu_item_new_with_mnemonic (_("E_ject Volume")); diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index 532385fb0..76d66f8ca 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -1,7 +1,7 @@ /* vi:set et ai sw=2 sts=2 ts=2: */ /*- * Copyright (c) 2006 Benedikt Meurer <benny@xfce.org> - * Copyright (c) 2009-2010 Jannis Pohlmann <jannis@xfce.org> + * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -1124,8 +1124,8 @@ thunar_tree_view_context_menu (ThunarTreeView *view, gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); - /* check if the volume is ejectable */ - if (thunar_g_volume_is_removable (volume)) + /* check if the volume is present and can be ejected */ + if (thunar_g_volume_is_present (volume) && thunar_g_volume_is_removable (volume)) { /* append the "Eject Volume" menu action */ item = gtk_image_menu_item_new_with_mnemonic (_("E_ject Volume")); -- GitLab