Mercurial > geeqie
annotate src/bar_sort.c @ 48:6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
* bar_exif.c: Set a default size for the EXIF data column in the
advanced view, and allow resizing of that column to allow more data to
be visible when needed.
* format_canon.c: Fix data type for Canon MakerNote Serial Number.
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
##### an offical release when making enhancements and translation updates. #####
author | gqview |
---|---|
date | Fri, 03 Jun 2005 22:48:37 +0000 |
parents | 6281cc38e5ca |
children | f63ecca6c087 |
rev | line source |
---|---|
9 | 1 /* |
2 * GQview | |
3 * (C) 2004 John Ellis | |
4 * | |
5 * Author: John Ellis | |
6 * | |
7 * This software is released under the GNU General Public License (GNU GPL). | |
8 * Please read the included file COPYING for more information. | |
9 * This software comes with no warranty of any kind, use at your own risk! | |
10 */ | |
11 | |
12 | |
13 #include "gqview.h" | |
14 #include "bar_sort.h" | |
15 | |
16 #include "collect.h" | |
17 #include "collect-io.h" | |
18 #include "filelist.h" | |
19 #include "layout.h" | |
20 #include "layout_image.h" | |
21 #include "utilops.h" | |
22 #include "ui_bookmark.h" | |
23 #include "ui_fileops.h" | |
24 #include "ui_menu.h" | |
25 #include "ui_misc.h" | |
26 | |
27 | |
28 /* | |
29 *------------------------------------------------------------------- | |
30 * sort bar | |
31 *------------------------------------------------------------------- | |
32 */ | |
33 | |
34 typedef enum { | |
35 BAR_SORT_MODE_FOLDER = 0, | |
36 BAR_SORT_MODE_COLLECTION | |
37 } SortModeType; | |
38 | |
39 typedef enum { | |
40 BAR_SORT_COPY, | |
41 BAR_SORT_MOVE, | |
42 BAR_SORT_LINK | |
43 } SortActionType; | |
44 | |
45 typedef enum { | |
46 BAR_SORT_SELECTION_IMAGE, | |
47 BAR_SORT_SELECTION_SELECTED | |
48 } SortSelectionType; | |
49 | |
50 typedef struct _SortData SortData; | |
51 struct _SortData | |
52 { | |
53 GtkWidget *vbox; | |
54 GtkWidget *bookmarks; | |
55 LayoutWindow *lw; | |
56 | |
57 FileDialog *dialog; | |
58 GtkWidget *dialog_name_entry; | |
59 | |
60 SortModeType mode; | |
61 SortActionType action; | |
62 SortSelectionType selection; | |
63 | |
64 GtkWidget *folder_group; | |
65 GtkWidget *collection_group; | |
66 | |
67 GtkWidget *add_button; | |
68 GtkWidget *undo_button; | |
69 SortActionType undo_action; | |
70 GList *undo_src_list; | |
71 gchar *undo_src; | |
72 gchar *undo_dest; | |
73 }; | |
74 | |
75 | |
76 #define SORT_KEY_FOLDERS "sort_manager" | |
77 #define SORT_KEY_COLLECTIONS "sort_manager_collections" | |
78 | |
79 | |
80 static gint bar_sort_mode_state = BAR_SORT_MODE_FOLDER; | |
81 static gint bar_sort_action_state = BAR_SORT_COPY; | |
82 static gint bar_sort_selection_state = BAR_SORT_SELECTION_IMAGE; | |
83 | |
84 | |
85 static void bar_sort_undo_set(SortData *sd, GList *src_list, const gchar *src, const gchar *dest); | |
86 static void bar_sort_add_close(SortData *sd); | |
87 | |
88 | |
89 static void bar_sort_collection_list_build(GtkWidget *bookmarks) | |
90 { | |
91 gchar *collect_path; | |
92 GList *list = NULL; | |
93 GList *work; | |
94 | |
95 history_list_free_key(SORT_KEY_COLLECTIONS); | |
96 bookmark_list_set_key(bookmarks, SORT_KEY_COLLECTIONS); | |
97 | |
98 collect_path = g_strconcat(homedir(), "/", GQVIEW_RC_DIR_COLLECTIONS, NULL); | |
99 path_list(collect_path, &list, NULL); | |
100 g_free(collect_path); | |
101 | |
102 list = path_list_sort(list); | |
103 | |
104 work = list; | |
105 while (work) | |
106 { | |
107 const gchar *path; | |
108 gchar *name; | |
109 | |
110 path = work->data; | |
111 work = work->next; | |
112 | |
113 if (file_extension_match(path, ".gqv")) | |
114 { | |
115 name = remove_extension_from_path(filename_from_path(path)); | |
116 } | |
117 else | |
118 { | |
119 name = g_strdup(filename_from_path(path)); | |
120 } | |
121 bookmark_list_add(bookmarks, name, path); | |
122 g_free(name); | |
123 } | |
124 | |
125 path_list_free(list); | |
126 } | |
127 | |
128 static void bar_sort_mode_sync(SortData *sd, SortModeType mode) | |
129 { | |
130 gint folder_mode; | |
131 | |
132 if (sd->mode == mode) return; | |
133 sd->mode = mode; | |
134 | |
135 folder_mode = (sd->mode == BAR_SORT_MODE_FOLDER); | |
136 | |
137 bookmark_list_set_no_defaults(sd->bookmarks, !folder_mode); | |
138 bookmark_list_set_editable(sd->bookmarks, folder_mode); | |
139 | |
140 if (folder_mode) | |
141 { | |
142 gtk_widget_hide(sd->collection_group); | |
143 gtk_widget_show(sd->folder_group); | |
144 bookmark_list_set_key(sd->bookmarks, SORT_KEY_FOLDERS ); | |
145 } | |
146 else | |
147 { | |
148 gtk_widget_hide(sd->folder_group); | |
149 gtk_widget_show(sd->collection_group); | |
150 bar_sort_collection_list_build(sd->bookmarks); | |
151 } | |
152 | |
153 bar_sort_add_close(sd); | |
154 | |
155 bar_sort_undo_set(sd, NULL, NULL, NULL); | |
156 } | |
157 | |
158 static void bar_sort_mode_cb(GtkWidget *combo, gpointer data) | |
159 { | |
160 SortData *sd = data; | |
161 | |
162 if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == BAR_SORT_MODE_FOLDER) | |
163 { | |
164 bar_sort_mode_sync(sd, BAR_SORT_MODE_FOLDER); | |
165 } | |
166 else | |
167 { | |
168 bar_sort_mode_sync(sd, BAR_SORT_MODE_COLLECTION); | |
169 } | |
170 } | |
171 | |
172 /* this takes control of src_list */ | |
173 static void bar_sort_undo_set(SortData *sd, GList *src_list, const gchar *src, const gchar *dest) | |
174 { | |
175 path_list_free(sd->undo_src_list); | |
176 sd->undo_src_list = src_list; | |
177 | |
178 g_free(sd->undo_src); | |
179 sd->undo_src = g_strdup(src); | |
180 g_free(sd->undo_dest); | |
181 sd->undo_dest = g_strdup(dest); | |
182 | |
183 sd->undo_action = sd->action; | |
184 | |
185 if (sd->undo_button) | |
186 { | |
187 gtk_widget_set_sensitive(sd->undo_button, | |
188 ((sd->undo_src_list || sd->undo_src) && sd->undo_dest) ); | |
189 } | |
190 } | |
191 | |
192 static void bar_sort_undo_folder(SortData *sd, GtkWidget *button) | |
193 { | |
194 if (!sd->undo_src || !sd->undo_dest) return; | |
195 | |
196 switch (sd->undo_action) | |
197 { | |
198 case BAR_SORT_MOVE: | |
199 { | |
200 GList *list; | |
201 gchar *src_dir; | |
202 | |
203 list = g_list_append(NULL, g_strdup(sd->undo_dest)); | |
204 src_dir = remove_level_from_path(sd->undo_src); | |
205 file_util_move_simple(list, src_dir); | |
206 g_free(src_dir); | |
207 } | |
208 break; | |
209 case BAR_SORT_COPY: | |
210 file_util_delete(sd->undo_dest, NULL, button); | |
211 break; | |
212 case BAR_SORT_LINK: | |
213 if (!unlink_file(sd->undo_dest)) | |
214 { | |
215 gchar *buf; | |
216 | |
217 buf = g_strdup_printf("Unable to remove symbolic link:\n%s", sd->undo_dest); | |
218 file_util_warning_dialog(_("Unlink failed"), buf, GTK_STOCK_DIALOG_ERROR, button); | |
219 g_free(buf); | |
220 } | |
221 break; | |
222 } | |
223 | |
224 layout_refresh(sd->lw); | |
225 | |
226 if (isfile(sd->undo_src)) | |
227 { | |
228 layout_image_set_path(sd->lw, sd->undo_src); | |
229 } | |
230 | |
231 bar_sort_undo_set(sd, NULL, NULL, NULL); | |
232 } | |
233 | |
234 static void bar_sort_undo_collection(SortData *sd) | |
235 { | |
236 GList *work; | |
237 | |
238 work = sd->undo_src_list; | |
239 while (work) | |
240 { | |
241 gchar *source; | |
242 | |
243 source = work->data; | |
244 work = work->next; | |
245 collect_manager_remove(source, sd->undo_dest); | |
246 } | |
247 | |
248 bar_sort_undo_set(sd, NULL, NULL, NULL); | |
249 } | |
250 | |
251 static void bar_sort_undo_cb(GtkWidget *button, gpointer data) | |
252 { | |
253 SortData *sd = data; | |
254 | |
255 if (sd->mode == BAR_SORT_MODE_FOLDER) | |
256 { | |
257 bar_sort_undo_folder(sd, button); | |
258 } | |
259 else | |
260 { | |
261 bar_sort_undo_collection(sd); | |
262 } | |
263 } | |
264 | |
265 static void bar_sort_bookmark_select_folder(SortData *sd, const gchar *source, const gchar *path) | |
266 { | |
267 GList *list; | |
268 gchar *dest_path; | |
269 | |
270 if (!isdir(path)) return; | |
271 | |
272 dest_path = concat_dir_and_file(path, filename_from_path(source)); | |
273 bar_sort_undo_set(sd, NULL, source, dest_path); | |
274 | |
275 list = g_list_append(NULL, g_strdup(source)); | |
276 | |
277 switch (sd->action) | |
278 { | |
279 case BAR_SORT_COPY: | |
280 file_util_copy_simple(list, path); | |
281 list = NULL; | |
282 layout_image_next(sd->lw); | |
283 break; | |
284 case BAR_SORT_MOVE: | |
285 file_util_move_simple(list, path); | |
286 list = NULL; | |
287 break; | |
288 case BAR_SORT_LINK: | |
289 if (symlink_utf8(source, dest_path)) | |
290 { | |
291 layout_image_next(sd->lw); | |
292 } | |
293 else | |
294 { | |
295 gchar *buf; | |
296 | |
297 buf = g_strdup_printf("Unable to create symbolic link:\n%s", dest_path); | |
298 file_util_warning_dialog(_("Link failed"), buf, GTK_STOCK_DIALOG_ERROR, sd->bookmarks); | |
299 | |
300 g_free(buf); | |
301 } | |
302 break; | |
303 } | |
304 | |
305 g_list_free(list); | |
306 g_free(dest_path); | |
307 } | |
308 | |
309 static void bar_sort_bookmark_select_collection(SortData *sd, const gchar *source, const gchar *path) | |
310 { | |
311 GList *list = NULL; | |
312 | |
313 switch (sd->selection) | |
314 { | |
315 case BAR_SORT_SELECTION_IMAGE: | |
316 list = g_list_append(NULL, g_strdup(source)); | |
317 break; | |
318 case BAR_SORT_SELECTION_SELECTED: | |
319 list = layout_selection_list(sd->lw); | |
320 break; | |
321 } | |
322 | |
323 if (!list) | |
324 { | |
325 bar_sort_undo_set(sd, NULL, NULL, NULL); | |
326 return; | |
327 } | |
328 | |
329 bar_sort_undo_set(sd, list, NULL, path); | |
330 | |
331 while (list) | |
332 { | |
333 gchar *image_path; | |
334 | |
335 image_path = list->data; | |
336 list = list->next; | |
337 collect_manager_add(image_path, path); | |
338 } | |
339 } | |
340 | |
341 static void bar_sort_bookmark_select(const gchar *path, gpointer data) | |
342 { | |
343 SortData *sd = data; | |
344 const gchar *source; | |
345 | |
346 source = layout_image_get_path(sd->lw); | |
347 if (!path || !source) return; | |
348 | |
349 if (sd->mode == BAR_SORT_MODE_FOLDER) | |
350 { | |
351 bar_sort_bookmark_select_folder(sd, source, path); | |
352 } | |
353 else | |
354 { | |
355 bar_sort_bookmark_select_collection(sd, source, path); | |
356 } | |
357 } | |
358 | |
359 static void bar_sort_set_copy_cb(GtkWidget *button, gpointer data) | |
360 { | |
361 SortData *sd = data; | |
362 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return; | |
363 sd->action = BAR_SORT_COPY; | |
364 } | |
365 | |
366 static void bar_sort_set_move_cb(GtkWidget *button, gpointer data) | |
367 { | |
368 SortData *sd = data; | |
369 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return; | |
370 sd->action = BAR_SORT_MOVE; | |
371 } | |
372 | |
373 static void bar_sort_set_link_cb(GtkWidget *button, gpointer data) | |
374 { | |
375 SortData *sd = data; | |
376 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return; | |
377 sd->action = BAR_SORT_LINK; | |
378 } | |
379 | |
380 static void bar_sort_set_selection_image_cb(GtkWidget *button, gpointer data) | |
381 { | |
382 SortData *sd = data; | |
383 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return; | |
384 sd->selection = BAR_SORT_SELECTION_IMAGE; | |
385 } | |
386 | |
387 static void bar_sort_set_selection_selected_cb(GtkWidget *button, gpointer data) | |
388 { | |
389 SortData *sd = data; | |
390 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) return; | |
391 sd->selection = BAR_SORT_SELECTION_SELECTED; | |
392 } | |
393 | |
394 static void bar_sort_add_close(SortData *sd) | |
395 { | |
396 if (sd->dialog) file_dialog_close(sd->dialog); | |
397 sd->dialog_name_entry = NULL; | |
398 sd->dialog = NULL; | |
399 } | |
400 | |
401 static void bar_sort_add_ok_cb(FileDialog *fd, gpointer data) | |
402 { | |
403 SortData *sd = data; | |
404 const gchar *name; | |
405 | |
406 name = gtk_entry_get_text(GTK_ENTRY(sd->dialog_name_entry)); | |
407 if (sd->mode == BAR_SORT_MODE_FOLDER) | |
408 { | |
409 if (strlen(name) == 0) | |
410 { | |
411 name = filename_from_path(fd->dest_path); | |
412 } | |
413 | |
414 bookmark_list_add(sd->bookmarks, name, fd->dest_path); | |
415 } | |
416 else | |
417 { | |
418 gchar *path; | |
419 gchar *ext; | |
420 | |
421 if (strlen(name) == 0) return; | |
422 | |
423 if (file_extension_match(name, ".gqv")) | |
424 { | |
425 ext = NULL; | |
426 } | |
427 else | |
428 { | |
429 ext = ".gqv"; | |
430 } | |
431 | |
432 path = g_strconcat(homedir(), "/", GQVIEW_RC_DIR_COLLECTIONS, "/", name, ext, NULL); | |
433 if (isfile(path)) | |
434 { | |
435 gchar *text = g_strdup_printf(_("The collection:\n%s\nalready exists."), name); | |
436 file_util_warning_dialog(_("Collection exists"), text, GTK_STOCK_DIALOG_INFO, NULL); | |
437 g_free(text); | |
438 } | |
439 else | |
440 { | |
441 CollectionData *cd; | |
442 | |
443 cd = collection_new(path); | |
444 if (collection_save(cd, path)) | |
445 { | |
446 bar_sort_collection_list_build(sd->bookmarks); | |
447 } | |
448 else | |
449 { | |
450 gchar *text = g_strdup_printf(_("Failed to save the collection:\n%s"), path); | |
451 file_util_warning_dialog(_("Save Failed"), text, | |
452 GTK_STOCK_DIALOG_ERROR, GENERIC_DIALOG(fd)->dialog); | |
453 g_free(text); | |
454 } | |
455 collection_unref(cd); | |
456 } | |
457 | |
458 g_free(path); | |
459 } | |
460 | |
461 bar_sort_add_close(sd); | |
462 } | |
463 | |
464 static void bar_sort_add_cancel_cb(FileDialog *fd, gpointer data) | |
465 { | |
466 SortData *sd = data; | |
467 | |
468 bar_sort_add_close(sd); | |
469 } | |
470 | |
471 static void bar_sort_add_cb(GtkWidget *button, gpointer data) | |
472 { | |
473 SortData *sd = data; | |
474 GtkWidget *hbox; | |
475 const gchar *title; | |
476 | |
477 if (sd->dialog) | |
478 { | |
479 gtk_window_present(GTK_WINDOW(GENERIC_DIALOG(sd->dialog)->dialog)); | |
480 return; | |
481 } | |
482 | |
483 if (sd->mode == BAR_SORT_MODE_FOLDER) | |
484 { | |
485 title = _("Add Bookmark"); | |
486 } | |
487 else | |
488 { | |
489 title = _("Add Collection"); | |
490 } | |
491 | |
492 sd->dialog = file_util_file_dlg(title, | |
493 "gqview", "add_bookmark", button, | |
494 bar_sort_add_cancel_cb, sd); | |
495 file_dialog_add_button(sd->dialog, GTK_STOCK_OK, NULL, bar_sort_add_ok_cb, TRUE); | |
496 | |
497 generic_dialog_add_message(GENERIC_DIALOG(sd->dialog), NULL, title, NULL); | |
498 | |
499 if (sd->mode == BAR_SORT_MODE_FOLDER) | |
500 { | |
501 file_dialog_add_path_widgets(sd->dialog, NULL, NULL, "add_bookmark", NULL, NULL); | |
502 } | |
503 | |
504 hbox = pref_box_new(GENERIC_DIALOG(sd->dialog)->vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_GAP); | |
505 | |
506 pref_label_new(hbox, _("Name:")); | |
507 | |
508 sd->dialog_name_entry = gtk_entry_new(); | |
509 gtk_box_pack_start(GTK_BOX(hbox), sd->dialog_name_entry, TRUE, TRUE, 0); | |
510 generic_dialog_attach_default(GENERIC_DIALOG(sd->dialog), sd->dialog_name_entry); | |
511 gtk_widget_show(sd->dialog_name_entry); | |
512 | |
513 if (sd->mode == BAR_SORT_MODE_COLLECTION) | |
514 { | |
515 gtk_widget_grab_focus(sd->dialog_name_entry); | |
516 } | |
517 | |
518 gtk_widget_show(GENERIC_DIALOG(sd->dialog)->dialog); | |
519 } | |
520 | |
521 void bar_sort_close(GtkWidget *bar) | |
522 { | |
523 SortData *sd; | |
524 | |
525 sd = g_object_get_data(G_OBJECT(bar), "bar_sort_data"); | |
526 if (!sd) return; | |
527 | |
528 gtk_widget_destroy(sd->vbox); | |
529 } | |
530 | |
531 static void bar_sort_destroy(GtkWidget *widget, gpointer data) | |
532 { | |
533 SortData *sd = data; | |
534 | |
535 bar_sort_add_close(sd); | |
536 bar_sort_mode_state = sd->mode; | |
537 bar_sort_action_state = sd->action; | |
538 bar_sort_selection_state = sd->selection; | |
539 | |
540 g_free(sd->undo_src); | |
541 g_free(sd->undo_dest); | |
542 g_free(sd); | |
543 } | |
544 | |
545 GtkWidget *bar_sort_new(LayoutWindow *lw) | |
546 { | |
547 SortData *sd; | |
548 GtkWidget *buttongrp; | |
549 GtkWidget *label; | |
550 GtkWidget *tbar; | |
551 GtkWidget *combo; | |
552 | |
553 if (!lw) return NULL; | |
554 | |
555 sd = g_new0(SortData, 1); | |
556 | |
557 sd->lw = lw; | |
558 sd->action = bar_sort_action_state; | |
559 sd->selection = bar_sort_selection_state; | |
560 sd->undo_src = NULL; | |
561 sd->undo_dest = NULL; | |
562 | |
563 sd->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); | |
564 g_object_set_data(G_OBJECT(sd->vbox), "bar_sort_data", sd); | |
565 g_signal_connect(G_OBJECT(sd->vbox), "destroy", | |
566 G_CALLBACK(bar_sort_destroy), sd); | |
567 | |
568 label = gtk_label_new(_("Sort Manager")); | |
569 pref_label_bold(label, TRUE, FALSE); | |
570 gtk_box_pack_start(GTK_BOX(sd->vbox), label, FALSE, FALSE, 0); | |
571 gtk_widget_show(label); | |
572 | |
573 combo = gtk_combo_box_new_text(); | |
574 gtk_box_pack_start(GTK_BOX(sd->vbox), combo, FALSE, FALSE, 0); | |
575 gtk_widget_show(combo); | |
576 | |
577 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Folders")); | |
578 gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Collections")); | |
579 | |
580 g_signal_connect(G_OBJECT(combo), "changed", | |
581 G_CALLBACK(bar_sort_mode_cb), sd); | |
582 | |
583 sd->folder_group = pref_box_new(sd->vbox, FALSE, GTK_ORIENTATION_VERTICAL, 0); | |
584 | |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
585 buttongrp = pref_radiobutton_new(sd->folder_group, NULL, |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
586 _("Copy"), (sd->action == BAR_SORT_COPY), |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
587 G_CALLBACK(bar_sort_set_copy_cb), sd); |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
588 pref_radiobutton_new(sd->folder_group, buttongrp, |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
589 _("Move"), (sd->action == BAR_SORT_MOVE), |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
590 G_CALLBACK(bar_sort_set_move_cb), sd); |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
591 pref_radiobutton_new(sd->folder_group, buttongrp, |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
592 _("Link"), (sd->action == BAR_SORT_LINK), |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
593 G_CALLBACK(bar_sort_set_link_cb), sd); |
9 | 594 |
595 sd->collection_group = pref_box_new(sd->vbox, FALSE, GTK_ORIENTATION_VERTICAL, 0); | |
596 | |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
597 buttongrp = pref_radiobutton_new(sd->collection_group, NULL, |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
598 _("Add image"), (sd->selection == BAR_SORT_SELECTION_IMAGE), |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
599 G_CALLBACK(bar_sort_set_selection_image_cb), sd); |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
600 pref_radiobutton_new(sd->collection_group, buttongrp, |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
601 _("Add selection"), (sd->selection == BAR_SORT_SELECTION_SELECTED), |
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
602 G_CALLBACK(bar_sort_set_selection_selected_cb), sd); |
9 | 603 |
604 sd->bookmarks = bookmark_list_new(SORT_KEY_FOLDERS, bar_sort_bookmark_select, sd); | |
605 gtk_box_pack_start(GTK_BOX(sd->vbox), sd->bookmarks, TRUE, TRUE, 0); | |
606 gtk_widget_show(sd->bookmarks); | |
607 | |
608 tbar = pref_toolbar_new(sd->vbox, GTK_TOOLBAR_ICONS); | |
609 | |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
610 sd->add_button = pref_toolbar_button(tbar, GTK_STOCK_ADD, NULL, FALSE, |
9 | 611 _("Add Bookmark"), |
612 G_CALLBACK(bar_sort_add_cb), sd); | |
41
6281cc38e5ca
Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
613 sd->undo_button = pref_toolbar_button(tbar, GTK_STOCK_UNDO, NULL, FALSE, |
9 | 614 _("Undo last image"), |
615 G_CALLBACK(bar_sort_undo_cb), sd); | |
616 | |
617 sd->mode = -1; | |
618 bar_sort_mode_sync(sd, bar_sort_mode_state); | |
619 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), sd->mode); | |
620 | |
621 return sd->vbox; | |
622 } | |
623 |