diff options
author | Thierry N <thierryn1 at hispeed dot ch> | 2009-08-21 23:11:17 +0200 |
---|---|---|
committer | Thierry N <thierryn1 at hispeed dot ch> | 2009-08-21 23:11:17 +0200 |
commit | 87e6940a18a535b95b23dea0c642f1eae85d696d (patch) | |
tree | 7c9901afed64530b7f002010a2f287cee748c417 /xfce/xfdesktop/xfdesktop-handle-unmountable-volumes.patch | |
parent | 65827df6753a937a4753a0c5519139f0c19f02ac (diff) | |
download | nutyx-pakxe-87e6940a18a535b95b23dea0c642f1eae85d696d.tar.gz nutyx-pakxe-87e6940a18a535b95b23dea0c642f1eae85d696d.tar.bz2 nutyx-pakxe-87e6940a18a535b95b23dea0c642f1eae85d696d.tar.xz nutyx-pakxe-87e6940a18a535b95b23dea0c642f1eae85d696d.zip |
Ajout de xfdesktop#4.6.1-2
Diffstat (limited to 'xfce/xfdesktop/xfdesktop-handle-unmountable-volumes.patch')
-rwxr-xr-x | xfce/xfdesktop/xfdesktop-handle-unmountable-volumes.patch | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/xfce/xfdesktop/xfdesktop-handle-unmountable-volumes.patch b/xfce/xfdesktop/xfdesktop-handle-unmountable-volumes.patch new file mode 100755 index 000000000..36ac40229 --- /dev/null +++ b/xfce/xfdesktop/xfdesktop-handle-unmountable-volumes.patch @@ -0,0 +1,154 @@ +diff -rNaud xfdesktop-SVN29407-orig/src/xfdesktop-volume-icon.c xfdesktop-SVN29407/src/xfdesktop-volume-icon.c +--- xfdesktop-SVN29407-orig/src/xfdesktop-volume-icon.c 2009-01-29 21:29:52.000000000 +0100 ++++ xfdesktop-SVN29407/src/xfdesktop-volume-icon.c 2009-02-01 15:23:22.000000000 +0100 +@@ -505,17 +505,6 @@ + else + thunar_vfs_volume_mount(icon->priv->volume, toplevel, &error); + +- if(error) { +- gchar *primary = g_markup_printf_escaped(is_mount ? _("Unable to mount \"%s\":") +- : _("Unable to unmount \"%s\":"), +- thunar_vfs_volume_get_name(icon->priv->volume)); +- xfce_message_dialog(toplevel ? GTK_WINDOW(toplevel) : NULL, +- is_mount ? _("Mount Failed") : _("Unmount Failed"), +- GTK_STOCK_DIALOG_ERROR, primary, error->message, +- GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT, NULL); +- g_free(primary); +- g_error_free(error); +- } + } + + static void +@@ -555,35 +544,41 @@ + ThunarVfsVolume *volume = volume_icon->priv->volume; + GtkWidget *mi, *img; + +- img = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); +- gtk_widget_show(img); +- mi = gtk_image_menu_item_new_with_mnemonic(_("_Open")); +- 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_swapped(G_OBJECT(mi), "activate", +- G_CALLBACK(xfdesktop_icon_activated), icon); +- +- mi = gtk_separator_menu_item_new(); +- 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)) { +- img = gtk_image_new_from_stock(GTK_STOCK_DISCONNECT, GTK_ICON_SIZE_MENU); +- mi = gtk_image_menu_item_new_with_mnemonic(_("_Unmount Volume")); ++ if(thunar_vfs_volume_is_mountable(volume)) ++ { ++ ++ img = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); ++ gtk_widget_show(img); ++ mi = gtk_image_menu_item_new_with_mnemonic(_("_Open")); ++ 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_swapped(G_OBJECT(mi), "activate", ++ G_CALLBACK(xfdesktop_icon_activated), icon); ++ ++ mi = gtk_separator_menu_item_new(); ++ gtk_widget_show(mi); ++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi); ++ ++ if(thunar_vfs_volume_is_mounted(volume)) ++ { ++ if(thunar_vfs_volume_is_ejectable(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 ++ { ++ img = gtk_image_new_from_stock(GTK_STOCK_DISCONNECT, GTK_ICON_SIZE_MENU); ++ mi = gtk_image_menu_item_new_with_mnemonic(_("_Unmount Volume")); ++ } + } else { + img = gtk_image_new_from_stock(GTK_STOCK_CONNECT, GTK_ICON_SIZE_MENU); + mi = gtk_image_menu_item_new_with_mnemonic(_("_Mount Volume")); +@@ -595,26 +590,41 @@ + g_signal_connect(G_OBJECT(mi), "activate", + G_CALLBACK(xfdesktop_volume_icon_menu_toggle_mount), + 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...")); +- 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); +- if(!volume_icon->priv->info) +- gtk_widget_set_sensitive(mi, FALSE); +- else { +- g_signal_connect(G_OBJECT(mi), "activate", +- G_CALLBACK(xfdesktop_volume_icon_menu_properties), +- 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...")); ++ 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); ++ if(!volume_icon->priv->info) ++ gtk_widget_set_sensitive(mi, FALSE); ++ else { ++ g_signal_connect(G_OBJECT(mi), "activate", ++ G_CALLBACK(xfdesktop_volume_icon_menu_properties), ++ icon); ++ } ++ } ++ else ++ { ++ if(thunar_vfs_volume_is_ejectable(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); ++ } ++ } ++ + return TRUE; + } + |