11 /* config memory values */
12 static gint startup_path_enable_c;
13 static gint confirm_delete_c;
14 static gint restore_tool_c;
15 static gint save_window_positions_c;
16 static gint zoom_mode_c;
17 static gint fit_window_c;
18 static gint limit_window_size_c;
19 static gint max_window_size_c;
20 static gint progressive_key_scrolling_c;
21 static gint thumb_max_width_c;
22 static gint thumb_max_height_c;
23 static gint enable_thumb_caching_c;
24 static gint use_xvpics_thumbnails_c;
25 static gint show_dot_files_c;
26 static gint file_filter_disable_c;
27 static gint filter_include_jpg_c;
28 static gint filter_include_xpm_c;
29 static gint filter_include_tif_c;
30 static gint filter_include_gif_c;
31 static gint filter_include_png_c;
32 static gint filter_include_ppm_c;
33 static gint filter_include_pgm_c;
34 static gint filter_include_pcx_c;
35 static gint filter_include_bmp_c;
36 static gint slideshow_delay_c;
37 static gint slideshow_random_c;
38 static gint slideshow_repeat_c;
40 static GtkWidget *configwindow = NULL;
41 static GtkWidget *startup_path_entry;
42 static GtkWidget *custom_filter_entry;
43 static GtkWidget *editor_name_entry[8];
44 static GtkWidget *editor_command_entry[8];
46 static void startup_path_set_current(GtkWidget *widget, gpointer data);
47 static void slideshow_delay_cb(GtkObject *adj, gpointer data);
48 static void zoom_mode_original_cb(GtkWidget *widget, gpointer data);
49 static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data);
50 static void zoom_mode_none_cb(GtkWidget *widget, gpointer data);
51 static void max_window_size_cb(GtkObject *adj, gpointer data);
52 static void thumb_size_48_selected(GtkWidget *w, gpointer data);
53 static void thumb_size_64_selected(GtkWidget *w, gpointer data);
54 static void thumb_size_85_selected(GtkWidget *w, gpointer data);
55 static void thumb_size_100_selected(GtkWidget *w, gpointer data);
57 static void config_window_apply();
58 static void config_window_close_cb(GtkWidget *widget, gpointer data);
59 static void config_window_destroy(GtkWidget *w, GdkEvent *event, gpointer data);
60 static void config_window_ok_cb(GtkWidget *widget, gpointer data);
61 static void config_window_save_cb(GtkWidget *widget, gpointer data);
63 static void check_button_cb(GtkWidget *widget, gpointer data);
64 static void add_check_button(gint option, gint *option_c, gchar *text, GtkWidget *box);
65 static void config_window_create(gint start_tab);
68 *-----------------------------------------------------------------------------
69 * option widget callbacks (private)
70 *-----------------------------------------------------------------------------
73 static void startup_path_set_current(GtkWidget *widget, gpointer data)
75 gtk_entry_set_text(GTK_ENTRY(startup_path_entry), current_path);
78 static void slideshow_delay_cb(GtkObject *adj, gpointer data)
80 slideshow_delay_c = (gint)GTK_ADJUSTMENT(adj)->value;
83 static void zoom_mode_original_cb(GtkWidget *widget, gpointer data)
85 if (GTK_TOGGLE_BUTTON (widget)->active)
86 zoom_mode_c = ZOOM_RESET_ORIGINAL;
89 static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data)
91 if (GTK_TOGGLE_BUTTON (widget)->active)
92 zoom_mode_c = ZOOM_RESET_FIT_WINDOW;
95 static void zoom_mode_none_cb(GtkWidget *widget, gpointer data)
97 if (GTK_TOGGLE_BUTTON (widget)->active)
98 zoom_mode_c = ZOOM_RESET_NONE;
101 static void max_window_size_cb(GtkObject *adj, gpointer data)
103 max_window_size_c = (gint)GTK_ADJUSTMENT(adj)->value;
106 static void thumb_size_48_selected(GtkWidget *w, gpointer data)
108 if (GTK_TOGGLE_BUTTON (w)->active)
110 thumb_max_width_c = 48;
111 thumb_max_height_c = 48;
115 static void thumb_size_64_selected(GtkWidget *w, gpointer data)
117 if (GTK_TOGGLE_BUTTON (w)->active)
119 thumb_max_width_c = 64;
120 thumb_max_height_c = 64;
124 static void thumb_size_85_selected(GtkWidget *w, gpointer data)
126 if (GTK_TOGGLE_BUTTON (w)->active)
128 thumb_max_width_c = 85;
129 thumb_max_height_c = 64;
133 static void thumb_size_100_selected(GtkWidget *w, gpointer data)
135 if (GTK_TOGGLE_BUTTON (w)->active)
137 thumb_max_width_c = 100;
138 thumb_max_height_c = 100;
143 *-----------------------------------------------------------------------------
144 * sync progam to config window routine (private)
145 *-----------------------------------------------------------------------------
148 static void config_window_apply()
152 gint refresh = FALSE;
156 g_free(editor_name[i]);
157 editor_name[i] = NULL;
158 buf = gtk_entry_get_text(GTK_ENTRY(editor_name_entry[i]));
159 if (buf && strlen(buf) > 0) editor_name[i] = g_strdup(buf);
161 g_free(editor_command[i]);
162 editor_command[i] = NULL;
163 buf = gtk_entry_get_text(GTK_ENTRY(editor_command_entry[i]));
164 if (buf && strlen(buf) > 0) editor_command[i] = g_strdup(buf);
166 update_edit_menus(mainwindow_accel_grp);
168 g_free(startup_path);
170 buf = gtk_entry_get_text(GTK_ENTRY(startup_path_entry));
171 if (buf && strlen(buf) > 0) startup_path = remove_trailing_slash(buf);
173 buf = gtk_entry_get_text(GTK_ENTRY(custom_filter_entry));
174 if ((buf && strlen(buf) > 0) != (custom_filter != NULL)) refresh = TRUE;
175 if ((buf && strlen(buf) > 0 && custom_filter) && strcmp(buf, custom_filter) != 0) refresh = TRUE;
176 g_free(custom_filter);
177 custom_filter = NULL;
178 if (buf && strlen(buf) > 0) custom_filter = g_strdup(buf);
180 if (show_dot_files != show_dot_files_c) refresh = TRUE;
181 if (file_filter_disable != file_filter_disable_c) refresh = TRUE;
182 if (filter_include_jpg != filter_include_jpg_c) refresh = TRUE;
183 if (filter_include_xpm != filter_include_xpm_c) refresh = TRUE;
184 if (filter_include_tif != filter_include_tif_c) refresh = TRUE;
185 if (filter_include_gif != filter_include_gif_c) refresh = TRUE;
186 if (filter_include_png != filter_include_png_c) refresh = TRUE;
187 if (filter_include_ppm != filter_include_ppm_c) refresh = TRUE;
188 if (filter_include_pgm != filter_include_pgm_c) refresh = TRUE;
189 if (filter_include_pcx != filter_include_pcx_c) refresh = TRUE;
190 if (filter_include_bmp != filter_include_bmp_c) refresh = TRUE;
192 startup_path_enable = startup_path_enable_c;
193 confirm_delete = confirm_delete_c;
194 restore_tool = restore_tool_c;
195 save_window_positions = save_window_positions_c;
196 zoom_mode = zoom_mode_c;
197 fit_window = fit_window_c;
198 limit_window_size = limit_window_size_c;
199 max_window_size = max_window_size_c;
200 progressive_key_scrolling = progressive_key_scrolling_c;
201 thumb_max_width = thumb_max_width_c;
202 thumb_max_height = thumb_max_height_c;
203 enable_thumb_caching = enable_thumb_caching_c;
204 use_xvpics_thumbnails = use_xvpics_thumbnails_c;
205 show_dot_files = show_dot_files_c;
206 file_filter_disable = file_filter_disable_c;
207 filter_include_jpg = filter_include_jpg_c;
208 filter_include_xpm = filter_include_xpm_c;
209 filter_include_tif = filter_include_tif_c;
210 filter_include_gif = filter_include_gif_c;
211 filter_include_png = filter_include_png_c;
212 filter_include_ppm = filter_include_ppm_c;
213 filter_include_pgm = filter_include_pgm_c;
214 filter_include_pcx = filter_include_pcx_c;
215 filter_include_bmp = filter_include_bmp_c;
217 slideshow_random = slideshow_random_c;
218 slideshow_repeat = slideshow_repeat_c;
219 slideshow_delay = slideshow_delay_c;
223 rebuild_file_filter();
229 *-----------------------------------------------------------------------------
230 * config window main button callbacks (private)
231 *-----------------------------------------------------------------------------
234 static void config_window_close_cb(GtkWidget *widget, gpointer data)
236 gtk_widget_destroy(configwindow);
240 static void config_window_destroy(GtkWidget *w, GdkEvent *event, gpointer data)
242 config_window_close_cb(NULL, NULL);
245 static void config_window_ok_cb(GtkWidget *widget, gpointer data)
247 config_window_apply();
248 config_window_close_cb(NULL, NULL);
251 static void config_window_apply_cb(GtkWidget *widget, gpointer data)
253 config_window_apply();
257 *-----------------------------------------------------------------------------
258 * config window setup (private)
259 *-----------------------------------------------------------------------------
262 static void check_button_cb(GtkWidget *widget, gpointer data)
264 gint *value_ptr = data;
265 *value_ptr = GTK_TOGGLE_BUTTON (widget)->active;
268 static void add_check_button(gint option, gint *option_c, gchar *text, GtkWidget *box)
272 button = gtk_check_button_new_with_label (text);
273 gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
274 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), option);
275 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) check_button_cb, option_c);
276 gtk_widget_show(button);
279 static void config_window_create(gint start_tab)
291 GtkWidget *radiobuttongroup;
300 configwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
301 gtk_signal_connect (GTK_OBJECT (configwindow), "delete_event",(GtkSignalFunc) config_window_destroy, NULL);
302 gtk_window_set_policy (GTK_WINDOW (configwindow), FALSE, FALSE, FALSE);
303 gtk_window_set_title (GTK_WINDOW (configwindow), _("GQview configuration"));
304 gtk_window_set_wmclass(GTK_WINDOW (configwindow), "config", "GQview");
305 gtk_container_border_width (GTK_CONTAINER (configwindow), 5);
307 win_vbox = gtk_vbox_new(FALSE, 5);
308 gtk_container_add(GTK_CONTAINER(configwindow), win_vbox);
309 gtk_widget_show(win_vbox);
311 hbox = gtk_hbox_new (TRUE, 0);
312 gtk_box_pack_end(GTK_BOX(win_vbox), hbox, FALSE, FALSE, 0);
313 gtk_widget_show(hbox);
315 button = gtk_button_new_with_label(_("Ok"));
316 gtk_signal_connect (GTK_OBJECT (button), "clicked",(GtkSignalFunc) config_window_ok_cb, NULL);
317 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 20);
318 gtk_widget_show(button);
320 button = gtk_button_new_with_label(_("Apply"));
321 gtk_signal_connect (GTK_OBJECT (button), "clicked",(GtkSignalFunc) config_window_apply_cb, NULL);
322 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 20);
323 gtk_widget_show(button);
325 button = gtk_button_new_with_label(_("Cancel"));
326 gtk_signal_connect (GTK_OBJECT (button), "clicked",(GtkSignalFunc) config_window_close_cb, NULL);
327 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 20);
328 gtk_widget_show(button);
330 notebook = gtk_notebook_new();
331 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(notebook), GTK_POS_TOP);
332 gtk_box_pack_start (GTK_BOX(win_vbox), notebook, TRUE, TRUE, 0);
334 /* general options tab */
336 frame = gtk_frame_new(NULL);
337 gtk_container_border_width (GTK_CONTAINER (frame), 5);
338 gtk_widget_show(frame);
339 label = gtk_label_new(_("General"));
340 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), frame, label);
342 vbox = gtk_vbox_new (FALSE, 0);
343 gtk_container_border_width (GTK_CONTAINER (vbox), 5);
344 gtk_container_add (GTK_CONTAINER(frame),vbox);
345 gtk_widget_show(vbox);
347 frame = gtk_frame_new(_("Initial directory"));
348 gtk_container_border_width (GTK_CONTAINER (frame), 5);
349 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
350 gtk_widget_show(frame);
352 vbox1 = gtk_vbox_new (FALSE, 0);
353 gtk_container_add (GTK_CONTAINER(frame),vbox1);
354 gtk_widget_show(vbox1);
356 add_check_button(startup_path_enable, &startup_path_enable_c,
357 _("On startup, change to this directory:"), vbox1);
359 hbox = gtk_hbox_new (FALSE, 0);
360 gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
361 gtk_widget_show(hbox);
363 gtk_widget_realize(configwindow);
365 tabcomp = tab_completion_new(&startup_path_entry, configwindow, startup_path, NULL, NULL);
366 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0);
367 gtk_widget_show(tabcomp);
369 button = gtk_button_new_with_label (_("Use current"));
370 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) startup_path_set_current, NULL);
371 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
372 gtk_widget_show(button);
374 add_check_button(confirm_delete, &confirm_delete_c,
375 _("Confirm file delete"), vbox);
376 add_check_button(restore_tool, &restore_tool_c,
377 _("Remember tool state (float/hidden)"), vbox);
378 add_check_button(save_window_positions, &save_window_positions_c,
379 _("Remember window positions"), vbox);
381 frame = gtk_frame_new(_("Slide show"));
382 gtk_container_border_width (GTK_CONTAINER (frame), 5);
383 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
384 gtk_widget_show(frame);
386 vbox1 = gtk_vbox_new (FALSE, 0);
387 gtk_container_add (GTK_CONTAINER(frame),vbox1);
388 gtk_widget_show(vbox1);
390 hbox = gtk_hbox_new (FALSE, 0);
391 gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
392 gtk_widget_show(hbox);
394 label = gtk_label_new(_("Delay before image change (seconds):"));
395 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
396 gtk_widget_show(label);
398 slideshow_delay_c = slideshow_delay;
399 adj = gtk_adjustment_new((float)slideshow_delay_c, 1.0, 1200.0, 1, 1, 1);
400 spin = gtk_spin_button_new( GTK_ADJUSTMENT(adj), 1, 0 );
401 gtk_box_pack_start( GTK_BOX(hbox), spin, FALSE, FALSE, 5);
402 gtk_signal_connect( GTK_OBJECT(adj),"value_changed",GTK_SIGNAL_FUNC(slideshow_delay_cb), NULL);
403 gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON(spin),GTK_UPDATE_ALWAYS );
404 gtk_widget_show(spin);
406 add_check_button(slideshow_random, &slideshow_random_c,
408 add_check_button(slideshow_repeat, &slideshow_repeat_c,
413 frame = gtk_frame_new(NULL);
414 gtk_container_border_width (GTK_CONTAINER (frame), 5);
415 gtk_widget_show(frame);
416 label = gtk_label_new(_("Image"));
417 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
419 vbox = gtk_vbox_new (FALSE, 0);
420 gtk_container_border_width (GTK_CONTAINER (vbox), 5);
421 gtk_container_add (GTK_CONTAINER(frame),vbox);
422 gtk_widget_show(vbox);
424 frame = gtk_frame_new(_("When new image is selected:"));
425 gtk_container_border_width (GTK_CONTAINER (frame), 5);
426 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
427 gtk_widget_show(frame);
429 vbox1 = gtk_vbox_new (FALSE, 0);
430 gtk_container_add (GTK_CONTAINER(frame),vbox1);
431 gtk_widget_show(vbox1);
433 zoom_mode_c = zoom_mode;
434 radiobuttongroup = gtk_radio_button_new_with_label (NULL, _("Zoom to original size"));
435 if (zoom_mode == ZOOM_RESET_ORIGINAL) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(radiobuttongroup), 1);
436 gtk_signal_connect (GTK_OBJECT(radiobuttongroup),"clicked",(GtkSignalFunc) zoom_mode_original_cb, NULL);
437 gtk_box_pack_start(GTK_BOX(vbox1), radiobuttongroup, FALSE, FALSE, 0);
438 gtk_widget_show(radiobuttongroup);
440 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),_("Fit image to window"));
441 if (zoom_mode == ZOOM_RESET_FIT_WINDOW) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
442 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) zoom_mode_fit_cb, NULL);
443 gtk_box_pack_start(GTK_BOX(vbox1), button, FALSE, FALSE, 0);
444 gtk_widget_show(button);
446 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),_("Leave Zoom at previous setting"));
447 if (zoom_mode == ZOOM_RESET_NONE) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
448 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) zoom_mode_none_cb, NULL);
449 gtk_box_pack_start(GTK_BOX(vbox1), button, FALSE, FALSE, 0);
450 gtk_widget_show(button);
452 add_check_button(fit_window, &fit_window_c,
453 _("Fit window to image when tools are hidden/floating"), vbox);
455 hbox = gtk_hbox_new (FALSE, 0);
456 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
457 gtk_widget_show(hbox);
459 add_check_button(limit_window_size, &limit_window_size_c,
460 _("Limit size when auto-sizing window"), hbox);
462 max_window_size_c = max_window_size;
463 adj = gtk_adjustment_new((float)max_window_size_c, 10.0, 150.0, 1, 1, 1);
464 spin = gtk_spin_button_new( GTK_ADJUSTMENT(adj), 1, 0 );
465 gtk_box_pack_start( GTK_BOX(hbox), spin, FALSE, FALSE, 5);
466 gtk_signal_connect( GTK_OBJECT(adj),"value_changed",GTK_SIGNAL_FUNC(max_window_size_cb), NULL);
467 gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON(spin),GTK_UPDATE_ALWAYS );
468 gtk_widget_show(spin);
470 frame = gtk_frame_new(_("Thumbnails"));
471 gtk_container_border_width (GTK_CONTAINER (frame), 5);
472 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
473 gtk_widget_show(frame);
475 vbox1 = gtk_vbox_new (FALSE, 0);
476 gtk_container_add (GTK_CONTAINER(frame),vbox1);
477 gtk_widget_show(vbox1);
479 hbox = gtk_hbox_new (FALSE, 0);
480 gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
481 gtk_widget_show(hbox);
483 thumb_max_width_c = thumb_max_width;
484 thumb_max_height_c = thumb_max_height;
486 label = gtk_label_new(_("Size:"));
487 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
488 gtk_widget_show(label);
490 radiobuttongroup = gtk_radio_button_new_with_label (NULL,"48x48");
491 gtk_box_pack_start(GTK_BOX(hbox), radiobuttongroup, FALSE, FALSE, 0);
492 if (thumb_max_width_c == 48 && thumb_max_height_c == 48) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(radiobuttongroup), 1);
493 gtk_signal_connect (GTK_OBJECT(radiobuttongroup),"clicked",(GtkSignalFunc) thumb_size_48_selected, NULL);
494 gtk_widget_show(radiobuttongroup);
496 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),"64x64");
497 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
498 if (thumb_max_width_c == 64 && thumb_max_height_c == 64) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
499 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) thumb_size_64_selected, NULL);
500 gtk_widget_show(button);
502 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),"85x64");
503 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
504 if (thumb_max_width_c == 85 && thumb_max_height_c == 64) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
505 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) thumb_size_85_selected, NULL);
506 gtk_widget_show(button);
508 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),"100x100");
509 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
510 if (thumb_max_width_c == 100 && thumb_max_height_c == 100) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
511 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) thumb_size_100_selected, NULL);
512 gtk_widget_show(button);
514 add_check_button(enable_thumb_caching, &enable_thumb_caching_c,
515 _("Cache thumbnails"), vbox1);
516 add_check_button(use_xvpics_thumbnails, &use_xvpics_thumbnails_c,
517 _("Use xvpics thumbnails when found (read only)"), vbox1);
519 add_check_button(progressive_key_scrolling, &progressive_key_scrolling_c,
520 _("Progressive keyboard scrolling"), vbox);
524 frame = gtk_frame_new(NULL);
525 gtk_container_border_width (GTK_CONTAINER (frame), 5);
526 gtk_widget_show(frame);
527 label = gtk_label_new(_("Filtering"));
528 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
530 vbox = gtk_vbox_new (FALSE, 0);
531 gtk_container_border_width (GTK_CONTAINER (vbox), 5);
532 gtk_container_add (GTK_CONTAINER(frame),vbox);
533 gtk_widget_show(vbox);
535 add_check_button(show_dot_files, &show_dot_files_c,
536 _("Show entries that begin with a dot"), vbox);
537 add_check_button(file_filter_disable, &file_filter_disable_c,
538 _("Disable File Filtering"), vbox);
540 frame = gtk_frame_new(_("Include files of type:"));
541 gtk_container_border_width (GTK_CONTAINER (frame), 5);
542 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
543 gtk_widget_show(frame);
545 vbox1 = gtk_vbox_new (FALSE, 0);
546 gtk_container_add (GTK_CONTAINER(frame),vbox1);
547 gtk_widget_show(vbox1);
549 hbox = gtk_hbox_new (TRUE, 0);
550 gtk_box_pack_start (GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
551 gtk_widget_show(hbox);
553 vbox2 = gtk_vbox_new (FALSE, 0);
554 gtk_box_pack_start (GTK_BOX(hbox), vbox2,FALSE, FALSE, 0);
555 gtk_widget_show(vbox2);
557 add_check_button(filter_include_jpg, &filter_include_jpg_c,
558 "JPG / JPEG", vbox2);
559 add_check_button(filter_include_xpm, &filter_include_xpm_c,
561 add_check_button(filter_include_tif, &filter_include_tif_c,
562 "TIF / TIFF", vbox2);
564 vbox2 = gtk_vbox_new (FALSE, 0);
565 gtk_box_pack_start (GTK_BOX(hbox), vbox2,FALSE, FALSE, 0);
566 gtk_widget_show(vbox2);
568 add_check_button(filter_include_gif, &filter_include_gif_c,
570 add_check_button(filter_include_png, &filter_include_png_c,
572 add_check_button(filter_include_ppm, &filter_include_ppm_c,
575 vbox2 = gtk_vbox_new (FALSE, 0);
576 gtk_box_pack_start (GTK_BOX(hbox), vbox2,FALSE, FALSE, 0);
577 gtk_widget_show(vbox2);
579 add_check_button(filter_include_pgm, &filter_include_pgm_c,
581 add_check_button(filter_include_pcx, &filter_include_pcx_c,
583 add_check_button(filter_include_bmp, &filter_include_bmp_c,
586 hbox = gtk_hbox_new (FALSE, 0);
587 gtk_box_pack_start (GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
588 gtk_widget_show(hbox);
590 label = gtk_label_new(_("Custom file types:"));
591 gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0);
592 gtk_widget_show(label);
594 custom_filter_entry = gtk_entry_new();
595 if (custom_filter) gtk_entry_set_text(GTK_ENTRY(custom_filter_entry), custom_filter);
596 gtk_box_pack_start(GTK_BOX(vbox1),custom_filter_entry,FALSE,FALSE,0);
597 gtk_widget_show(custom_filter_entry);
599 hbox = gtk_hbox_new (FALSE, 0);
600 gtk_box_pack_start (GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
601 gtk_widget_show(hbox);
603 label = gtk_label_new(_("format: [.foo;.bar]"));
604 gtk_box_pack_end(GTK_BOX(hbox),label,FALSE,FALSE,5);
605 gtk_widget_show(label);
607 /* editor entry tab */
609 frame = gtk_frame_new(NULL);
610 gtk_container_border_width (GTK_CONTAINER (frame), 5);
611 gtk_widget_show(frame);
612 label = gtk_label_new(_("External Editors"));
613 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
615 vbox = gtk_vbox_new(FALSE,0);
616 gtk_container_border_width (GTK_CONTAINER (vbox), 5);
617 gtk_container_add (GTK_CONTAINER(frame),vbox);
618 gtk_widget_show(vbox);
620 table=gtk_table_new(3,9,FALSE);
621 gtk_container_add (GTK_CONTAINER(vbox),table);
622 gtk_widget_show(table);
624 label = gtk_label_new(_("#"));
625 gtk_table_attach_defaults(GTK_TABLE (table),label, 0, 1, 0, 1);
626 gtk_widget_show(label);
627 label = gtk_label_new(_("Menu name"));
628 gtk_table_attach_defaults(GTK_TABLE (table),label, 1, 2, 0, 1);
629 gtk_widget_show(label);
630 label = gtk_label_new(_("Command Line"));
631 gtk_table_attach_defaults(GTK_TABLE (table),label, 2, 3, 0, 1);
632 gtk_widget_show(label);
636 sprintf(buf,"%d",i+1);
637 label = gtk_label_new(buf);
638 gtk_table_attach_defaults(GTK_TABLE (table),label, 0, 1, i+1, i+2);
639 gtk_widget_show(label);
641 editor_name_entry[i] = gtk_entry_new_with_max_length(32);
642 gtk_widget_set_usize(editor_name_entry[i],80,-1);
643 if (editor_name[i]) gtk_entry_set_text(GTK_ENTRY(editor_name_entry[i]),editor_name[i]);
644 gtk_table_attach_defaults(GTK_TABLE (table),editor_name_entry[i],1,2,i+1,i+2);
645 gtk_widget_show(editor_name_entry[i]);
647 editor_command_entry[i] = gtk_entry_new_with_max_length(255);
648 gtk_widget_set_usize(editor_command_entry[i],160,-1);
649 tab_completion_add_to_entry(editor_command_entry[i], NULL, NULL);
650 if (editor_command[i]) gtk_entry_set_text(GTK_ENTRY(editor_command_entry[i]), editor_command[i]);
651 gtk_table_attach_defaults(GTK_TABLE (table),editor_command_entry[i],2,3,i+1,i+2);
652 gtk_widget_show(editor_command_entry[i]);
657 frame = gtk_frame_new(NULL);
658 gtk_container_border_width (GTK_CONTAINER (frame), 5);
659 gtk_widget_show(frame);
660 label = gtk_label_new(_("About"));
661 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
663 vbox = gtk_vbox_new (FALSE, 0);
664 gtk_container_add (GTK_CONTAINER(frame),vbox);
665 gtk_widget_show(vbox);
667 im = gdk_imlib_create_image_from_data((char *)logo, NULL, logo_width, logo_height);
668 gdk_imlib_render(im, logo_width, logo_height);
669 pixmap = gdk_imlib_move_image(im);
670 gdk_imlib_destroy_image(im);
672 button=gtk_pixmap_new(pixmap, NULL);
673 gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 0);
674 gtk_widget_show (button);
676 sprintf(buf, _("GQview %s\n\nCopyright (c) 2000 by John Ellis\nhttp://gqview.sorceforge.net\nor http://gqview.netpedia.net\ngqview@email.com\n\nReleased under the GNU Public License"), VERSION);
677 label = gtk_label_new(buf);
678 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
679 gtk_widget_show (label);
681 gtk_notebook_set_page (GTK_NOTEBOOK(notebook), start_tab);
682 gtk_widget_show(notebook);
684 gtk_widget_show(configwindow);
688 *-----------------------------------------------------------------------------
689 * config/about window show (public)
690 *-----------------------------------------------------------------------------
693 void show_config_window()
695 if (configwindow) return;
696 config_window_create(0);
699 void show_about_window()
701 if (configwindow) return;
702 config_window_create(4);