summaryrefslogtreecommitdiffstats
path: root/xfce/xfdesktop/xfdesktop-handle-unmountable-volumes.patch
blob: 36ac40229cba53367077558cc3a1c6c8512982ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
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;
 }