diff -Naur xfdesktop-4.10.0_orig/po/en_GB.po xfdesktop-4.10.0/po/en_GB.po --- xfdesktop-4.10.0_orig/po/en_GB.po 2012-04-28 23:53:05.000000000 +0300 +++ xfdesktop-4.10.0/po/en_GB.po 2012-07-24 12:56:49.000000000 +0300 @@ -1023,6 +1023,10 @@ msgid "E_ject Volume" msgstr "E_ject Volume" +#: ../src/xfdesktop-volume-icon.c:703 ../src/xfdesktop-volume-icon.c:706 +msgid "_Unmount Volume" +msgstr "_Unmount Volume" + #: ../src/xfdesktop-volume-icon.c:713 msgid "_Mount Volume" msgstr "_Mount Volume" @@ -1353,9 +1357,6 @@ #~ msgid "Unable to eject \"%s\":" #~ msgstr "Unable to eject \"%s\":" -#~ msgid "_Unmount Volume" -#~ msgstr "_Unmount Volume" - #~ msgid "Accessories" #~ msgstr "Accessories" diff -Naur xfdesktop-4.10.0_orig/po/ru.po xfdesktop-4.10.0/po/ru.po --- xfdesktop-4.10.0_orig/po/ru.po 2012-04-28 23:53:05.000000000 +0300 +++ xfdesktop-4.10.0/po/ru.po 2012-07-24 12:58:28.000000000 +0300 @@ -1034,6 +1034,10 @@ msgid "E_ject Volume" msgstr "_Извлечь том" +#: ../src/xfdesktop-volume-icon.c:703 ../src/xfdesktop-volume-icon.c:706 +msgid "_Unmount Volume" +msgstr "О_тключить том" + #: ../src/xfdesktop-volume-icon.c:717 msgid "_Mount Volume" msgstr "_Подключить том" diff -Naur xfdesktop-4.10.0_orig/src/xfdesktop-volume-icon.c xfdesktop-4.10.0/src/xfdesktop-volume-icon.c --- xfdesktop-4.10.0_orig/src/xfdesktop-volume-icon.c 2012-04-28 23:53:05.000000000 +0300 +++ xfdesktop-4.10.0/src/xfdesktop-volume-icon.c 2012-07-24 12:54:34.000000000 +0300 @@ -613,6 +613,33 @@ } } + +static void +xfdesktop_volume_icon_menu_unmount(GtkWidget *widget, + gpointer user_data) +{ + XfdesktopVolumeIcon *icon = XFDESKTOP_VOLUME_ICON(user_data); + GtkWidget *icon_view = xfdesktop_icon_peek_icon_view(XFDESKTOP_ICON(icon)); + GtkWidget *toplevel = gtk_widget_get_toplevel(icon_view); + GVolume *volume; + GMount *mount; + + volume = xfdesktop_volume_icon_peek_volume(icon); + mount = g_volume_get_mount(volume); + + if(mount) { +#ifdef HAVE_LIBNOTIFY + xfdesktop_notify_unmount(mount); +#endif + /* TODO: GMountOperation could be used to show what processes + * are preventing an unmount. */ + g_mount_unmount_with_operation(mount, G_MOUNT_UNMOUNT_NONE, + NULL, NULL, + xfdesktop_volume_icon_unmount_finish, + g_object_ref(icon)); + } +} + static void xfdesktop_volume_icon_menu_toggle_mount(GtkWidget *widget, gpointer user_data) @@ -622,7 +649,7 @@ GtkWidget *toplevel = gtk_widget_get_toplevel(icon_view); GVolume *volume; GMount *mount; - + volume = xfdesktop_volume_icon_peek_volume(icon); mount = g_volume_get_mount(volume); @@ -718,6 +745,13 @@ } } + if(xfdesktop_file_utils_volume_is_removable(volume) && mount) { + mi = gtk_image_menu_item_new_with_mnemonic (_("_Unmount Volume")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi); + gtk_widget_show (mi); + g_signal_connect(G_OBJECT (mi), "activate", G_CALLBACK (xfdesktop_volume_icon_menu_unmount), icon); + } + if(xfdesktop_file_utils_volume_is_removable(volume) && icon_label) { img = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_MENU); gtk_widget_show(img);