Mercurial > geeqie.yaz
annotate src/bar_exif.c @ 1238:947e603a52c6
simplified metadata interface, dropped metadata_read,
fixes for older exiv2 versions
author | nadvornik |
---|---|
date | Sat, 10 Jan 2009 20:40:37 +0000 |
parents | 9e424170e958 |
children | 8b89e3ff286b |
rev | line source |
---|---|
9 | 1 /* |
196 | 2 * Geeqie |
9 | 3 * (C) 2004 John Ellis |
475 | 4 * Copyright (C) 2008 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
281 | 14 #include "main.h" |
9 | 15 #include "bar_exif.h" |
16 | |
17 #include "exif.h" | |
1022
9962b24b6b43
Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents:
902
diff
changeset
|
18 #include "filedata.h" |
902 | 19 #include "history_list.h" |
1022
9962b24b6b43
Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents:
902
diff
changeset
|
20 #include "misc.h" |
9 | 21 #include "ui_misc.h" |
22 | |
23 #include <math.h> | |
24 | |
25 #define EXIF_BAR_SIZE_INCREMENT 48 | |
26 #define EXIF_BAR_ARROW_SIZE 7 | |
27 | |
28 #define EXIF_BAR_CUSTOM_COUNT 20 | |
29 | |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
30 #define BAR_EXIF_DATA_COLUMN_WIDTH 250 |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
31 |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
32 ExifUI ExifUIList[]={ |
1189 | 33 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("Camera")}, |
34 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("DateTime")}, | |
35 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("ShutterSpeed")}, | |
36 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("Aperture")}, | |
37 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("ExposureBias")}, | |
38 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("ISOSpeedRating")}, | |
39 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("FocalLength")}, | |
40 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("FocalLength35mmFilm")}, | |
41 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("Flash")}, | |
325 | 42 { 0, 0, EXIF_UI_IFSET, "Exif.Photo.ExposureProgram"}, |
43 { 0, 0, EXIF_UI_IFSET, "Exif.Photo.MeteringMode"}, | |
44 { 0, 0, EXIF_UI_IFSET, "Exif.Photo.LightSource"}, | |
1189 | 45 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("ColorProfile")}, |
46 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("SubjectDistance")}, | |
47 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("Resolution")}, | |
325 | 48 { 0, 0, EXIF_UI_IFSET, "Exif.Image.Orientation"}, |
1189 | 49 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("GPSPosition")}, |
50 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("GPSAltitude")}, | |
325 | 51 { 0, 0, EXIF_UI_IFSET, "Exif.Image.ImageDescription"}, |
52 { 0, 0, EXIF_UI_IFSET, "Exif.Image.Copyright"}, | |
53 { 0, 0, EXIF_UI_OFF, NULL} | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
54 }; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
55 |
9 | 56 |
57 /* | |
58 *------------------------------------------------------------------- | |
59 * table util | |
60 *------------------------------------------------------------------- | |
61 */ | |
62 | |
63 static void table_add_line_custom(GtkWidget *table, gint x, gint y, | |
442 | 64 const gchar *text1, const gchar *text2, |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
65 GtkWidget **label1, GtkWidget **label2, |
1065 | 66 GtkWidget **remove) |
9 | 67 { |
68 GtkWidget *label; | |
69 gchar *buf; | |
70 | |
71 buf = g_strconcat((text1) ? text1 : "fixme", ":", NULL); | |
72 if (!text2) text2 = ""; | |
73 | |
74 label = gtk_label_new(buf); | |
75 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.0); | |
76 pref_label_bold(label, TRUE, FALSE); | |
77 gtk_table_attach(GTK_TABLE(table), label, | |
1065 | 78 x + 1, x + 2, y, y + 1, |
9 | 79 GTK_FILL, GTK_FILL, |
80 2, 2); | |
81 *label1 = label; | |
82 | |
83 label = gtk_label_new(text2); | |
84 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); | |
85 gtk_table_attach(GTK_TABLE(table), label, | |
1065 | 86 x + 2, x + 3, y, y + 1, |
9 | 87 GTK_FILL, GTK_FILL, |
88 2, 2); | |
89 *label2 = label; | |
90 | |
1065 | 91 if (remove) |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
92 { |
1065 | 93 *remove = gtk_check_button_new(); |
94 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(*remove), TRUE); | |
95 | |
96 gtk_table_attach(GTK_TABLE(table), *remove, | |
97 x, x + 1, y, y + 1, | |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
98 GTK_FILL, GTK_FILL, |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
99 2, 2); |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
100 } |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
101 |
9 | 102 g_free(buf); |
103 } | |
104 | |
105 static GtkWidget *table_add_line(GtkWidget *table, gint x, gint y, | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
106 const gchar *description, const gchar *text, |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
107 GtkWidget **keyret) |
9 | 108 { |
109 GtkWidget *key; | |
110 GtkWidget *label; | |
111 | |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
112 table_add_line_custom(table, x, y, description, text, &key, &label, NULL); |
9 | 113 gtk_widget_show(key); |
114 gtk_widget_show(label); | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
115 if (keyret) *keyret = key; |
9 | 116 |
117 return label; | |
118 } | |
119 | |
120 | |
121 /* | |
122 *------------------------------------------------------------------- | |
123 * EXIF bar | |
124 *------------------------------------------------------------------- | |
125 */ | |
126 | |
127 typedef struct _ExifBar ExifBar; | |
128 struct _ExifBar | |
129 { | |
130 GtkWidget *vbox; | |
131 GtkWidget *scrolled; | |
132 GtkWidget *table; | |
133 GtkWidget *advanced_scrolled; | |
134 GtkWidget *listview; | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
135 GtkWidget **keys; |
9 | 136 GtkWidget **labels; |
137 | |
138 GtkWidget *custom_sep; | |
139 GtkWidget *custom_name[EXIF_BAR_CUSTOM_COUNT]; | |
140 GtkWidget *custom_value[EXIF_BAR_CUSTOM_COUNT]; | |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
141 GtkWidget *custom_remove[EXIF_BAR_CUSTOM_COUNT]; |
9 | 142 |
138 | 143 FileData *fd; |
9 | 144 |
145 gint allow_search; | |
146 }; | |
147 | |
148 enum { | |
149 EXIF_ADVCOL_ENABLED = 0, | |
150 EXIF_ADVCOL_TAG, | |
151 EXIF_ADVCOL_NAME, | |
152 EXIF_ADVCOL_VALUE, | |
153 EXIF_ADVCOL_FORMAT, | |
154 EXIF_ADVCOL_ELEMENTS, | |
155 EXIF_ADVCOL_DESCRIPTION, | |
156 EXIF_ADVCOL_COUNT | |
157 }; | |
158 | |
159 static void bar_exif_sensitive(ExifBar *eb, gint enable) | |
160 { | |
161 gtk_widget_set_sensitive(eb->table, enable); | |
162 if (eb->advanced_scrolled) gtk_widget_set_sensitive(eb->advanced_scrolled, enable); | |
163 } | |
164 | |
165 static gint bar_exif_row_enabled(const gchar *name) | |
166 { | |
167 GList *list; | |
168 | |
895 | 169 if (!name) return FALSE; |
170 | |
9 | 171 list = history_list_get_by_key("exif_extras"); |
172 while (list) | |
173 { | |
895 | 174 if (strcmp(name, (gchar *)(list->data)) == 0) return TRUE; |
9 | 175 list = list->next; |
176 } | |
177 | |
178 return FALSE; | |
179 } | |
180 | |
181 static void bar_exif_update(ExifBar *eb) | |
182 { | |
1069 | 183 ExifData *exif_processed; |
9 | 184 ExifData *exif; |
233 | 185 gint i; |
9 | 186 |
1069 | 187 exif_processed = exif_read_fd(eb->fd); |
9 | 188 |
1069 | 189 if (!exif_processed) |
9 | 190 { |
191 bar_exif_sensitive(eb, FALSE); | |
192 return; | |
193 } | |
1069 | 194 |
195 if (eb->advanced_scrolled) | |
196 { | |
197 /* show the original values from the file */ | |
198 exif = exif_get_original(exif_processed); | |
199 } | |
200 else | |
201 { | |
202 exif = exif_processed; | |
203 } | |
9 | 204 |
205 bar_exif_sensitive(eb, TRUE); | |
206 | |
207 if (GTK_WIDGET_VISIBLE(eb->scrolled)) | |
208 { | |
209 GList *list; | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
210 for (i = 0; ExifUIList[i].key; i++) |
9 | 211 { |
212 gchar *text; | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
213 gchar *utf8_text; |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
214 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
215 if (ExifUIList[i].current == EXIF_UI_OFF) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
216 { |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
217 gtk_widget_hide(eb->labels[i]); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
218 gtk_widget_hide(eb->keys[i]); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
219 continue; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
220 } |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
221 text = exif_get_data_as_text(exif, ExifUIList[i].key); |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
222 utf8_text = utf8_validate_or_convert(text); |
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
223 g_free(text); |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
224 if (ExifUIList[i].current == EXIF_UI_IFSET |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
225 && (!utf8_text || !*utf8_text)) |
442 | 226 { |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
227 gtk_widget_hide(eb->labels[i]); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
228 gtk_widget_hide(eb->keys[i]); |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
229 g_free(utf8_text); |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
230 continue; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
231 } |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
232 gtk_widget_show(eb->labels[i]); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
233 gtk_widget_show(eb->keys[i]); |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
234 gtk_label_set_text(GTK_LABEL(eb->labels[i]), utf8_text); |
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
235 g_free(utf8_text); |
9 | 236 } |
237 | |
238 list = g_list_last(history_list_get_by_key("exif_extras")); | |
239 if (list) | |
240 { | |
241 gtk_widget_show(eb->custom_sep); | |
242 } | |
243 else | |
244 { | |
245 gtk_widget_hide(eb->custom_sep); | |
246 } | |
247 i = 0; | |
248 while (list && i < EXIF_BAR_CUSTOM_COUNT) | |
249 { | |
250 gchar *text; | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
251 gchar *utf8_text; |
9 | 252 gchar *name; |
253 gchar *buf; | |
1065 | 254 gchar *description; |
9 | 255 |
256 name = list->data; | |
257 list = list->prev; | |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
258 |
9 | 259 text = exif_get_data_as_text(exif, name); |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
260 utf8_text = utf8_validate_or_convert(text); |
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
261 g_free(text); |
9 | 262 |
1065 | 263 description = exif_get_tag_description_by_key(name); |
1067 | 264 if (!description || *description == '\0') |
265 { | |
266 g_free(description); | |
267 description = g_strdup(name); | |
268 } | |
1065 | 269 buf = g_strconcat(description, ":", NULL); |
270 g_free(description); | |
271 | |
9 | 272 gtk_label_set_text(GTK_LABEL(eb->custom_name[i]), buf); |
273 g_free(buf); | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
274 gtk_label_set_text(GTK_LABEL(eb->custom_value[i]), utf8_text); |
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
275 g_free(utf8_text); |
9 | 276 |
277 gtk_widget_show(eb->custom_name[i]); | |
278 gtk_widget_show(eb->custom_value[i]); | |
1065 | 279 g_object_set_data(G_OBJECT(eb->custom_remove[i]), "key", name); |
280 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(eb->custom_remove[i]), TRUE); | |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
281 gtk_widget_show(eb->custom_remove[i]); |
9 | 282 |
283 i++; | |
284 } | |
285 while (i < EXIF_BAR_CUSTOM_COUNT) | |
286 { | |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
287 g_object_set_data(G_OBJECT(eb->custom_remove[i]), "key", NULL); |
9 | 288 gtk_widget_hide(eb->custom_name[i]); |
289 gtk_widget_hide(eb->custom_value[i]); | |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
290 gtk_widget_hide(eb->custom_remove[i]); |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
291 |
9 | 292 i++; |
293 } | |
294 } | |
295 | |
296 if (eb->advanced_scrolled && GTK_WIDGET_VISIBLE(eb->advanced_scrolled)) | |
297 { | |
298 GtkListStore *store; | |
299 GtkTreeIter iter; | |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
300 ExifItem *item; |
442 | 301 |
9 | 302 store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(eb->listview))); |
303 gtk_list_store_clear(store); | |
304 | |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
305 item = exif_get_first_item(exif); |
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
306 while (item) |
9 | 307 { |
308 gchar *tag; | |
185 | 309 gchar *tag_name; |
9 | 310 gchar *text; |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
311 gchar *utf8_text; |
9 | 312 const gchar *format; |
313 gchar *elements; | |
185 | 314 gchar *description; |
9 | 315 |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
316 tag = g_strdup_printf("0x%04x", exif_item_get_tag_id(item)); |
9 | 317 tag_name = exif_item_get_tag_name(item); |
318 format = exif_item_get_format_name(item, TRUE); | |
319 text = exif_item_get_data_as_text(item); | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
320 utf8_text = utf8_validate_or_convert(text); |
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
321 g_free(text); |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
322 elements = g_strdup_printf("%d", exif_item_get_elements(item)); |
9 | 323 description = exif_item_get_description(item); |
1067 | 324 if (!description || *description == '\0') |
325 { | |
326 g_free(description); | |
327 description = g_strdup(tag_name); | |
328 } | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
329 |
9 | 330 gtk_list_store_append(store, &iter); |
331 gtk_list_store_set(store, &iter, | |
332 EXIF_ADVCOL_ENABLED, bar_exif_row_enabled(tag_name), | |
333 EXIF_ADVCOL_TAG, tag, | |
334 EXIF_ADVCOL_NAME, tag_name, | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
335 EXIF_ADVCOL_VALUE, utf8_text, |
9 | 336 EXIF_ADVCOL_FORMAT, format, |
337 EXIF_ADVCOL_ELEMENTS, elements, | |
1066 | 338 EXIF_ADVCOL_DESCRIPTION, description, -1); |
9 | 339 g_free(tag); |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
340 g_free(utf8_text); |
9 | 341 g_free(elements); |
1066 | 342 g_free(description); |
185 | 343 g_free(tag_name); |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
344 item = exif_get_next_item(exif); |
9 | 345 } |
346 } | |
347 | |
1069 | 348 exif_free_fd(eb->fd, exif_processed); |
9 | 349 } |
350 | |
351 static void bar_exif_clear(ExifBar *eb) | |
352 { | |
353 gint i; | |
354 | |
355 if (!GTK_WIDGET_SENSITIVE(eb->labels[0])) return; | |
356 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
357 for (i = 0; ExifUIList[i].key; i++) |
9 | 358 { |
359 gtk_label_set_text(GTK_LABEL(eb->labels[i]), ""); | |
360 } | |
361 for (i = 0; i < EXIF_BAR_CUSTOM_COUNT; i++) | |
362 { | |
363 gtk_label_set_text(GTK_LABEL(eb->custom_value[i]), ""); | |
364 } | |
365 | |
366 if (eb->listview) | |
367 { | |
368 GtkListStore *store; | |
369 | |
370 store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(eb->listview))); | |
371 gtk_list_store_clear(store); | |
372 } | |
373 } | |
374 | |
138 | 375 void bar_exif_set(GtkWidget *bar, FileData *fd) |
9 | 376 { |
377 ExifBar *eb; | |
378 | |
379 eb = g_object_get_data(G_OBJECT(bar), "bar_exif_data"); | |
380 if (!eb) return; | |
381 | |
382 /* store this, advanced view toggle needs to reload data */ | |
138 | 383 file_data_unref(eb->fd); |
384 eb->fd = file_data_ref(fd); | |
9 | 385 |
386 bar_exif_clear(eb); | |
387 bar_exif_update(eb); | |
388 } | |
389 | |
390 static void bar_exif_row_toggled_cb(GtkCellRendererToggle *toggle, const gchar *path, gpointer data) | |
391 { | |
392 GtkWidget *listview = data; | |
393 GtkTreeModel *store; | |
394 GtkTreeIter iter; | |
395 GtkTreePath *tpath; | |
396 gchar *name = NULL; | |
397 gboolean active; | |
398 | |
399 store = gtk_tree_view_get_model(GTK_TREE_VIEW(listview)); | |
400 | |
401 tpath = gtk_tree_path_new_from_string(path); | |
402 gtk_tree_model_get_iter(store, &iter, tpath); | |
403 gtk_tree_path_free(tpath); | |
404 | |
405 gtk_tree_model_get(store, &iter, EXIF_ADVCOL_ENABLED, &active, | |
406 EXIF_ADVCOL_NAME, &name, -1); | |
407 active = (!active); | |
408 | |
409 if (active && | |
410 g_list_length(history_list_get_by_key("exif_extras")) >= EXIF_BAR_CUSTOM_COUNT) | |
411 { | |
412 active = FALSE; | |
413 } | |
414 | |
415 gtk_list_store_set(GTK_LIST_STORE(store), &iter, EXIF_ADVCOL_ENABLED, active, -1); | |
416 | |
417 if (active) | |
418 { | |
419 history_list_add_to_key("exif_extras", name, EXIF_BAR_CUSTOM_COUNT); | |
420 } | |
421 else | |
422 { | |
423 history_list_item_change("exif_extras", name, NULL); | |
424 } | |
425 | |
426 g_free(name); | |
427 } | |
428 | |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
429 static void bar_exif_remove_advanced_cb(GtkWidget *widget, gpointer data) |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
430 { |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
431 ExifBar *eb = data; |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
432 const gchar *key; |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
433 |
1065 | 434 /* continue only if the toggle was deactivated */ |
435 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) return; | |
436 | |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
437 key = g_object_get_data(G_OBJECT(widget), "key"); |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
438 if (!key) return; |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
439 |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
440 history_list_item_change("exif_extras", key, NULL); |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
441 |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
442 bar_exif_update(eb); |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
443 } |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
444 |
9 | 445 static void bar_exif_add_column_check(GtkWidget *listview, const gchar *title, gint n) |
446 { | |
447 GtkTreeViewColumn *column; | |
448 GtkCellRenderer *renderer; | |
449 | |
450 column = gtk_tree_view_column_new(); | |
451 gtk_tree_view_column_set_title(column, title); | |
452 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); | |
453 | |
454 renderer = gtk_cell_renderer_toggle_new(); | |
455 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
456 gtk_tree_view_column_add_attribute(column, renderer, "active", n); | |
457 gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column); | |
458 | |
459 g_signal_connect(G_OBJECT(renderer), "toggled", | |
460 G_CALLBACK(bar_exif_row_toggled_cb), listview); | |
461 } | |
462 | |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
463 static void bar_exif_add_column(GtkWidget *listview, const gchar *title, gint n, gint sizable) |
9 | 464 { |
465 GtkTreeViewColumn *column; | |
466 GtkCellRenderer *renderer; | |
467 | |
468 column = gtk_tree_view_column_new(); | |
469 gtk_tree_view_column_set_title(column, title); | |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
470 |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
471 if (sizable) |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
472 { |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
473 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
474 gtk_tree_view_column_set_fixed_width(column, BAR_EXIF_DATA_COLUMN_WIDTH); |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
475 gtk_tree_view_column_set_resizable(column, TRUE); |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
476 } |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
477 else |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
478 { |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
479 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
480 } |
9 | 481 |
482 renderer = gtk_cell_renderer_text_new(); | |
483 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
484 gtk_tree_view_column_add_attribute(column, renderer, "text", n); | |
485 gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column); | |
486 } | |
487 | |
488 static void bar_exif_advanced_build_view(ExifBar *eb) | |
489 { | |
490 GtkListStore *store; | |
491 | |
492 if (eb->listview) return; | |
493 | |
494 store = gtk_list_store_new(7, G_TYPE_BOOLEAN, | |
495 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, | |
496 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); | |
497 eb->listview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); | |
498 g_object_unref(store); | |
499 | |
500 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(eb->listview), TRUE); | |
501 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(eb->listview), TRUE); | |
502 | |
503 if (eb->allow_search) | |
504 { | |
505 gtk_tree_view_set_search_column(GTK_TREE_VIEW(eb->listview), EXIF_ADVCOL_NAME); | |
506 } | |
507 else | |
508 { | |
509 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(eb->listview), FALSE); | |
510 } | |
511 | |
512 bar_exif_add_column_check(eb->listview, "", EXIF_ADVCOL_ENABLED); | |
513 | |
1067 | 514 bar_exif_add_column(eb->listview, _("Description"), EXIF_ADVCOL_DESCRIPTION, FALSE); |
515 bar_exif_add_column(eb->listview, _("Value"), EXIF_ADVCOL_VALUE, TRUE); | |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
516 bar_exif_add_column(eb->listview, _("Name"), EXIF_ADVCOL_NAME, FALSE); |
1067 | 517 bar_exif_add_column(eb->listview, _("Tag"), EXIF_ADVCOL_TAG, FALSE); |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
518 bar_exif_add_column(eb->listview, _("Format"), EXIF_ADVCOL_FORMAT, FALSE); |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
519 bar_exif_add_column(eb->listview, _("Elements"), EXIF_ADVCOL_ELEMENTS, FALSE); |
9 | 520 |
521 eb->advanced_scrolled = gtk_scrolled_window_new(NULL, NULL); | |
522 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(eb->advanced_scrolled), GTK_SHADOW_IN); | |
523 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(eb->advanced_scrolled), | |
524 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
525 gtk_box_pack_start(GTK_BOX(eb->vbox), eb->advanced_scrolled, TRUE, TRUE, 0); | |
526 gtk_container_add(GTK_CONTAINER(eb->advanced_scrolled), eb->listview); | |
527 gtk_widget_show(eb->listview); | |
528 } | |
529 | |
530 static void bar_exif_advanced_cb(GtkWidget *widget, gpointer data) | |
531 { | |
532 ExifBar *eb = data; | |
533 gint advanced; | |
534 | |
535 advanced = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | |
536 | |
537 if (advanced) | |
538 { | |
539 gtk_widget_hide(eb->scrolled); | |
540 bar_exif_advanced_build_view(eb); | |
541 gtk_widget_show(eb->advanced_scrolled); | |
542 } | |
543 else | |
544 { | |
545 gtk_widget_hide(eb->advanced_scrolled); | |
546 gtk_widget_show(eb->scrolled); | |
547 } | |
548 | |
549 bar_exif_update(eb); | |
550 } | |
551 | |
552 gint bar_exif_is_advanced(GtkWidget *bar) | |
553 { | |
554 ExifBar *eb; | |
555 | |
556 eb = g_object_get_data(G_OBJECT(bar), "bar_exif_data"); | |
557 if (!eb) return FALSE; | |
558 | |
559 return (eb->advanced_scrolled && GTK_WIDGET_VISIBLE(eb->advanced_scrolled)); | |
560 } | |
561 | |
562 void bar_exif_close(GtkWidget *bar) | |
563 { | |
564 ExifBar *eb; | |
565 | |
566 eb = g_object_get_data(G_OBJECT(bar), "bar_exif_data"); | |
567 if (!eb) return; | |
568 | |
569 gtk_widget_destroy(eb->vbox); | |
570 } | |
571 | |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
572 static void bar_exif_width(ExifBar *eb, gint val) |
9 | 573 { |
574 gint size; | |
575 | |
576 size = eb->vbox->allocation.width; | |
577 size = CLAMP(size + val, EXIF_BAR_SIZE_INCREMENT * 2, EXIF_BAR_SIZE_INCREMENT * 16); | |
578 | |
579 gtk_widget_set_size_request(eb->vbox, size, -1); | |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
580 options->panels.exif.width = eb->vbox->allocation.width; |
9 | 581 } |
582 | |
583 static void bar_exif_larger(GtkWidget *widget, gpointer data) | |
584 { | |
585 ExifBar *eb = data; | |
586 | |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
587 bar_exif_width(eb, EXIF_BAR_SIZE_INCREMENT); |
9 | 588 } |
589 | |
590 static void bar_exif_smaller(GtkWidget *widget, gpointer data) | |
591 { | |
592 ExifBar *eb = data; | |
593 | |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
594 bar_exif_width(eb, -EXIF_BAR_SIZE_INCREMENT); |
9 | 595 } |
596 | |
597 static void bar_exif_destroy(GtkWidget *widget, gpointer data) | |
598 { | |
599 ExifBar *eb = data; | |
600 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
601 g_free(eb->keys); |
9 | 602 g_free(eb->labels); |
138 | 603 file_data_unref(eb->fd); |
9 | 604 g_free(eb); |
605 } | |
606 | |
138 | 607 GtkWidget *bar_exif_new(gint show_title, FileData *fd, gint advanced, GtkWidget *bounding_widget) |
9 | 608 { |
609 ExifBar *eb; | |
610 GtkWidget *table; | |
611 GtkWidget *viewport; | |
612 GtkWidget *hbox; | |
613 GtkWidget *button; | |
614 gint i; | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
615 gint exif_len; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
616 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
617 for (exif_len = 0; ExifUIList[exif_len].key; exif_len++) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
618 ; |
9 | 619 |
620 eb = g_new0(ExifBar, 1); | |
621 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
622 eb->keys = g_new0(GtkWidget *, exif_len); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
623 eb->labels = g_new0(GtkWidget *, exif_len); |
9 | 624 |
625 eb->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); | |
626 g_object_set_data(G_OBJECT(eb->vbox), "bar_exif_data", eb); | |
627 g_signal_connect_after(G_OBJECT(eb->vbox), "destroy", | |
628 G_CALLBACK(bar_exif_destroy), eb); | |
629 | |
630 eb->allow_search = !show_title; | |
631 | |
632 if (show_title) | |
633 { | |
634 GtkWidget *box; | |
635 GtkWidget *label; | |
636 GtkWidget *button; | |
637 GtkWidget *arrow; | |
638 | |
639 box = gtk_hbox_new(FALSE, 0); | |
640 | |
641 label = sizer_new(eb->vbox, bounding_widget, SIZER_POS_LEFT); | |
642 sizer_set_limits(label, EXIF_BAR_SIZE_INCREMENT * 2, -1, -1 , -1); | |
643 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0); | |
644 gtk_widget_show(label); | |
645 | |
646 label = gtk_label_new(_("Exif")); | |
647 pref_label_bold(label, TRUE, FALSE); | |
648 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0); | |
649 gtk_widget_show(label); | |
650 | |
651 button = gtk_button_new(); | |
652 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
653 g_signal_connect(G_OBJECT(button), "clicked", | |
654 G_CALLBACK(bar_exif_smaller), eb); | |
655 gtk_box_pack_end(GTK_BOX(box), button, FALSE, FALSE, 0); | |
656 arrow = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE); | |
657 gtk_widget_set_size_request(arrow, EXIF_BAR_ARROW_SIZE, EXIF_BAR_ARROW_SIZE); | |
658 gtk_container_add(GTK_CONTAINER(button), arrow); | |
659 gtk_widget_show(arrow); | |
660 gtk_widget_show(button); | |
661 | |
662 button = gtk_button_new(); | |
663 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
664 g_signal_connect(G_OBJECT(button), "clicked", | |
665 G_CALLBACK(bar_exif_larger), eb); | |
666 gtk_box_pack_end(GTK_BOX(box), button, FALSE, FALSE, 0); | |
667 arrow = gtk_arrow_new(GTK_ARROW_LEFT, GTK_SHADOW_NONE); | |
668 gtk_widget_set_size_request(arrow, EXIF_BAR_ARROW_SIZE, EXIF_BAR_ARROW_SIZE); | |
669 gtk_container_add(GTK_CONTAINER(button), arrow); | |
670 gtk_widget_show(arrow); | |
671 gtk_widget_show(button); | |
672 | |
673 gtk_box_pack_start(GTK_BOX(eb->vbox), box, FALSE, FALSE, 0); | |
674 gtk_widget_show(box); | |
675 } | |
676 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
677 |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
678 table = gtk_table_new(3, exif_len + 1 + EXIF_BAR_CUSTOM_COUNT, FALSE); |
9 | 679 |
680 eb->table = table; | |
681 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
682 for (i = 0; ExifUIList[i].key; i++) |
9 | 683 { |
1053
77ca9a5d42be
fixed charset of exiv2 strings in non-utf8 locales
nadvornik
parents:
1052
diff
changeset
|
684 gchar *text; |
9 | 685 |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
686 text = exif_get_description_by_key(ExifUIList[i].key); |
442 | 687 eb->labels[i] = table_add_line(table, 0, i, text, NULL, |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
688 &eb->keys[i]); |
1053
77ca9a5d42be
fixed charset of exiv2 strings in non-utf8 locales
nadvornik
parents:
1052
diff
changeset
|
689 g_free(text); |
9 | 690 } |
691 | |
692 eb->custom_sep = gtk_hseparator_new(); | |
1068 | 693 gtk_table_attach(GTK_TABLE(table), eb->custom_sep, 0, 3, |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
694 exif_len, exif_len + 1, |
9 | 695 GTK_FILL, GTK_FILL, 2, 2); |
696 | |
697 for (i = 0; i < EXIF_BAR_CUSTOM_COUNT; i++) | |
698 { | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
699 table_add_line_custom(table, 0, exif_len + 1 + i, |
1062
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
700 "", "", &eb->custom_name[i], &eb->custom_value[i], |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
701 &eb->custom_remove[i]); |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
702 g_signal_connect(G_OBJECT(eb->custom_remove[i]), "clicked", |
2e661b3e7ca0
Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents:
1055
diff
changeset
|
703 G_CALLBACK(bar_exif_remove_advanced_cb), eb); |
9 | 704 } |
705 | |
706 eb->scrolled = gtk_scrolled_window_new(NULL, NULL); | |
707 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(eb->scrolled), | |
708 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
709 | |
710 viewport = gtk_viewport_new(NULL, NULL); | |
711 gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE); | |
712 gtk_container_add(GTK_CONTAINER(eb->scrolled), viewport); | |
713 gtk_widget_show(viewport); | |
714 | |
715 gtk_container_add(GTK_CONTAINER(viewport), table); | |
716 gtk_widget_show(table); | |
717 | |
718 gtk_box_pack_start(GTK_BOX(eb->vbox), eb->scrolled, TRUE, TRUE, 0); | |
719 | |
720 hbox = gtk_hbox_new(FALSE, PREF_PAD_SPACE); | |
721 gtk_box_pack_end(GTK_BOX(eb->vbox), hbox, FALSE, FALSE, 0); | |
722 gtk_widget_show(hbox); | |
723 | |
724 button = gtk_check_button_new_with_label(_("Advanced view")); | |
725 if (advanced) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); | |
726 g_signal_connect(G_OBJECT(button), "toggled", | |
727 G_CALLBACK(bar_exif_advanced_cb), eb); | |
728 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
729 gtk_widget_show(button); | |
730 | |
731 eb->advanced_scrolled = NULL; | |
732 eb->listview = NULL; | |
733 | |
734 if (advanced) | |
735 { | |
736 bar_exif_advanced_build_view(eb); | |
737 gtk_widget_show(eb->advanced_scrolled); | |
738 } | |
739 else | |
740 { | |
741 gtk_widget_show(eb->scrolled); | |
742 } | |
743 | |
138 | 744 eb->fd = file_data_ref(fd); |
9 | 745 bar_exif_update(eb); |
746 | |
747 return eb->vbox; | |
748 } | |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1053
diff
changeset
|
749 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |