Mercurial > geeqie
annotate src/bar_exif.c @ 1068:e67636316f4c
fixed bar_exif separator
author | nadvornik |
---|---|
date | Sat, 18 Oct 2008 09:07:52 +0000 |
parents | 78007efd1140 |
children | aeae25d5d50d |
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[]={ |
566
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
33 { 0, 0, EXIF_UI_IFSET, "formatted.Camera"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
34 { 0, 0, EXIF_UI_IFSET, "formatted.DateTime"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
35 { 0, 0, EXIF_UI_IFSET, "formatted.ShutterSpeed"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
36 { 0, 0, EXIF_UI_IFSET, "formatted.Aperture"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
37 { 0, 0, EXIF_UI_IFSET, "formatted.ExposureBias"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
38 { 0, 0, EXIF_UI_IFSET, "formatted.ISOSpeedRating"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
39 { 0, 0, EXIF_UI_IFSET, "formatted.FocalLength"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
40 { 0, 0, EXIF_UI_IFSET, "formatted.FocalLength35mmFilm"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
41 { 0, 0, EXIF_UI_IFSET, "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"}, | |
566
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
45 { 0, 0, EXIF_UI_IFSET, "formatted.ColorProfile"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
46 { 0, 0, EXIF_UI_IFSET, "formatted.SubjectDistance"}, |
db08ccd54169
Change the prefix of formatted exif tags to a more explicit "formatted." prefix
zas_
parents:
550
diff
changeset
|
47 { 0, 0, EXIF_UI_IFSET, "formatted.Resolution"}, |
325 | 48 { 0, 0, EXIF_UI_IFSET, "Exif.Image.Orientation"}, |
1052 | 49 { 0, 0, EXIF_UI_IFSET, "formatted.GPSPosition"}, |
50 { 0, 0, EXIF_UI_IFSET, "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 { | |
183 ExifData *exif; | |
233 | 184 gint i; |
9 | 185 |
449 | 186 exif = exif_read_fd(eb->fd); |
9 | 187 |
188 if (!exif) | |
189 { | |
190 bar_exif_sensitive(eb, FALSE); | |
191 return; | |
192 } | |
193 | |
194 bar_exif_sensitive(eb, TRUE); | |
195 | |
196 if (GTK_WIDGET_VISIBLE(eb->scrolled)) | |
197 { | |
198 GList *list; | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
199 for (i = 0; ExifUIList[i].key; i++) |
9 | 200 { |
201 gchar *text; | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
202 gchar *utf8_text; |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
203 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
204 if (ExifUIList[i].current == EXIF_UI_OFF) |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
205 { |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
206 gtk_widget_hide(eb->labels[i]); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
207 gtk_widget_hide(eb->keys[i]); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
208 continue; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
209 } |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
210 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
|
211 utf8_text = utf8_validate_or_convert(text); |
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
212 g_free(text); |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
213 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
|
214 && (!utf8_text || !*utf8_text)) |
442 | 215 { |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
216 gtk_widget_hide(eb->labels[i]); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
217 gtk_widget_hide(eb->keys[i]); |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
218 g_free(utf8_text); |
222
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 gtk_widget_show(eb->labels[i]); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
222 gtk_widget_show(eb->keys[i]); |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
223 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
|
224 g_free(utf8_text); |
9 | 225 } |
226 | |
227 list = g_list_last(history_list_get_by_key("exif_extras")); | |
228 if (list) | |
229 { | |
230 gtk_widget_show(eb->custom_sep); | |
231 } | |
232 else | |
233 { | |
234 gtk_widget_hide(eb->custom_sep); | |
235 } | |
236 i = 0; | |
237 while (list && i < EXIF_BAR_CUSTOM_COUNT) | |
238 { | |
239 gchar *text; | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
240 gchar *utf8_text; |
9 | 241 gchar *name; |
242 gchar *buf; | |
1065 | 243 gchar *description; |
9 | 244 |
245 name = list->data; | |
246 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
|
247 |
9 | 248 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
|
249 utf8_text = utf8_validate_or_convert(text); |
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
250 g_free(text); |
9 | 251 |
1065 | 252 description = exif_get_tag_description_by_key(name); |
1067 | 253 if (!description || *description == '\0') |
254 { | |
255 g_free(description); | |
256 description = g_strdup(name); | |
257 } | |
1065 | 258 buf = g_strconcat(description, ":", NULL); |
259 g_free(description); | |
260 | |
9 | 261 gtk_label_set_text(GTK_LABEL(eb->custom_name[i]), buf); |
262 g_free(buf); | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
263 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
|
264 g_free(utf8_text); |
9 | 265 |
266 gtk_widget_show(eb->custom_name[i]); | |
267 gtk_widget_show(eb->custom_value[i]); | |
1065 | 268 g_object_set_data(G_OBJECT(eb->custom_remove[i]), "key", name); |
269 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
|
270 gtk_widget_show(eb->custom_remove[i]); |
9 | 271 |
272 i++; | |
273 } | |
274 while (i < EXIF_BAR_CUSTOM_COUNT) | |
275 { | |
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
|
276 g_object_set_data(G_OBJECT(eb->custom_remove[i]), "key", NULL); |
9 | 277 gtk_widget_hide(eb->custom_name[i]); |
278 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
|
279 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
|
280 |
9 | 281 i++; |
282 } | |
283 } | |
284 | |
285 if (eb->advanced_scrolled && GTK_WIDGET_VISIBLE(eb->advanced_scrolled)) | |
286 { | |
287 GtkListStore *store; | |
288 GtkTreeIter iter; | |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
289 ExifItem *item; |
442 | 290 |
9 | 291 store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(eb->listview))); |
292 gtk_list_store_clear(store); | |
293 | |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
294 item = exif_get_first_item(exif); |
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
295 while (item) |
9 | 296 { |
297 gchar *tag; | |
185 | 298 gchar *tag_name; |
9 | 299 gchar *text; |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
300 gchar *utf8_text; |
9 | 301 const gchar *format; |
302 gchar *elements; | |
185 | 303 gchar *description; |
9 | 304 |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
305 tag = g_strdup_printf("0x%04x", exif_item_get_tag_id(item)); |
9 | 306 tag_name = exif_item_get_tag_name(item); |
307 format = exif_item_get_format_name(item, TRUE); | |
308 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
|
309 utf8_text = utf8_validate_or_convert(text); |
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
310 g_free(text); |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
311 elements = g_strdup_printf("%d", exif_item_get_elements(item)); |
9 | 312 description = exif_item_get_description(item); |
1067 | 313 if (!description || *description == '\0') |
314 { | |
315 g_free(description); | |
316 description = g_strdup(tag_name); | |
317 } | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
318 |
9 | 319 gtk_list_store_append(store, &iter); |
320 gtk_list_store_set(store, &iter, | |
321 EXIF_ADVCOL_ENABLED, bar_exif_row_enabled(tag_name), | |
322 EXIF_ADVCOL_TAG, tag, | |
323 EXIF_ADVCOL_NAME, tag_name, | |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
324 EXIF_ADVCOL_VALUE, utf8_text, |
9 | 325 EXIF_ADVCOL_FORMAT, format, |
326 EXIF_ADVCOL_ELEMENTS, elements, | |
1066 | 327 EXIF_ADVCOL_DESCRIPTION, description, -1); |
9 | 328 g_free(tag); |
767
e73d30e0c896
Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents:
680
diff
changeset
|
329 g_free(utf8_text); |
9 | 330 g_free(elements); |
1066 | 331 g_free(description); |
185 | 332 g_free(tag_name); |
176
695e1ad3b169
simplified exif.h, moved implementation-specific stuff to exif-int.h
nadvornik
parents:
138
diff
changeset
|
333 item = exif_get_next_item(exif); |
9 | 334 } |
335 } | |
336 | |
844 | 337 exif_free_fd(eb->fd, exif); |
9 | 338 } |
339 | |
340 static void bar_exif_clear(ExifBar *eb) | |
341 { | |
342 gint i; | |
343 | |
344 if (!GTK_WIDGET_SENSITIVE(eb->labels[0])) return; | |
345 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
346 for (i = 0; ExifUIList[i].key; i++) |
9 | 347 { |
348 gtk_label_set_text(GTK_LABEL(eb->labels[i]), ""); | |
349 } | |
350 for (i = 0; i < EXIF_BAR_CUSTOM_COUNT; i++) | |
351 { | |
352 gtk_label_set_text(GTK_LABEL(eb->custom_value[i]), ""); | |
353 } | |
354 | |
355 if (eb->listview) | |
356 { | |
357 GtkListStore *store; | |
358 | |
359 store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(eb->listview))); | |
360 gtk_list_store_clear(store); | |
361 } | |
362 } | |
363 | |
138 | 364 void bar_exif_set(GtkWidget *bar, FileData *fd) |
9 | 365 { |
366 ExifBar *eb; | |
367 | |
368 eb = g_object_get_data(G_OBJECT(bar), "bar_exif_data"); | |
369 if (!eb) return; | |
370 | |
371 /* store this, advanced view toggle needs to reload data */ | |
138 | 372 file_data_unref(eb->fd); |
373 eb->fd = file_data_ref(fd); | |
9 | 374 |
375 bar_exif_clear(eb); | |
376 bar_exif_update(eb); | |
377 } | |
378 | |
379 static void bar_exif_row_toggled_cb(GtkCellRendererToggle *toggle, const gchar *path, gpointer data) | |
380 { | |
381 GtkWidget *listview = data; | |
382 GtkTreeModel *store; | |
383 GtkTreeIter iter; | |
384 GtkTreePath *tpath; | |
385 gchar *name = NULL; | |
386 gboolean active; | |
387 | |
388 store = gtk_tree_view_get_model(GTK_TREE_VIEW(listview)); | |
389 | |
390 tpath = gtk_tree_path_new_from_string(path); | |
391 gtk_tree_model_get_iter(store, &iter, tpath); | |
392 gtk_tree_path_free(tpath); | |
393 | |
394 gtk_tree_model_get(store, &iter, EXIF_ADVCOL_ENABLED, &active, | |
395 EXIF_ADVCOL_NAME, &name, -1); | |
396 active = (!active); | |
397 | |
398 if (active && | |
399 g_list_length(history_list_get_by_key("exif_extras")) >= EXIF_BAR_CUSTOM_COUNT) | |
400 { | |
401 active = FALSE; | |
402 } | |
403 | |
404 gtk_list_store_set(GTK_LIST_STORE(store), &iter, EXIF_ADVCOL_ENABLED, active, -1); | |
405 | |
406 if (active) | |
407 { | |
408 history_list_add_to_key("exif_extras", name, EXIF_BAR_CUSTOM_COUNT); | |
409 } | |
410 else | |
411 { | |
412 history_list_item_change("exif_extras", name, NULL); | |
413 } | |
414 | |
415 g_free(name); | |
416 } | |
417 | |
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
|
418 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
|
419 { |
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
|
420 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
|
421 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
|
422 |
1065 | 423 /* continue only if the toggle was deactivated */ |
424 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) return; | |
425 | |
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
|
426 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
|
427 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
|
428 |
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 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
|
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 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
|
432 } |
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 |
9 | 434 static void bar_exif_add_column_check(GtkWidget *listview, const gchar *title, gint n) |
435 { | |
436 GtkTreeViewColumn *column; | |
437 GtkCellRenderer *renderer; | |
438 | |
439 column = gtk_tree_view_column_new(); | |
440 gtk_tree_view_column_set_title(column, title); | |
441 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); | |
442 | |
443 renderer = gtk_cell_renderer_toggle_new(); | |
444 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
445 gtk_tree_view_column_add_attribute(column, renderer, "active", n); | |
446 gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column); | |
447 | |
448 g_signal_connect(G_OBJECT(renderer), "toggled", | |
449 G_CALLBACK(bar_exif_row_toggled_cb), listview); | |
450 } | |
451 | |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
452 static void bar_exif_add_column(GtkWidget *listview, const gchar *title, gint n, gint sizable) |
9 | 453 { |
454 GtkTreeViewColumn *column; | |
455 GtkCellRenderer *renderer; | |
456 | |
457 column = gtk_tree_view_column_new(); | |
458 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
|
459 |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
460 if (sizable) |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
461 { |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
462 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
|
463 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
|
464 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
|
465 } |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
466 else |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
467 { |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
468 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
|
469 } |
9 | 470 |
471 renderer = gtk_cell_renderer_text_new(); | |
472 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
473 gtk_tree_view_column_add_attribute(column, renderer, "text", n); | |
474 gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column); | |
475 } | |
476 | |
477 static void bar_exif_advanced_build_view(ExifBar *eb) | |
478 { | |
479 GtkListStore *store; | |
480 | |
481 if (eb->listview) return; | |
482 | |
483 store = gtk_list_store_new(7, G_TYPE_BOOLEAN, | |
484 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, | |
485 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); | |
486 eb->listview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); | |
487 g_object_unref(store); | |
488 | |
489 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(eb->listview), TRUE); | |
490 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(eb->listview), TRUE); | |
491 | |
492 if (eb->allow_search) | |
493 { | |
494 gtk_tree_view_set_search_column(GTK_TREE_VIEW(eb->listview), EXIF_ADVCOL_NAME); | |
495 } | |
496 else | |
497 { | |
498 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(eb->listview), FALSE); | |
499 } | |
500 | |
501 bar_exif_add_column_check(eb->listview, "", EXIF_ADVCOL_ENABLED); | |
502 | |
1067 | 503 bar_exif_add_column(eb->listview, _("Description"), EXIF_ADVCOL_DESCRIPTION, FALSE); |
504 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
|
505 bar_exif_add_column(eb->listview, _("Name"), EXIF_ADVCOL_NAME, FALSE); |
1067 | 506 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
|
507 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
|
508 bar_exif_add_column(eb->listview, _("Elements"), EXIF_ADVCOL_ELEMENTS, FALSE); |
9 | 509 |
510 eb->advanced_scrolled = gtk_scrolled_window_new(NULL, NULL); | |
511 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(eb->advanced_scrolled), GTK_SHADOW_IN); | |
512 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(eb->advanced_scrolled), | |
513 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
514 gtk_box_pack_start(GTK_BOX(eb->vbox), eb->advanced_scrolled, TRUE, TRUE, 0); | |
515 gtk_container_add(GTK_CONTAINER(eb->advanced_scrolled), eb->listview); | |
516 gtk_widget_show(eb->listview); | |
517 } | |
518 | |
519 static void bar_exif_advanced_cb(GtkWidget *widget, gpointer data) | |
520 { | |
521 ExifBar *eb = data; | |
522 gint advanced; | |
523 | |
524 advanced = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | |
525 | |
526 if (advanced) | |
527 { | |
528 gtk_widget_hide(eb->scrolled); | |
529 bar_exif_advanced_build_view(eb); | |
530 gtk_widget_show(eb->advanced_scrolled); | |
531 } | |
532 else | |
533 { | |
534 gtk_widget_hide(eb->advanced_scrolled); | |
535 gtk_widget_show(eb->scrolled); | |
536 } | |
537 | |
538 bar_exif_update(eb); | |
539 } | |
540 | |
541 gint bar_exif_is_advanced(GtkWidget *bar) | |
542 { | |
543 ExifBar *eb; | |
544 | |
545 eb = g_object_get_data(G_OBJECT(bar), "bar_exif_data"); | |
546 if (!eb) return FALSE; | |
547 | |
548 return (eb->advanced_scrolled && GTK_WIDGET_VISIBLE(eb->advanced_scrolled)); | |
549 } | |
550 | |
551 void bar_exif_close(GtkWidget *bar) | |
552 { | |
553 ExifBar *eb; | |
554 | |
555 eb = g_object_get_data(G_OBJECT(bar), "bar_exif_data"); | |
556 if (!eb) return; | |
557 | |
558 gtk_widget_destroy(eb->vbox); | |
559 } | |
560 | |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
561 static void bar_exif_width(ExifBar *eb, gint val) |
9 | 562 { |
563 gint size; | |
564 | |
565 size = eb->vbox->allocation.width; | |
566 size = CLAMP(size + val, EXIF_BAR_SIZE_INCREMENT * 2, EXIF_BAR_SIZE_INCREMENT * 16); | |
567 | |
568 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
|
569 options->panels.exif.width = eb->vbox->allocation.width; |
9 | 570 } |
571 | |
572 static void bar_exif_larger(GtkWidget *widget, gpointer data) | |
573 { | |
574 ExifBar *eb = data; | |
575 | |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
576 bar_exif_width(eb, EXIF_BAR_SIZE_INCREMENT); |
9 | 577 } |
578 | |
579 static void bar_exif_smaller(GtkWidget *widget, gpointer data) | |
580 { | |
581 ExifBar *eb = data; | |
582 | |
489
3809ffa3567b
Save state and width of exif, info and sort panels to rc file.
zas_
parents:
475
diff
changeset
|
583 bar_exif_width(eb, -EXIF_BAR_SIZE_INCREMENT); |
9 | 584 } |
585 | |
586 static void bar_exif_destroy(GtkWidget *widget, gpointer data) | |
587 { | |
588 ExifBar *eb = data; | |
589 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
590 g_free(eb->keys); |
9 | 591 g_free(eb->labels); |
138 | 592 file_data_unref(eb->fd); |
9 | 593 g_free(eb); |
594 } | |
595 | |
138 | 596 GtkWidget *bar_exif_new(gint show_title, FileData *fd, gint advanced, GtkWidget *bounding_widget) |
9 | 597 { |
598 ExifBar *eb; | |
599 GtkWidget *table; | |
600 GtkWidget *viewport; | |
601 GtkWidget *hbox; | |
602 GtkWidget *button; | |
603 gint i; | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
604 gint exif_len; |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
605 |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
606 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
|
607 ; |
9 | 608 |
609 eb = g_new0(ExifBar, 1); | |
610 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
611 eb->keys = g_new0(GtkWidget *, exif_len); |
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
612 eb->labels = g_new0(GtkWidget *, exif_len); |
9 | 613 |
614 eb->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); | |
615 g_object_set_data(G_OBJECT(eb->vbox), "bar_exif_data", eb); | |
616 g_signal_connect_after(G_OBJECT(eb->vbox), "destroy", | |
617 G_CALLBACK(bar_exif_destroy), eb); | |
618 | |
619 eb->allow_search = !show_title; | |
620 | |
621 if (show_title) | |
622 { | |
623 GtkWidget *box; | |
624 GtkWidget *label; | |
625 GtkWidget *button; | |
626 GtkWidget *arrow; | |
627 | |
628 box = gtk_hbox_new(FALSE, 0); | |
629 | |
630 label = sizer_new(eb->vbox, bounding_widget, SIZER_POS_LEFT); | |
631 sizer_set_limits(label, EXIF_BAR_SIZE_INCREMENT * 2, -1, -1 , -1); | |
632 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0); | |
633 gtk_widget_show(label); | |
634 | |
635 label = gtk_label_new(_("Exif")); | |
636 pref_label_bold(label, TRUE, FALSE); | |
637 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0); | |
638 gtk_widget_show(label); | |
639 | |
640 button = gtk_button_new(); | |
641 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
642 g_signal_connect(G_OBJECT(button), "clicked", | |
643 G_CALLBACK(bar_exif_smaller), eb); | |
644 gtk_box_pack_end(GTK_BOX(box), button, FALSE, FALSE, 0); | |
645 arrow = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE); | |
646 gtk_widget_set_size_request(arrow, EXIF_BAR_ARROW_SIZE, EXIF_BAR_ARROW_SIZE); | |
647 gtk_container_add(GTK_CONTAINER(button), arrow); | |
648 gtk_widget_show(arrow); | |
649 gtk_widget_show(button); | |
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_larger), eb); | |
655 gtk_box_pack_end(GTK_BOX(box), button, FALSE, FALSE, 0); | |
656 arrow = gtk_arrow_new(GTK_ARROW_LEFT, 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 gtk_box_pack_start(GTK_BOX(eb->vbox), box, FALSE, FALSE, 0); | |
663 gtk_widget_show(box); | |
664 } | |
665 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
666 |
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
|
667 table = gtk_table_new(3, exif_len + 1 + EXIF_BAR_CUSTOM_COUNT, FALSE); |
9 | 668 |
669 eb->table = table; | |
670 | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
671 for (i = 0; ExifUIList[i].key; i++) |
9 | 672 { |
1053
77ca9a5d42be
fixed charset of exiv2 strings in non-utf8 locales
nadvornik
parents:
1052
diff
changeset
|
673 gchar *text; |
9 | 674 |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
675 text = exif_get_description_by_key(ExifUIList[i].key); |
442 | 676 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
|
677 &eb->keys[i]); |
1053
77ca9a5d42be
fixed charset of exiv2 strings in non-utf8 locales
nadvornik
parents:
1052
diff
changeset
|
678 g_free(text); |
9 | 679 } |
680 | |
681 eb->custom_sep = gtk_hseparator_new(); | |
1068 | 682 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
|
683 exif_len, exif_len + 1, |
9 | 684 GTK_FILL, GTK_FILL, 2, 2); |
685 | |
686 for (i = 0; i < EXIF_BAR_CUSTOM_COUNT; i++) | |
687 { | |
222
77f1bcc6c161
various exif improvements based on patch by Uwe Ohse
nadvornik
parents:
204
diff
changeset
|
688 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
|
689 "", "", &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
|
690 &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
|
691 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
|
692 G_CALLBACK(bar_exif_remove_advanced_cb), eb); |
9 | 693 } |
694 | |
695 eb->scrolled = gtk_scrolled_window_new(NULL, NULL); | |
696 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(eb->scrolled), | |
697 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
698 | |
699 viewport = gtk_viewport_new(NULL, NULL); | |
700 gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE); | |
701 gtk_container_add(GTK_CONTAINER(eb->scrolled), viewport); | |
702 gtk_widget_show(viewport); | |
703 | |
704 gtk_container_add(GTK_CONTAINER(viewport), table); | |
705 gtk_widget_show(table); | |
706 | |
707 gtk_box_pack_start(GTK_BOX(eb->vbox), eb->scrolled, TRUE, TRUE, 0); | |
708 | |
709 hbox = gtk_hbox_new(FALSE, PREF_PAD_SPACE); | |
710 gtk_box_pack_end(GTK_BOX(eb->vbox), hbox, FALSE, FALSE, 0); | |
711 gtk_widget_show(hbox); | |
712 | |
713 button = gtk_check_button_new_with_label(_("Advanced view")); | |
714 if (advanced) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); | |
715 g_signal_connect(G_OBJECT(button), "toggled", | |
716 G_CALLBACK(bar_exif_advanced_cb), eb); | |
717 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
718 gtk_widget_show(button); | |
719 | |
720 eb->advanced_scrolled = NULL; | |
721 eb->listview = NULL; | |
722 | |
723 if (advanced) | |
724 { | |
725 bar_exif_advanced_build_view(eb); | |
726 gtk_widget_show(eb->advanced_scrolled); | |
727 } | |
728 else | |
729 { | |
730 gtk_widget_show(eb->scrolled); | |
731 } | |
732 | |
138 | 733 eb->fd = file_data_ref(fd); |
9 | 734 bar_exif_update(eb); |
735 | |
736 return eb->vbox; | |
737 } | |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1053
diff
changeset
|
738 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |