xfdesktop suggestion

Gregoire Gentil gregoire at gentil.com
Fri Aug 18 06:11:47 CEST 2006


OK, I did it: here is the F2 patch. F2 on a single selected icon on the
desktop popups the rename dialog box. I hope that Brian will think that
it makes sense to include it,

Gregoire



--- xfdesktop/src/xfdesktop-file-icon-manager.c	2006-08-18
00:02:36.000000000 -0400
+++ xfdesktop/src/xfdesktop-file-icon-manager.c	2006-08-18
00:07:04.000000000 -0400
@@ -2005,6 +2005,8 @@
 {
     XfdesktopFileIconManager *fmanager =
XFDESKTOP_FILE_ICON_MANAGER(user_data);
     GList *selected;
+    gboolean multi_sel;
+    XfdesktopFileIcon *icon;
     
     switch(evt->keyval) {
         case GDK_Delete:
@@ -2079,6 +2081,18 @@
 
xfdesktop_file_icon_manager_load_removable_media(fmanager);
             xfdesktop_file_icon_manager_load_desktop_folder(fmanager);
             return TRUE;
+
+	  case GDK_F2:
+		selected =
xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
+		g_return_if_fail(selected);
+		if (g_list_length(selected) == 1) {
+		    icon = XFDESKTOP_FILE_ICON(selected->data);
+	            if(xfdesktop_file_icon_can_rename_file(icon)) {
+			xfdesktop_file_icon_menu_rename(NULL,user_data);
+			return TRUE;
+		    }
+		}
+		g_list_free(selected);
     }
     
     return FALSE;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-xfdesktop-F2
Type: application/octet-stream
Size: 1034 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20060818/ea88a3c3/attachment.obj>


More information about the Xfce4-dev mailing list