annotate src/view_dir_list.c @ 785:548b193c084c

Use uft8_collate_key() to sort utf8 strings. Modify file_data_set_path() to sync collate keys and file_data_pool on path change. Partially fix bug 1959854.
author zas_
date Thu, 05 Jun 2008 08:41:02 +0000
parents d6a7fb4b8e7c
children ee33d2ddb661
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 138
diff changeset
2 * Geeqie
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
475
48c8e49b571c updated copyright in source files
nadvornik
parents: 448
diff changeset
4 * Copyright (C) 2008 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 250
diff changeset
13 #include "main.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #include "view_dir_list.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 #include "dnd.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17 #include "dupe.h"
586
905688aa2317 split filelist.c to filefilter.c and filedata.c
nadvornik
parents: 475
diff changeset
18 #include "filedata.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 #include "layout.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 #include "layout_image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 #include "layout_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 #include "utilops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 #include "ui_bookmark.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 #include "ui_fileops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 #include "ui_menu.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #include "ui_tree_edit.h"
380
5afe77bb563a Introduce a new struct ViewDir to handle directory views common
zas_
parents: 373
diff changeset
27 #include "view_dir.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29 #include <gdk/gdkkeysyms.h> /* for keyboard values */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31
380
5afe77bb563a Introduce a new struct ViewDir to handle directory views common
zas_
parents: 373
diff changeset
32 #define VDLIST_INFO(_vd_, _part_) (((ViewDirInfoList *)(_vd_->info))->_part_)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37 * misc
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40
383
499d7ba62261 Move some dnd common code from view_dir_list.c and view_dir_tree.c
zas_
parents: 381
diff changeset
41 gint vdlist_find_row(ViewDir *vd, FileData *fd, GtkTreeIter *iter)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 GtkTreeModel *store;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 gint valid;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 gint row = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
47 store = gtk_tree_view_get_model(GTK_TREE_VIEW(vd->view));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 valid = gtk_tree_model_get_iter_first(store, iter);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49 while (valid)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 FileData *fd_n;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52 gtk_tree_model_get(GTK_TREE_MODEL(store), iter, DIR_COLUMN_POINTER, &fd_n, -1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53 if (fd_n == fd) return row;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(store), iter);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56 row++;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 return -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
61
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62
388
5186f8e38cb8 Make directory view popup menu common and move it to view_dir.{c,h}.
zas_
parents: 385
diff changeset
63 FileData *vdlist_row_by_path(ViewDir *vd, const gchar *path, gint *row)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66 gint n;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 if (!path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70 if (row) *row = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71 return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 n = 0;
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
75 work = VDLIST_INFO(vd, list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 FileData *fd = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79 if (strcmp(fd->path, path) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81 if (row) *row = n;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82 return fd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85 n++;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88 if (row) *row = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89 return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94 * dnd
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
97
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
98 static void vdlist_scroll_to_row(ViewDir *vd, FileData *fd, gfloat y_align)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100 GtkTreeIter iter;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
101
394
4a5e1377f3d7 Merge dirlist/dirview dnd code.
zas_
parents: 389
diff changeset
102 if (GTK_WIDGET_REALIZED(vd->view) && vd_find_row(vd, fd, &iter) >= 0)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
103 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
104 GtkTreeModel *store;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
105 GtkTreePath *tpath;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
106
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
107 store = gtk_tree_view_get_model(GTK_TREE_VIEW(vd->view));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
108 tpath = gtk_tree_model_get_path(store, &iter);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
109 gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(vd->view), tpath, NULL, TRUE, y_align, 0.0);
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
110 gtk_tree_view_set_cursor(GTK_TREE_VIEW(vd->view), tpath, NULL, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
111 gtk_tree_path_free(tpath);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
112
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
113 if (!GTK_WIDGET_HAS_FOCUS(vd->view)) gtk_widget_grab_focus(vd->view);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
114 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
115 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
116
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
117 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
119 * main
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
120 *-----------------------------------------------------------------------------
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 406
diff changeset
121 */
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122
396
a01535f52b56 Merge few more functions to view_dir.c.
zas_
parents: 395
diff changeset
123 void vdlist_select_row(ViewDir *vd, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
124 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
125 if (fd && vd->select_func)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
126 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
127 gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
128
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
129 path = g_strdup(fd->path);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
130 vd->select_func(vd, path, vd->select_data);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
131 g_free(path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
132 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
133 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
134
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
135 const gchar *vdlist_row_get_path(ViewDir *vd, gint row)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
136 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
137 FileData *fd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
138
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
139 fd = g_list_nth_data(VDLIST_INFO(vd, list), row);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
140
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
141 if (fd) return fd->path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
142
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
143 return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
144 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
145
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
146 static void vdlist_populate(ViewDir *vd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
147 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
148 GtkListStore *store;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
149 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
150
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
151 store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(vd->view)));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
152 gtk_list_store_clear(store);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
153
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
154 work = VDLIST_INFO(vd, list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
155 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
156 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
157 FileData *fd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
158 GtkTreeIter iter;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
159 GdkPixbuf *pixbuf;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
160
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
161 fd = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
162
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
163 if (access_file(fd->path, R_OK | X_OK) && fd->name)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
164 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
165 if (fd->name[0] == '.' && fd->name[1] == '\0')
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
166 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
167 pixbuf = vd->pf->open;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
168 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
169 else if (fd->name[0] == '.' && fd->name[1] == '.' && fd->name[2] == '\0')
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
170 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
171 pixbuf = vd->pf->parent;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
172 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
173 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
174 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
175 pixbuf = vd->pf->close;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
176 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
177 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
178 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
179 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
180 pixbuf = vd->pf->deny;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
181 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
182
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
183 gtk_list_store_append(store, &iter);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
184 gtk_list_store_set(store, &iter,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
185 DIR_COLUMN_POINTER, fd,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
186 DIR_COLUMN_ICON, pixbuf,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
187 DIR_COLUMN_NAME, fd->name, -1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
188
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
189 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
190 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
191
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
192 vd->click_fd = NULL;
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
193 vd->drop_fd = NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
194 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
195
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
196 gint vdlist_set_fd(ViewDir *vd, FileData *dir_fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
197 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
198 gint ret;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
199 FileData *fd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
200 gchar *old_path = NULL;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 112
diff changeset
201 gchar *filepath;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
202
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
203 if (!dir_fd) return FALSE;
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
204 if (vd->dir_fd == dir_fd) return TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
205
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
206 if (vd->dir_fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
207 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
208 gchar *base;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
209
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
210 base = remove_level_from_path(vd->dir_fd->path);
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
211 if (strcmp(base, dir_fd->path) == 0)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
212 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
213 old_path = g_strdup(vd->dir_fd->name);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
214 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
215 g_free(base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
216 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
217
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
218 file_data_unref(vd->dir_fd);
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
219 vd->dir_fd = file_data_ref(dir_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
220
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
221 filelist_free(VDLIST_INFO(vd, list));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
222
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
223 ret = filelist_read(vd->dir_fd, NULL, &VDLIST_INFO(vd, list));
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
224 VDLIST_INFO(vd, list) = filelist_sort(VDLIST_INFO(vd, list), SORT_NAME, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
225
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
226 /* add . and .. */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
227
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
228 if (strcmp(vd->dir_fd->path, G_DIR_SEPARATOR_S) != 0)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
229 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
230 filepath = g_build_filename(vd->dir_fd->path, "..", NULL);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 112
diff changeset
231 fd = file_data_new_simple(filepath);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
232 VDLIST_INFO(vd, list) = g_list_prepend(VDLIST_INFO(vd, list), fd);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 112
diff changeset
233 g_free(filepath);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
234 }
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 406
diff changeset
235
373
61a3c8b05b24 Add a new option in Preferences > Filtering to allow the
zas_
parents: 356
diff changeset
236 if (options->file_filter.show_dot_directory)
61a3c8b05b24 Add a new option in Preferences > Filtering to allow the
zas_
parents: 356
diff changeset
237 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
238 filepath = g_build_filename(vd->dir_fd->path, ".", NULL);
373
61a3c8b05b24 Add a new option in Preferences > Filtering to allow the
zas_
parents: 356
diff changeset
239 fd = file_data_new_simple(filepath);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
240 VDLIST_INFO(vd, list) = g_list_prepend(VDLIST_INFO(vd, list), fd);
373
61a3c8b05b24 Add a new option in Preferences > Filtering to allow the
zas_
parents: 356
diff changeset
241 g_free(filepath);
61a3c8b05b24 Add a new option in Preferences > Filtering to allow the
zas_
parents: 356
diff changeset
242 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
243
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
244 vdlist_populate(vd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
245
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
246 if (old_path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
247 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
248 /* scroll to make last path visible */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
249 FileData *found = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
250 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
251
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
252 work = VDLIST_INFO(vd, list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
253 while (work && !found)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
254 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
255 FileData *fd = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
256 if (strcmp(old_path, fd->name) == 0) found = fd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
257 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
258 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
259
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
260 if (found) vdlist_scroll_to_row(vd, found, 0.5);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
261
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
262 g_free(old_path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
263 return ret;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
264 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
265
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
266 if (GTK_WIDGET_REALIZED(vd->view))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
267 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
268 gtk_tree_view_scroll_to_point(GTK_TREE_VIEW(vd->view), 0, 0);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
269 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
270
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
271 return ret;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
272 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
273
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
274 void vdlist_refresh(ViewDir *vd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
275 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
276 FileData *dir_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
277
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
278 dir_fd = vd->dir_fd;
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
279 vd->dir_fd = NULL;
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
280 vdlist_set_fd(vd, dir_fd);
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
281 file_data_unref(dir_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
282 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
283
401
0a2e1b130a25 Add some wrappers in view_dir.c and simplify even more.
zas_
parents: 397
diff changeset
284 gint vdlist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
285 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
286 ViewDir *vd = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
287 GtkTreePath *tpath;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 406
diff changeset
288
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
289 if (event->keyval != GDK_Menu) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
290
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
291 gtk_tree_view_get_cursor(GTK_TREE_VIEW(vd->view), &tpath, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
292 if (tpath)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
293 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
294 GtkTreeModel *store;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
295 GtkTreeIter iter;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
296
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
297 store = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
298 gtk_tree_model_get_iter(store, &iter, tpath);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
299 gtk_tree_model_get(store, &iter, DIR_COLUMN_POINTER, &vd->click_fd, -1);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 406
diff changeset
300
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
301 gtk_tree_path_free(tpath);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
302 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
303 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
304 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
305 vd->click_fd = NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
306 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
307
383
499d7ba62261 Move some dnd common code from view_dir_list.c and view_dir_tree.c
zas_
parents: 381
diff changeset
308 vd_color_set(vd, vd->click_fd, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
309
388
5186f8e38cb8 Make directory view popup menu common and move it to view_dir.{c,h}.
zas_
parents: 385
diff changeset
310 vd->popup = vd_pop_menu(vd, vd->click_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
311
395
c359fc2c5a1f Move common menu position callback to view_dir.c.
zas_
parents: 394
diff changeset
312 gtk_menu_popup(GTK_MENU(vd->popup), NULL, NULL, vd_menu_position_cb, vd, 0, GDK_CURRENT_TIME);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
313
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
314 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
315 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
316
401
0a2e1b130a25 Add some wrappers in view_dir.c and simplify even more.
zas_
parents: 397
diff changeset
317 gint vdlist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
318 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
319 ViewDir *vd = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
320 GtkTreePath *tpath;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
321 GtkTreeIter iter;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
322 FileData *fd = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
323
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
324 if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget), bevent->x, bevent->y,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
325 &tpath, NULL, NULL, NULL))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
326 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
327 GtkTreeModel *store;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
328
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
329 store = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
330 gtk_tree_model_get_iter(store, &iter, tpath);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
331 gtk_tree_model_get(store, &iter, DIR_COLUMN_POINTER, &fd, -1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
332 gtk_tree_view_set_cursor(GTK_TREE_VIEW(widget), tpath, NULL, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
333 gtk_tree_path_free(tpath);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
334 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
335
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
336 vd->click_fd = fd;
383
499d7ba62261 Move some dnd common code from view_dir_list.c and view_dir_tree.c
zas_
parents: 381
diff changeset
337 vd_color_set(vd, vd->click_fd, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
338
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 442
diff changeset
339 if (bevent->button == MOUSE_BUTTON_RIGHT)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
340 {
388
5186f8e38cb8 Make directory view popup menu common and move it to view_dir.{c,h}.
zas_
parents: 385
diff changeset
341 vd->popup = vd_pop_menu(vd, vd->click_fd);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
342 gtk_menu_popup(GTK_MENU(vd->popup), NULL, NULL, NULL, NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
343 bevent->button, bevent->time);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
344 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
345
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
346 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
347 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
348
401
0a2e1b130a25 Add some wrappers in view_dir.c and simplify even more.
zas_
parents: 397
diff changeset
349 void vdlist_destroy_cb(GtkWidget *widget, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
350 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
351 ViewDir *vd = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
352
394
4a5e1377f3d7 Merge dirlist/dirview dnd code.
zas_
parents: 389
diff changeset
353 vd_dnd_drop_scroll_cancel(vd);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
354 widget_auto_scroll_stop(vd->view);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
355
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
356 filelist_free(VDLIST_INFO(vd, list));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
357 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
358
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 780
diff changeset
359 ViewDir *vdlist_new(ViewDir *vd, FileData *dir_fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
360 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
361 GtkListStore *store;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
362 GtkTreeSelection *selection;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
363 GtkTreeViewColumn *column;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
364 GtkCellRenderer *renderer;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
365
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
366 vd->info = g_new0(ViewDirInfoList, 1);
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
367 vd->type = DIRVIEW_LIST;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
368
384
392dd6541d51 Merge parts of view_dir_list/tree constructors/destructors to
zas_
parents: 383
diff changeset
369 VDLIST_INFO(vd, list) = NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
370
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
371 store = gtk_list_store_new(4, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
372 vd->view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
373 g_object_unref(store);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
374
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
375 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(vd->view), FALSE);
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
376 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(vd->view), FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
377
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
378 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(vd->view));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
379 gtk_tree_selection_set_mode(selection, GTK_SELECTION_NONE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
380
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
381 column = gtk_tree_view_column_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
382 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
383
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
384 renderer = gtk_cell_renderer_pixbuf_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
385 gtk_tree_view_column_pack_start(column, renderer, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
386 gtk_tree_view_column_add_attribute(column, renderer, "pixbuf", DIR_COLUMN_ICON);
396
a01535f52b56 Merge few more functions to view_dir.c.
zas_
parents: 395
diff changeset
387 gtk_tree_view_column_set_cell_data_func(column, renderer, vd_color_cb, vd, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
388
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
389 renderer = gtk_cell_renderer_text_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
390 gtk_tree_view_column_pack_start(column, renderer, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
391 gtk_tree_view_column_add_attribute(column, renderer, "text", DIR_COLUMN_NAME);
396
a01535f52b56 Merge few more functions to view_dir.c.
zas_
parents: 395
diff changeset
392 gtk_tree_view_column_set_cell_data_func(column, renderer, vd_color_cb, vd, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
393
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
394 gtk_tree_view_append_column(GTK_TREE_VIEW(vd->view), column);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
395
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
396 return vd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
397 }