Mercurial > geeqie.yaz
annotate src/bar_info.c @ 1212:97f30a17dc6b
fixed safe delete
author | nadvornik |
---|---|
date | Sun, 21 Dec 2008 21:36:58 +0000 |
parents | aed0e28b2744 |
children | 70f1d002436f |
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_info.h" |
16 | |
586 | 17 #include "filedata.h" |
902 | 18 #include "history_list.h" |
9 | 19 #include "info.h" |
1178
f6449c17306b
Move comments/keywords read and write stuff to new metadata.{c,h}.
zas_
parents:
1174
diff
changeset
|
20 #include "metadata.h" |
1022
9962b24b6b43
Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents:
995
diff
changeset
|
21 #include "misc.h" |
9 | 22 #include "ui_fileops.h" |
23 #include "ui_misc.h" | |
24 #include "ui_utildlg.h" | |
1022
9962b24b6b43
Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents:
995
diff
changeset
|
25 #include "utilops.h" |
9 | 26 |
27 #define BAR_KEYWORD_AUTOSAVE_TIME 10000 | |
28 | |
29 | |
30 static const gchar *keyword_favorite_defaults[] = { | |
31 N_("Favorite"), | |
32 N_("Todo"), | |
33 N_("People"), | |
34 N_("Places"), | |
35 N_("Art"), | |
36 N_("Nature"), | |
37 N_("Possessions"), | |
38 NULL | |
39 }; | |
40 | |
41 | |
42 static void bar_info_keyword_update_all(void); | |
43 | |
44 /* | |
45 *------------------------------------------------------------------- | |
46 * keyword / comment utils | |
47 *------------------------------------------------------------------- | |
48 */ | |
49 | |
188
0584cb78aa14
write comment and keywords to xmp, sidecars are used if exist
nadvornik
parents:
138
diff
changeset
|
50 |
9 | 51 static gchar *comment_pull(GtkWidget *textview) |
52 { | |
53 GtkTextBuffer *buffer; | |
54 GtkTextIter start, end; | |
442 | 55 |
9 | 56 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); |
57 gtk_text_buffer_get_bounds(buffer, &start, &end); | |
442 | 58 |
9 | 59 return gtk_text_buffer_get_text(buffer, &start, &end, FALSE); |
60 } | |
61 | |
62 GList *keyword_list_pull(GtkWidget *text_widget) | |
63 { | |
1178
f6449c17306b
Move comments/keywords read and write stuff to new metadata.{c,h}.
zas_
parents:
1174
diff
changeset
|
64 GList *list; |
9 | 65 gchar *text; |
66 | |
67 if (GTK_IS_TEXT_VIEW(text_widget)) | |
68 { | |
69 text = comment_pull(text_widget); | |
70 } | |
71 else if (GTK_IS_ENTRY(text_widget)) | |
72 { | |
73 text = g_strdup(gtk_entry_get_text(GTK_ENTRY(text_widget))); | |
74 } | |
75 else | |
76 { | |
77 return NULL; | |
78 } | |
1178
f6449c17306b
Move comments/keywords read and write stuff to new metadata.{c,h}.
zas_
parents:
1174
diff
changeset
|
79 |
f6449c17306b
Move comments/keywords read and write stuff to new metadata.{c,h}.
zas_
parents:
1174
diff
changeset
|
80 list = string_to_keywords_list(text); |
9 | 81 |
82 g_free(text); | |
83 | |
84 return list; | |
85 } | |
86 | |
87 void keyword_list_push(GtkWidget *textview, GList *list) | |
88 { | |
89 GtkTextBuffer *buffer; | |
90 GtkTextIter start, end; | |
91 | |
92 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); | |
93 gtk_text_buffer_get_bounds(buffer, &start, &end); | |
512
f9bf33be53ff
Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents:
507
diff
changeset
|
94 gtk_text_buffer_delete(buffer, &start, &end); |
9 | 95 |
96 while (list) | |
97 { | |
98 const gchar *word = list->data; | |
99 GtkTextIter iter; | |
100 | |
101 gtk_text_buffer_get_end_iter(buffer, &iter); | |
102 if (word) gtk_text_buffer_insert(buffer, &iter, word, -1); | |
103 gtk_text_buffer_get_end_iter(buffer, &iter); | |
104 gtk_text_buffer_insert(buffer, &iter, "\n", -1); | |
105 | |
106 list = list->next; | |
107 } | |
108 } | |
109 | |
110 | |
111 /* | |
112 *------------------------------------------------------------------- | |
113 * keyword list dialog | |
114 *------------------------------------------------------------------- | |
115 */ | |
116 | |
117 #define KEYWORD_DIALOG_WIDTH 200 | |
118 #define KEYWORD_DIALOG_HEIGHT 250 | |
119 | |
120 typedef struct _KeywordDlg KeywordDlg; | |
121 struct _KeywordDlg | |
122 { | |
123 GenericDialog *gd; | |
124 GtkWidget *treeview; | |
125 }; | |
126 | |
127 static KeywordDlg *keyword_dialog = NULL; | |
128 | |
129 | |
130 static void keyword_dialog_cancel_cb(GenericDialog *gd, gpointer data) | |
131 { | |
132 g_free(keyword_dialog); | |
133 keyword_dialog = NULL; | |
134 } | |
135 | |
136 static void keyword_dialog_ok_cb(GenericDialog *gd, gpointer data) | |
137 { | |
138 KeywordDlg *kd = data; | |
139 GtkTreeModel *store; | |
140 GtkTreeIter iter; | |
141 gint valid; | |
142 | |
143 history_list_free_key("keywords"); | |
144 | |
145 store = gtk_tree_view_get_model(GTK_TREE_VIEW(kd->treeview)); | |
146 valid = gtk_tree_model_get_iter_first(store, &iter); | |
147 while (valid) | |
148 { | |
149 gchar *key; | |
150 | |
151 gtk_tree_model_get(store, &iter, 0, &key, -1); | |
152 valid = gtk_tree_model_iter_next(store, &iter); | |
153 | |
154 history_list_add_to_key("keywords", key, 0); | |
155 } | |
156 | |
157 keyword_dialog_cancel_cb(gd, data); | |
158 | |
159 bar_info_keyword_update_all(); | |
160 } | |
161 | |
162 static void keyword_dialog_add_cb(GtkWidget *button, gpointer data) | |
163 { | |
164 KeywordDlg *kd = data; | |
165 GtkTreeSelection *selection; | |
166 GtkTreeModel *store; | |
167 GtkTreeIter sibling; | |
168 GtkTreeIter iter; | |
169 GtkTreePath *tpath; | |
170 | |
171 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(kd->treeview)); | |
172 if (gtk_tree_selection_get_selected(selection, &store, &sibling)) | |
173 { | |
174 gtk_list_store_insert_before(GTK_LIST_STORE(store), &iter, &sibling); | |
175 } | |
176 else | |
177 { | |
178 store = gtk_tree_view_get_model(GTK_TREE_VIEW(kd->treeview)); | |
179 gtk_list_store_append(GTK_LIST_STORE(store), &iter); | |
180 } | |
181 | |
182 gtk_list_store_set(GTK_LIST_STORE(store), &iter, 1, TRUE, -1); | |
183 | |
184 tpath = gtk_tree_model_get_path(store, &iter); | |
185 gtk_tree_view_set_cursor(GTK_TREE_VIEW(kd->treeview), tpath, | |
186 gtk_tree_view_get_column(GTK_TREE_VIEW(kd->treeview), 0), TRUE); | |
187 gtk_tree_path_free(tpath); | |
188 } | |
189 | |
190 static void keyword_dialog_remove_cb(GtkWidget *button, gpointer data) | |
191 { | |
192 KeywordDlg *kd = data; | |
193 GtkTreeSelection *selection; | |
194 GtkTreeModel *store; | |
195 GtkTreeIter iter; | |
196 GtkTreeIter next; | |
197 GtkTreePath *tpath; | |
198 | |
199 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(kd->treeview)); | |
200 if (!gtk_tree_selection_get_selected(selection, &store, &iter)) return; | |
201 | |
202 tpath = NULL; | |
203 next = iter; | |
204 if (gtk_tree_model_iter_next(store, &next)) | |
205 { | |
206 tpath = gtk_tree_model_get_path(store, &next); | |
207 } | |
208 else | |
209 { | |
210 tpath = gtk_tree_model_get_path(store, &iter); | |
211 if (!gtk_tree_path_prev(tpath)) | |
212 { | |
213 gtk_tree_path_free(tpath); | |
214 tpath = NULL; | |
215 } | |
216 } | |
217 if (tpath) | |
218 { | |
219 gtk_tree_view_set_cursor(GTK_TREE_VIEW(kd->treeview), tpath, | |
220 gtk_tree_view_get_column(GTK_TREE_VIEW(kd->treeview), 0), FALSE); | |
221 gtk_tree_path_free(tpath); | |
222 } | |
223 | |
224 gtk_list_store_remove(GTK_LIST_STORE(store), &iter); | |
225 } | |
226 | |
227 static void keyword_dialog_edit_cb(GtkCellRendererText *renderer, const gchar *path, | |
228 const gchar *new_text, gpointer data) | |
229 { | |
230 KeywordDlg *kd = data; | |
231 GtkTreeModel *store; | |
232 GtkTreeIter iter; | |
233 GtkTreePath *tpath; | |
234 | |
235 if (!new_text || strlen(new_text) == 0) return; | |
236 | |
237 store = gtk_tree_view_get_model(GTK_TREE_VIEW(kd->treeview)); | |
238 | |
239 tpath = gtk_tree_path_new_from_string(path); | |
240 gtk_tree_model_get_iter(store, &iter, tpath); | |
241 gtk_tree_path_free(tpath); | |
242 | |
243 gtk_list_store_set(GTK_LIST_STORE(store), &iter, 0, new_text, -1); | |
244 } | |
245 | |
246 static void keyword_dialog_populate(KeywordDlg *kd) | |
247 { | |
248 GtkListStore *store; | |
249 GList *list; | |
250 | |
251 store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(kd->treeview))); | |
252 gtk_list_store_clear(store); | |
253 | |
254 list = history_list_get_by_key("keywords"); | |
255 list = g_list_last(list); | |
256 while (list) | |
257 { | |
258 GtkTreeIter iter; | |
259 | |
260 gtk_list_store_append(store, &iter); | |
261 gtk_list_store_set(store, &iter, 0, list->data, | |
262 1, TRUE, -1); | |
263 | |
264 list = list->prev; | |
265 } | |
266 } | |
267 | |
268 static void keyword_dialog_show(void) | |
269 { | |
270 GtkWidget *scrolled; | |
271 GtkListStore *store; | |
272 GtkTreeViewColumn *column; | |
273 GtkCellRenderer *renderer; | |
274 GtkWidget *hbox; | |
275 GtkWidget *button; | |
276 | |
277 if (keyword_dialog) | |
278 { | |
279 gtk_window_present(GTK_WINDOW(keyword_dialog->gd->dialog)); | |
280 return; | |
281 } | |
282 | |
283 keyword_dialog = g_new0(KeywordDlg, 1); | |
284 | |
285 keyword_dialog->gd = generic_dialog_new(_("Keyword Presets"), | |
1174
0bea79d87065
Drop useless wmclass stuff. Gtk will take care of it and as said in the documentation using gtk_window_set_wmclass() is sort of pointless.
zas_
parents:
1148
diff
changeset
|
286 "keyword_presets", NULL, TRUE, |
9 | 287 keyword_dialog_cancel_cb, keyword_dialog); |
288 generic_dialog_add_message(keyword_dialog->gd, NULL, _("Favorite keywords list"), NULL); | |
289 | |
290 generic_dialog_add_button(keyword_dialog->gd, GTK_STOCK_OK, NULL, | |
291 keyword_dialog_ok_cb, TRUE); | |
292 | |
293 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
294 gtk_widget_set_size_request(scrolled, KEYWORD_DIALOG_WIDTH, KEYWORD_DIALOG_HEIGHT); | |
295 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | |
296 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), | |
297 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
298 gtk_box_pack_start(GTK_BOX(keyword_dialog->gd->vbox), scrolled, TRUE, TRUE, 5); | |
299 gtk_widget_show(scrolled); | |
300 | |
301 store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_BOOLEAN); | |
302 keyword_dialog->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); | |
303 g_object_unref(store); | |
304 | |
305 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(keyword_dialog->treeview), FALSE); | |
306 gtk_tree_view_set_search_column(GTK_TREE_VIEW(keyword_dialog->treeview), 0); | |
307 gtk_tree_view_set_reorderable(GTK_TREE_VIEW(keyword_dialog->treeview), TRUE); | |
308 | |
309 column = gtk_tree_view_column_new(); | |
310 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); | |
311 renderer = gtk_cell_renderer_text_new(); | |
312 g_signal_connect(G_OBJECT(renderer), "edited", | |
313 G_CALLBACK(keyword_dialog_edit_cb), keyword_dialog); | |
314 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
315 gtk_tree_view_column_add_attribute(column, renderer, "text", 0); | |
316 gtk_tree_view_column_add_attribute(column, renderer, "editable", 1); | |
317 gtk_tree_view_append_column(GTK_TREE_VIEW(keyword_dialog->treeview), column); | |
318 | |
319 gtk_container_add(GTK_CONTAINER(scrolled), keyword_dialog->treeview); | |
320 gtk_widget_show(keyword_dialog->treeview); | |
321 | |
322 hbox = gtk_hbox_new(FALSE, 5); | |
323 gtk_box_pack_start(GTK_BOX(keyword_dialog->gd->vbox), hbox, FALSE, FALSE, 0); | |
324 gtk_widget_show(hbox); | |
325 | |
326 button = gtk_button_new_from_stock(GTK_STOCK_ADD); | |
327 g_signal_connect(G_OBJECT(button), "clicked", | |
328 G_CALLBACK(keyword_dialog_add_cb), keyword_dialog); | |
329 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
330 gtk_widget_show(button); | |
331 | |
332 button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); | |
333 g_signal_connect(G_OBJECT(button), "clicked", | |
334 G_CALLBACK(keyword_dialog_remove_cb), keyword_dialog); | |
335 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
336 gtk_widget_show(button); | |
337 | |
338 keyword_dialog_populate(keyword_dialog); | |
339 | |
340 gtk_widget_show(keyword_dialog->gd->dialog); | |
341 } | |
342 | |
343 | |
344 static void bar_keyword_edit_cb(GtkWidget *button, gpointer data) | |
345 { | |
346 keyword_dialog_show(); | |
347 } | |
348 | |
349 | |
350 /* | |
351 *------------------------------------------------------------------- | |
352 * info bar | |
353 *------------------------------------------------------------------- | |
354 */ | |
355 | |
356 typedef enum { | |
357 BAR_SORT_COPY, | |
358 BAR_SORT_MOVE, | |
359 BAR_SORT_LINK | |
360 } SortActionType; | |
361 | |
362 enum { | |
363 KEYWORD_COLUMN_TOGGLE = 0, | |
364 KEYWORD_COLUMN_TEXT | |
365 }; | |
366 | |
367 typedef struct _BarInfoData BarInfoData; | |
368 struct _BarInfoData | |
369 { | |
370 GtkWidget *vbox; | |
371 GtkWidget *group_box; | |
372 GtkWidget *label_file_name; | |
373 GtkWidget *label_file_time; | |
374 | |
375 GtkWidget *keyword_view; | |
376 GtkWidget *keyword_treeview; | |
377 | |
378 GtkWidget *comment_view; | |
379 | |
380 GtkWidget *button_save; | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
381 GtkWidget *button_set_keywords_add; |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
382 GtkWidget *button_set_keywords_replace; |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
383 GtkWidget *button_set_comment_add; |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
384 GtkWidget *button_set_comment_replace; |
9 | 385 |
138 | 386 FileData *fd; |
9 | 387 |
388 gint changed; | |
389 gint save_timeout_id; | |
390 | |
391 GList *(*list_func)(gpointer); | |
392 gpointer list_data; | |
393 }; | |
394 | |
395 | |
396 static GList *bar_list = NULL; | |
397 | |
398 | |
399 static void bar_info_write(BarInfoData *bd) | |
400 { | |
401 GList *list; | |
402 gchar *comment; | |
403 | |
138 | 404 if (!bd->fd) return; |
9 | 405 |
406 list = keyword_list_pull(bd->keyword_view); | |
407 comment = comment_pull(bd->comment_view); | |
408 | |
1191
bb02d0e2a573
Rename most comment_*() functions to more appropriate metadata_*().
zas_
parents:
1178
diff
changeset
|
409 metadata_write(bd->fd, list, comment); |
9 | 410 |
138 | 411 string_list_free(list); |
9 | 412 g_free(comment); |
413 | |
414 bd->changed = FALSE; | |
415 gtk_widget_set_sensitive(bd->button_save, FALSE); | |
416 } | |
417 | |
418 static gint bar_info_autosave(gpointer data) | |
419 { | |
420 BarInfoData *bd = data; | |
421 | |
422 bar_info_write(bd); | |
423 | |
424 bd->save_timeout_id = -1; | |
425 | |
426 return FALSE; | |
427 } | |
428 | |
429 static void bar_info_save_update(BarInfoData *bd, gint enable) | |
430 { | |
431 if (bd->save_timeout_id != -1) | |
432 { | |
433 g_source_remove(bd->save_timeout_id); | |
434 bd->save_timeout_id = -1; | |
435 } | |
436 if (enable) | |
437 { | |
438 bd->save_timeout_id = g_timeout_add(BAR_KEYWORD_AUTOSAVE_TIME, bar_info_autosave, bd); | |
439 } | |
440 } | |
441 | |
442 static void bar_keyword_list_sync(BarInfoData *bd, GList *keywords) | |
443 { | |
444 GList *list; | |
445 GtkListStore *store; | |
446 GtkTreeIter iter; | |
447 | |
448 list = history_list_get_by_key("keywords"); | |
449 if (!list) | |
450 { | |
451 /* blank? set up a few example defaults */ | |
452 | |
453 gint i = 0; | |
454 | |
455 while (keyword_favorite_defaults[i] != NULL) | |
456 { | |
457 history_list_add_to_key("keywords", _(keyword_favorite_defaults[i]), 0); | |
458 i++; | |
459 } | |
460 | |
461 list = history_list_get_by_key("keywords"); | |
462 } | |
463 | |
464 store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(bd->keyword_treeview))); | |
465 | |
466 gtk_list_store_clear(store); | |
467 | |
468 list = g_list_last(list); | |
469 while (list) | |
470 { | |
471 gchar *key = list->data; | |
472 | |
473 gtk_list_store_append(store, &iter); | |
1193
aed0e28b2744
keyword_list_find() -> find_string_in_list(), return gboolean.
zas_
parents:
1192
diff
changeset
|
474 gtk_list_store_set(store, &iter, KEYWORD_COLUMN_TOGGLE, find_string_in_list(keywords, key), |
9 | 475 KEYWORD_COLUMN_TEXT, key, -1); |
476 | |
477 list = list->prev; | |
478 } | |
479 } | |
480 | |
481 static void bar_info_keyword_update_all(void) | |
482 { | |
483 GList *work; | |
484 | |
485 work = bar_list; | |
486 while (work) | |
487 { | |
488 BarInfoData *bd; | |
489 GList *keywords; | |
490 | |
491 bd = work->data; | |
492 work = work->next; | |
493 | |
494 keywords = keyword_list_pull(bd->keyword_view); | |
495 bar_keyword_list_sync(bd, keywords); | |
138 | 496 string_list_free(keywords); |
9 | 497 } |
498 } | |
499 | |
500 static void bar_info_update(BarInfoData *bd) | |
501 { | |
502 GList *keywords = NULL; | |
503 gchar *comment = NULL; | |
504 | |
505 if (bd->label_file_name) | |
506 { | |
138 | 507 gtk_label_set_text(GTK_LABEL(bd->label_file_name), (bd->fd) ? bd->fd->name : ""); |
9 | 508 } |
509 if (bd->label_file_time) | |
510 { | |
138 | 511 gtk_label_set_text(GTK_LABEL(bd->label_file_time), (bd->fd) ? text_from_time(bd->fd->date) : ""); |
9 | 512 } |
513 | |
1191
bb02d0e2a573
Rename most comment_*() functions to more appropriate metadata_*().
zas_
parents:
1178
diff
changeset
|
514 if (metadata_read(bd->fd, &keywords, &comment)) |
9 | 515 { |
516 keyword_list_push(bd->keyword_view, keywords); | |
517 gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(bd->comment_view)), | |
518 (comment) ? comment : "", -1); | |
519 | |
520 bar_keyword_list_sync(bd, keywords); | |
521 | |
138 | 522 string_list_free(keywords); |
9 | 523 g_free(comment); |
524 } | |
525 else | |
526 { | |
527 gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(bd->keyword_view)), "", -1); | |
528 gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(bd->comment_view)), "", -1); | |
529 | |
530 bar_keyword_list_sync(bd, NULL); | |
531 } | |
532 | |
533 bar_info_save_update(bd, FALSE); | |
534 bd->changed = FALSE; | |
535 gtk_widget_set_sensitive(bd->button_save, FALSE); | |
536 | |
138 | 537 gtk_widget_set_sensitive(bd->group_box, (bd->fd != NULL)); |
9 | 538 } |
539 | |
138 | 540 void bar_info_set(GtkWidget *bar, FileData *fd) |
9 | 541 { |
542 BarInfoData *bd; | |
543 | |
544 bd = g_object_get_data(G_OBJECT(bar), "bar_info_data"); | |
545 if (!bd) return; | |
546 | |
547 if (bd->changed) bar_info_write(bd); | |
548 | |
138 | 549 file_data_unref(bd->fd); |
550 bd->fd = file_data_ref(fd); | |
9 | 551 |
552 bar_info_update(bd); | |
553 } | |
554 | |
138 | 555 void bar_info_maint_renamed(GtkWidget *bar, FileData *fd) |
9 | 556 { |
557 BarInfoData *bd; | |
558 | |
559 bd = g_object_get_data(G_OBJECT(bar), "bar_info_data"); | |
560 if (!bd) return; | |
561 | |
138 | 562 file_data_unref(bd->fd); |
563 bd->fd = file_data_ref(fd); | |
9 | 564 |
565 if (bd->label_file_name) | |
566 { | |
138 | 567 gtk_label_set_text(GTK_LABEL(bd->label_file_name), (bd->fd) ? bd->fd->name : ""); |
9 | 568 } |
569 } | |
570 | |
571 gint bar_info_event(GtkWidget *bar, GdkEvent *event) | |
572 { | |
573 BarInfoData *bd; | |
574 | |
575 bd = g_object_get_data(G_OBJECT(bar), "bar_info_data"); | |
576 if (!bd) return FALSE; | |
577 | |
578 if (GTK_WIDGET_HAS_FOCUS(bd->keyword_view)) return gtk_widget_event(bd->keyword_view, event); | |
579 if (GTK_WIDGET_HAS_FOCUS(bd->comment_view)) return gtk_widget_event(bd->comment_view, event); | |
580 | |
581 return FALSE; | |
582 } | |
583 | |
584 static void bar_info_keyword_set(BarInfoData *bd, const gchar *keyword, gint active) | |
585 { | |
586 GList *list; | |
587 gint found; | |
588 | |
589 if (!keyword) return; | |
590 | |
591 list = keyword_list_pull(bd->keyword_view); | |
1193
aed0e28b2744
keyword_list_find() -> find_string_in_list(), return gboolean.
zas_
parents:
1192
diff
changeset
|
592 found = find_string_in_list(list, keyword); |
9 | 593 |
594 if (active != found) | |
595 { | |
596 if (found) | |
597 { | |
598 GList *work = list; | |
599 | |
600 while (work) | |
601 { | |
602 gchar *key = work->data; | |
603 work = work->next; | |
604 | |
605 if (key && keyword && strcmp(key, keyword) == 0) | |
606 { | |
607 list = g_list_remove(list, key); | |
608 g_free(key); | |
609 } | |
610 } | |
611 } | |
612 else | |
613 { | |
614 list = g_list_append(list, g_strdup(keyword)); | |
615 } | |
616 | |
617 keyword_list_push(bd->keyword_view, list); | |
618 } | |
619 | |
138 | 620 string_list_free(list); |
9 | 621 } |
622 | |
623 static void bar_info_keyword_toggle(GtkCellRendererToggle *toggle, const gchar *path, gpointer data) | |
624 { | |
625 BarInfoData *bd = data; | |
626 GtkTreeModel *store; | |
627 GtkTreeIter iter; | |
628 GtkTreePath *tpath; | |
629 gchar *key = NULL; | |
630 gboolean active; | |
631 | |
632 store = gtk_tree_view_get_model(GTK_TREE_VIEW(bd->keyword_treeview)); | |
633 | |
634 tpath = gtk_tree_path_new_from_string(path); | |
635 gtk_tree_model_get_iter(store, &iter, tpath); | |
636 gtk_tree_path_free(tpath); | |
637 | |
638 gtk_tree_model_get(store, &iter, KEYWORD_COLUMN_TOGGLE, &active, | |
639 KEYWORD_COLUMN_TEXT, &key, -1); | |
640 active = (!active); | |
641 gtk_list_store_set(GTK_LIST_STORE(store), &iter, KEYWORD_COLUMN_TOGGLE, active, -1); | |
642 | |
643 bar_info_keyword_set(bd, key, active); | |
644 g_free(key); | |
645 } | |
646 | |
647 static void bar_info_save(GtkWidget *button, gpointer data) | |
648 { | |
649 BarInfoData *bd = data; | |
650 | |
651 bar_info_save_update(bd, FALSE); | |
652 bar_info_write(bd); | |
653 } | |
654 | |
1192
48d62a7e3c33
metadata_set_keywords() -> metadata_set(). Use gboolean type for boolean parameters.
zas_
parents:
1191
diff
changeset
|
655 static void bar_info_set_selection(BarInfoData *bd, gboolean set_keywords, gboolean set_comment, gboolean append) |
9 | 656 { |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
657 GList *keywords = NULL; |
9 | 658 GList *list = NULL; |
659 GList *work; | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
660 gchar *comment = NULL; |
9 | 661 |
662 if (!bd->list_func) return; | |
663 | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
664 if (set_keywords) |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
665 { |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
666 keywords = keyword_list_pull(bd->keyword_view); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
667 } |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
668 |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
669 if (set_comment) |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
670 { |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
671 comment = comment_pull(bd->comment_view); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
672 } |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
673 |
1192
48d62a7e3c33
metadata_set_keywords() -> metadata_set(). Use gboolean type for boolean parameters.
zas_
parents:
1191
diff
changeset
|
674 if (append && !keywords && !comment) return; |
9 | 675 |
676 list = bd->list_func(bd->list_data); | |
677 work = list; | |
678 while (work) | |
679 { | |
138 | 680 FileData *fd = work->data; |
9 | 681 work = work->next; |
682 | |
1192
48d62a7e3c33
metadata_set_keywords() -> metadata_set(). Use gboolean type for boolean parameters.
zas_
parents:
1191
diff
changeset
|
683 metadata_set(fd, keywords, comment, append); |
9 | 684 } |
685 | |
138 | 686 filelist_free(list); |
687 string_list_free(keywords); | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
688 g_free(comment); |
9 | 689 } |
690 | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
691 static void bar_info_set_keywords_add(GtkWidget *button, gpointer data) |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
692 { |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
693 BarInfoData *bd = data; |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
694 |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
695 bar_info_set_selection(bd, TRUE, FALSE, TRUE); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
696 } |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
697 |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
698 static void bar_info_set_keywords_replace(GtkWidget *button, gpointer data) |
9 | 699 { |
700 BarInfoData *bd = data; | |
701 | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
702 bar_info_set_selection(bd, TRUE, FALSE, FALSE); |
9 | 703 } |
704 | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
705 static void bar_info_set_comment_add(GtkWidget *button, gpointer data) |
9 | 706 { |
707 BarInfoData *bd = data; | |
708 | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
709 bar_info_set_selection(bd, FALSE, TRUE, TRUE); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
710 } |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
711 |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
712 static void bar_info_set_comment_replace(GtkWidget *button, gpointer data) |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
713 { |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
714 BarInfoData *bd = data; |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
715 |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
716 bar_info_set_selection(bd, FALSE, TRUE, FALSE); |
9 | 717 } |
718 | |
719 static void bar_info_changed(GtkTextBuffer *buffer, gpointer data) | |
720 { | |
721 BarInfoData *bd = data; | |
722 | |
723 bd->changed = TRUE; | |
724 gtk_widget_set_sensitive(bd->button_save, TRUE); | |
725 | |
726 bar_info_save_update(bd, TRUE); | |
727 } | |
728 | |
729 void bar_info_close(GtkWidget *bar) | |
730 { | |
731 BarInfoData *bd; | |
732 | |
733 bd = g_object_get_data(G_OBJECT(bar), "bar_info_data"); | |
734 if (!bd) return; | |
735 | |
736 gtk_widget_destroy(bd->vbox); | |
737 } | |
738 | |
739 static void bar_info_destroy(GtkWidget *widget, gpointer data) | |
740 { | |
741 BarInfoData *bd = data; | |
742 | |
743 if (bd->changed) bar_info_write(bd); | |
744 bar_info_save_update(bd, FALSE); | |
745 | |
746 bar_list = g_list_remove(bar_list, bd); | |
747 | |
138 | 748 file_data_unref(bd->fd); |
9 | 749 |
750 g_free(bd); | |
751 } | |
752 | |
138 | 753 GtkWidget *bar_info_new(FileData *fd, gint metadata_only, GtkWidget *bounding_widget) |
9 | 754 { |
755 BarInfoData *bd; | |
756 GtkWidget *box; | |
757 GtkWidget *hbox; | |
758 GtkWidget *table; | |
759 GtkWidget *scrolled; | |
760 GtkTextBuffer *buffer; | |
761 GtkWidget *label; | |
762 GtkWidget *tbar; | |
763 GtkListStore *store; | |
764 GtkTreeViewColumn *column; | |
765 GtkCellRenderer *renderer; | |
766 | |
767 bd = g_new0(BarInfoData, 1); | |
768 | |
769 bd->list_func = NULL; | |
770 bd->list_data = NULL; | |
771 | |
772 bd->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); | |
773 g_object_set_data(G_OBJECT(bd->vbox), "bar_info_data", bd); | |
774 g_signal_connect(G_OBJECT(bd->vbox), "destroy", | |
775 G_CALLBACK(bar_info_destroy), bd); | |
776 | |
777 if (!metadata_only) | |
778 { | |
779 hbox = pref_box_new(bd->vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_GAP); | |
780 | |
781 label = sizer_new(bd->vbox, bounding_widget, SIZER_POS_LEFT); | |
782 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
783 gtk_widget_show(label); | |
784 | |
785 label = gtk_label_new(_("Keywords")); | |
786 pref_label_bold(label, TRUE, FALSE); | |
787 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); | |
788 gtk_widget_show(label); | |
789 } | |
790 | |
791 bd->group_box = pref_box_new(bd->vbox, TRUE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); | |
792 | |
793 if (!metadata_only) | |
794 { | |
795 GtkWidget *table; | |
796 | |
797 table = pref_table_new(bd->group_box, 2, 2, FALSE, FALSE); | |
798 | |
799 bd->label_file_name = table_add_line(table, 0, 0, _("Filename:"), NULL); | |
800 bd->label_file_time = table_add_line(table, 0, 1, _("File date:"), NULL); | |
801 } | |
802 else | |
803 { | |
804 bd->label_file_name = NULL; | |
805 bd->label_file_time = NULL; | |
806 } | |
807 | |
808 table = gtk_table_new(3, 1, TRUE); | |
809 gtk_table_set_row_spacings(GTK_TABLE(table), PREF_PAD_GAP); | |
810 gtk_box_pack_start(GTK_BOX(bd->group_box), table, TRUE, TRUE, 0); | |
811 gtk_widget_show(table); | |
812 | |
813 /* keyword entry */ | |
814 | |
815 box = gtk_vbox_new(FALSE, 0); | |
816 gtk_table_attach(GTK_TABLE(table), box, 0, 1, 0, 2, | |
817 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); | |
818 gtk_widget_show(box); | |
819 | |
820 label = pref_label_new(box, _("Keywords:")); | |
821 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); | |
822 pref_label_bold(label, TRUE, FALSE); | |
823 | |
824 hbox = pref_box_new(box, TRUE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_GAP); | |
825 | |
826 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
827 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | |
828 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), | |
829 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
830 gtk_box_pack_start(GTK_BOX(hbox), scrolled, TRUE, TRUE, 0); | |
831 gtk_widget_show(scrolled); | |
832 | |
833 bd->keyword_view = gtk_text_view_new(); | |
834 gtk_container_add(GTK_CONTAINER(scrolled), bd->keyword_view); | |
835 gtk_widget_show(bd->keyword_view); | |
836 | |
837 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(bd->keyword_view)); | |
838 g_signal_connect(G_OBJECT(buffer), "changed", | |
839 G_CALLBACK(bar_info_changed), bd); | |
840 | |
841 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
842 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | |
843 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), | |
844 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
845 gtk_box_pack_start(GTK_BOX(hbox), scrolled, TRUE, TRUE, 0); | |
846 gtk_widget_show(scrolled); | |
847 | |
848 store = gtk_list_store_new(2, G_TYPE_BOOLEAN, G_TYPE_STRING); | |
849 bd->keyword_treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); | |
850 g_object_unref(store); | |
851 | |
852 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(bd->keyword_treeview), FALSE); | |
853 | |
854 if (metadata_only) | |
855 { | |
856 gtk_tree_view_set_search_column(GTK_TREE_VIEW(bd->keyword_treeview), KEYWORD_COLUMN_TEXT); | |
857 } | |
858 else | |
859 { | |
860 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(bd->keyword_treeview), FALSE); | |
861 } | |
862 | |
863 column = gtk_tree_view_column_new(); | |
864 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); | |
865 | |
866 renderer = gtk_cell_renderer_toggle_new(); | |
867 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
868 gtk_tree_view_column_add_attribute(column, renderer, "active", KEYWORD_COLUMN_TOGGLE); | |
869 g_signal_connect(G_OBJECT(renderer), "toggled", | |
870 G_CALLBACK(bar_info_keyword_toggle), bd); | |
871 | |
872 renderer = gtk_cell_renderer_text_new(); | |
873 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
874 gtk_tree_view_column_add_attribute(column, renderer, "text", KEYWORD_COLUMN_TEXT); | |
875 | |
876 gtk_tree_view_append_column(GTK_TREE_VIEW(bd->keyword_treeview), column); | |
877 | |
878 gtk_container_add(GTK_CONTAINER(scrolled), bd->keyword_treeview); | |
879 gtk_widget_show(bd->keyword_treeview); | |
880 | |
881 /* comment entry */ | |
882 | |
883 box = gtk_vbox_new(FALSE, 0); | |
884 gtk_table_attach(GTK_TABLE(table), box, 0, 1, 2, 3, | |
885 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); | |
886 gtk_widget_show(box); | |
887 | |
888 label = pref_label_new(box, _("Comment:")); | |
889 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); | |
890 pref_label_bold(label, TRUE, FALSE); | |
891 | |
892 scrolled = gtk_scrolled_window_new(NULL, NULL); | |
893 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | |
894 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), | |
895 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
896 gtk_box_pack_start(GTK_BOX(box), scrolled, TRUE, TRUE, 0); | |
897 gtk_widget_show(scrolled); | |
898 | |
899 bd->comment_view = gtk_text_view_new(); | |
900 gtk_container_add(GTK_CONTAINER(scrolled), bd->comment_view); | |
901 gtk_widget_show(bd->comment_view); | |
902 | |
903 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(bd->comment_view)); | |
904 g_signal_connect(G_OBJECT(buffer), "changed", | |
905 G_CALLBACK(bar_info_changed), bd); | |
906 | |
907 /* toolbar */ | |
908 | |
909 tbar = pref_toolbar_new(bd->group_box, GTK_TOOLBAR_ICONS); | |
910 | |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
911 pref_toolbar_button(tbar, GTK_STOCK_INDEX, NULL, FALSE, |
9 | 912 _("Edit favorite keywords list."), |
913 G_CALLBACK(bar_keyword_edit_cb), bd); | |
914 pref_toolbar_spacer(tbar); | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
915 bd->button_set_keywords_add = pref_toolbar_button(tbar, GTK_STOCK_ADD, NULL, FALSE, |
9 | 916 _("Add keywords to selected files"), |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
917 G_CALLBACK(bar_info_set_keywords_add), bd); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
918 bd->button_set_keywords_replace = pref_toolbar_button(tbar, GTK_STOCK_CONVERT, NULL, FALSE, |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
919 _("Add keywords to selected files, replacing existing ones"), |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
920 G_CALLBACK(bar_info_set_keywords_replace), bd); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
921 bd->button_set_comment_add = pref_toolbar_button(tbar, GTK_STOCK_DND_MULTIPLE, NULL, FALSE, |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
922 _("Add comment to selected files"), |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
923 G_CALLBACK(bar_info_set_comment_add), bd); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
924 bd->button_set_comment_replace = pref_toolbar_button(tbar, GTK_STOCK_DND, NULL, FALSE, |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
925 _("Add comment to selected files, replacing existing one"), |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
926 G_CALLBACK(bar_info_set_comment_replace), bd); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
927 |
9 | 928 pref_toolbar_spacer(tbar); |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
929 bd->button_save = pref_toolbar_button(tbar, GTK_STOCK_SAVE, NULL, FALSE, |
9 | 930 _("Save comment now"), |
931 G_CALLBACK(bar_info_save), bd); | |
932 | |
933 bd->save_timeout_id = -1; | |
934 | |
138 | 935 bd->fd = file_data_ref(fd); |
9 | 936 bar_info_update(bd); |
937 | |
938 bar_info_selection(bd->vbox, 0); | |
939 | |
940 bar_list = g_list_append(bar_list, bd); | |
442 | 941 |
9 | 942 return bd->vbox; |
943 } | |
944 | |
945 void bar_info_set_selection_func(GtkWidget *bar, GList *(*list_func)(gpointer data), gpointer data) | |
946 { | |
947 BarInfoData *bd; | |
948 | |
949 bd = g_object_get_data(G_OBJECT(bar), "bar_info_data"); | |
950 if (!bd) return; | |
951 | |
952 bd->list_func = list_func; | |
953 bd->list_data = data; | |
954 } | |
955 | |
956 void bar_info_selection(GtkWidget *bar, gint count) | |
957 { | |
958 BarInfoData *bd; | |
959 gint enable; | |
960 | |
961 bd = g_object_get_data(G_OBJECT(bar), "bar_info_data"); | |
962 if (!bd) return; | |
963 | |
964 enable = (count > 0 && bd->list_func != NULL); | |
965 | |
595
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
966 gtk_widget_set_sensitive(bd->button_set_keywords_add, enable); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
967 gtk_widget_set_sensitive(bd->button_set_keywords_replace, enable); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
968 gtk_widget_set_sensitive(bd->button_set_comment_add, enable); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
969 gtk_widget_set_sensitive(bd->button_set_comment_replace, enable); |
15766932414c
Allow the user to append or replace comments for a group of selected files.
zas_
parents:
594
diff
changeset
|
970 |
9 | 971 } |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1051
diff
changeset
|
972 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |