Author: kelnos Date: 2009-05-23 08:28:23 +0000 (Sat, 23 May 2009) New Revision: 29983
Modified: xfdesktop/branches/xfce_4_6/NEWS xfdesktop/branches/xfce_4_6/src/xfdesktop-volume-icon.c Log: never show 'umount' when ejectable, always show 'eject' if ejectable (bug 5343) Modified: xfdesktop/branches/xfce_4_6/NEWS =================================================================== --- xfdesktop/branches/xfce_4_6/NEWS 2009-05-23 08:28:12 UTC (rev 29982) +++ xfdesktop/branches/xfce_4_6/NEWS 2009-05-23 08:28:23 UTC (rev 29983) @@ -2,7 +2,10 @@ ---------- * Add Catalan and Galician translations of the manual. - * Fix inability to delete broken symlinks on the desktop. + * Fix inability to delete broken symlinks on the desktop (bug 5387). + * Never show 'Unmount' in volume context menus. + * Always show 'Eject' in volume context menus, regardless of whether + or not it's mounted (bug 5343). Xfce 4.6.1 Modified: xfdesktop/branches/xfce_4_6/src/xfdesktop-volume-icon.c =================================================================== --- xfdesktop/branches/xfce_4_6/src/xfdesktop-volume-icon.c 2009-05-23 08:28:12 UTC (rev 29982) +++ xfdesktop/branches/xfce_4_6/src/xfdesktop-volume-icon.c 2009-05-23 08:28:23 UTC (rev 29983) @@ -554,6 +554,7 @@ XfdesktopVolumeIcon *volume_icon = XFDESKTOP_VOLUME_ICON(icon); ThunarVfsVolume *volume = volume_icon->priv->volume; GtkWidget *mi, *img; + gboolean mounted, ejectable; img = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); gtk_widget_show(img); @@ -568,20 +569,11 @@ gtk_widget_show(mi); gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi); - if(thunar_vfs_volume_is_ejectable(volume) - && thunar_vfs_volume_is_mounted(volume)) - { - img = gtk_image_new_from_icon_name("media-eject", GTK_ICON_SIZE_MENU); - gtk_widget_show(img); - mi = gtk_image_menu_item_new_with_mnemonic(_("E_ject Volume")); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(mi), img); - gtk_widget_show(mi); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi); - g_signal_connect(G_OBJECT(mi), "activate", - G_CALLBACK(xfdesktop_volume_icon_menu_eject), - icon); - } else { - if(thunar_vfs_volume_is_mounted(volume)) { + mounted = thunar_vfs_volume_is_mounted(volume); + ejectable = thunar_vfs_volume_is_ejectable(volume); + + if(!mounted || (mounted && !ejectable)) { + if(mounted) { img = gtk_image_new_from_stock(GTK_STOCK_DISCONNECT, GTK_ICON_SIZE_MENU); mi = gtk_image_menu_item_new_with_mnemonic(_("_Unmount Volume")); } else { @@ -596,11 +588,23 @@ G_CALLBACK(xfdesktop_volume_icon_menu_toggle_mount), icon); } - + + if(ejectable) { + img = gtk_image_new_from_icon_name("media-eject", GTK_ICON_SIZE_MENU); + gtk_widget_show(img); + mi = gtk_image_menu_item_new_with_mnemonic(_("E_ject Volume")); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(mi), img); + gtk_widget_show(mi); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi); + g_signal_connect(G_OBJECT(mi), "activate", + G_CALLBACK(xfdesktop_volume_icon_menu_eject), + icon); + } + mi = gtk_separator_menu_item_new(); gtk_widget_show(mi); gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi); - + img = gtk_image_new_from_stock(GTK_STOCK_PROPERTIES, GTK_ICON_SIZE_MENU); gtk_widget_show(img); mi = gtk_image_menu_item_new_with_mnemonic(_("_Properties...")); _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits