comparison src/view_file_list.c @ 157:b73743a01384

fixed in-place rename
author nadvornik
date Sun, 16 Dec 2007 22:30:19 +0000
parents 976fba0add7c
children 08ab6367b4e6
comparison
equal deleted inserted replaced
156:dd6dc0a55d3d 157:b73743a01384
107 tpath = gtk_tree_model_get_path(store, iter); 107 tpath = gtk_tree_model_get_path(store, iter);
108 gtk_tree_view_set_cursor(GTK_TREE_VIEW(vfl->listview), tpath, NULL, FALSE); 108 gtk_tree_view_set_cursor(GTK_TREE_VIEW(vfl->listview), tpath, NULL, FALSE);
109 gtk_tree_path_free(tpath); 109 gtk_tree_path_free(tpath);
110 } 110 }
111 111
112
113 static gint vflist_column_idx(ViewFileList *vfl, gint store_idx)
114 {
115 GList *columns, *work;
116 gint i = 0;
117
118 columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(vfl->listview));
119 work = columns;
120 while (work)
121 {
122 GtkTreeViewColumn *column = work->data;
123 if (store_idx == GPOINTER_TO_INT(g_object_get_data (G_OBJECT(column), "column_store_idx")))
124 break;
125 work = work->next;
126 i++;
127 }
128
129 g_list_free(columns);
130 return i;
131 }
132
133
112 /* 134 /*
113 *----------------------------------------------------------------------------- 135 *-----------------------------------------------------------------------------
114 * dnd 136 * dnd
115 *----------------------------------------------------------------------------- 137 *-----------------------------------------------------------------------------
116 */ 138 */
284 { 306 {
285 GtkTreePath *tpath; 307 GtkTreePath *tpath;
286 308
287 tpath = gtk_tree_model_get_path(store, &iter); 309 tpath = gtk_tree_model_get_path(store, &iter);
288 tree_edit_by_path(GTK_TREE_VIEW(vfl->listview), tpath, 310 tree_edit_by_path(GTK_TREE_VIEW(vfl->listview), tpath,
289 FILE_COLUMN_NAME -1, vfl->click_fd->name, 311 vflist_column_idx(vfl, FILE_COLUMN_NAME), vfl->click_fd->name,
290 vflist_row_rename_cb, vfl); 312 vflist_row_rename_cb, vfl);
291 gtk_tree_path_free(tpath); 313 gtk_tree_path_free(tpath);
292 } 314 }
293 return; 315 return;
294 } 316 }