annotate src/view_dir_list.c @ 604:0b203af63dbf

Use g_ascii_strcasecmp() instead of strcasecmp() where ascii-only strings are used.
author zas_
date Thu, 08 May 2008 12:38:34 +0000
parents 905688aa2317
children 9973edfd86f6
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
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
196 gint vdlist_set_path(ViewDir *vd, const gchar *path)
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
203 if (!path) return FALSE;
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
204 if (vd->path && strcmp(path, vd->path) == 0) return TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
205
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
206 if (vd->path)
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
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
210 base = remove_level_from_path(vd->path);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
211 if (strcmp(base, path) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
212 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
213 old_path = g_strdup(filename_from_path(vd->path));
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
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
218 g_free(vd->path);
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
219 vd->path = g_strdup(path);
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));
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
222 VDLIST_INFO(vd, list) = NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
223
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
224 ret = filelist_read(vd->path, NULL, &VDLIST_INFO(vd, list));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
225
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
226 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
227
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
228 /* add . and .. */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
229
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
230 if (strcmp(vd->path, "/") != 0)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
231 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 406
diff changeset
232 filepath = g_strconcat(vd->path, "/", "..", NULL);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 112
diff changeset
233 fd = file_data_new_simple(filepath);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
234 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
235 g_free(filepath);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
236 }
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 406
diff changeset
237
373
61a3c8b05b24 Add a new option in Preferences > Filtering to allow the
zas_
parents: 356
diff changeset
238 if (options->file_filter.show_dot_directory)
61a3c8b05b24 Add a new option in Preferences > Filtering to allow the
zas_
parents: 356
diff changeset
239 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 406
diff changeset
240 filepath = g_strconcat(vd->path, "/", ".", NULL);
373
61a3c8b05b24 Add a new option in Preferences > Filtering to allow the
zas_
parents: 356
diff changeset
241 fd = file_data_new_simple(filepath);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
242 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
243 g_free(filepath);
61a3c8b05b24 Add a new option in Preferences > Filtering to allow the
zas_
parents: 356
diff changeset
244 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
245
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
246 vdlist_populate(vd);
9
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 if (old_path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
249 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
250 /* scroll to make last path visible */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
251 FileData *found = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
252 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
253
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
254 work = VDLIST_INFO(vd, list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
255 while (work && !found)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
256 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
257 FileData *fd = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
258 if (strcmp(old_path, fd->name) == 0) found = fd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
259 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
260 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
261
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
262 if (found) vdlist_scroll_to_row(vd, found, 0.5);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
263
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
264 g_free(old_path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
265 return ret;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
266 }
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 if (GTK_WIDGET_REALIZED(vd->view))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
269 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
270 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
271 }
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 return ret;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
274 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
275
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
276 void vdlist_refresh(ViewDir *vd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
277 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
278 gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
279
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
280 path = g_strdup(vd->path);
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
281 vd->path = NULL;
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
282 vdlist_set_path(vd, path);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
283 g_free(path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
284 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
285
401
0a2e1b130a25 Add some wrappers in view_dir.c and simplify even more.
zas_
parents: 397
diff changeset
286 gint vdlist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
287 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
288 ViewDir *vd = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
289 GtkTreePath *tpath;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 406
diff changeset
290
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
291 if (event->keyval != GDK_Menu) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
292
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
293 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
294 if (tpath)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
295 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
296 GtkTreeModel *store;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
297 GtkTreeIter iter;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
298
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
299 store = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
300 gtk_tree_model_get_iter(store, &iter, tpath);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
301 gtk_tree_model_get(store, &iter, DIR_COLUMN_POINTER, &vd->click_fd, -1);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 406
diff changeset
302
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
303 gtk_tree_path_free(tpath);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
304 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
305 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
306 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
307 vd->click_fd = NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
308 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
309
383
499d7ba62261 Move some dnd common code from view_dir_list.c and view_dir_tree.c
zas_
parents: 381
diff changeset
310 vd_color_set(vd, vd->click_fd, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
311
388
5186f8e38cb8 Make directory view popup menu common and move it to view_dir.{c,h}.
zas_
parents: 385
diff changeset
312 vd->popup = vd_pop_menu(vd, vd->click_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
313
395
c359fc2c5a1f Move common menu position callback to view_dir.c.
zas_
parents: 394
diff changeset
314 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
315
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
316 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
317 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
318
401
0a2e1b130a25 Add some wrappers in view_dir.c and simplify even more.
zas_
parents: 397
diff changeset
319 gint vdlist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
320 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
321 ViewDir *vd = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
322 GtkTreePath *tpath;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
323 GtkTreeIter iter;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
324 FileData *fd = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
325
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
326 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
327 &tpath, NULL, NULL, NULL))
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 GtkTreeModel *store;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
330
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
331 store = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
332 gtk_tree_model_get_iter(store, &iter, tpath);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
333 gtk_tree_model_get(store, &iter, DIR_COLUMN_POINTER, &fd, -1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
334 gtk_tree_view_set_cursor(GTK_TREE_VIEW(widget), tpath, NULL, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
335 gtk_tree_path_free(tpath);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
336 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
337
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
338 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
339 vd_color_set(vd, vd->click_fd, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
340
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 442
diff changeset
341 if (bevent->button == MOUSE_BUTTON_RIGHT)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
342 {
388
5186f8e38cb8 Make directory view popup menu common and move it to view_dir.{c,h}.
zas_
parents: 385
diff changeset
343 vd->popup = vd_pop_menu(vd, vd->click_fd);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
344 gtk_menu_popup(GTK_MENU(vd->popup), NULL, NULL, NULL, NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
345 bevent->button, bevent->time);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
346 }
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 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
349 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
350
401
0a2e1b130a25 Add some wrappers in view_dir.c and simplify even more.
zas_
parents: 397
diff changeset
351 void vdlist_destroy_cb(GtkWidget *widget, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
352 {
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
353 ViewDir *vd = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
354
394
4a5e1377f3d7 Merge dirlist/dirview dnd code.
zas_
parents: 389
diff changeset
355 vd_dnd_drop_scroll_cancel(vd);
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
356 widget_auto_scroll_stop(vd->view);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
357
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
358 filelist_free(VDLIST_INFO(vd, list));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
359 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
360
384
392dd6541d51 Merge parts of view_dir_list/tree constructors/destructors to
zas_
parents: 383
diff changeset
361 ViewDir *vdlist_new(ViewDir *vd, const gchar *path)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
362 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
363 GtkListStore *store;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
364 GtkTreeSelection *selection;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
365 GtkTreeViewColumn *column;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
366 GtkCellRenderer *renderer;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
367
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
368 vd->info = g_new0(ViewDirInfoList, 1);
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
369 vd->type = DIRVIEW_LIST;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
370
384
392dd6541d51 Merge parts of view_dir_list/tree constructors/destructors to
zas_
parents: 383
diff changeset
371 VDLIST_INFO(vd, list) = NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
372
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
373 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
374 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
375 g_object_unref(store);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
376
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
377 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(vd->view), FALSE);
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
378 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
379
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
380 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(vd->view));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
381 gtk_tree_selection_set_mode(selection, GTK_SELECTION_NONE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
382
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
383 column = gtk_tree_view_column_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
384 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
385
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
386 renderer = gtk_cell_renderer_pixbuf_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
387 gtk_tree_view_column_pack_start(column, renderer, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
388 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
389 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
390
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
391 renderer = gtk_cell_renderer_text_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
392 gtk_tree_view_column_pack_start(column, renderer, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
393 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
394 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
395
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
396 gtk_tree_view_append_column(GTK_TREE_VIEW(vd->view), column);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
397
381
ff63dcb0425c Rename vdl occurences to vd.
zas_
parents: 380
diff changeset
398 return vd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
399 }