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 gint mousewheel_scrolls_c;
42 static GtkWidget *configwindow = NULL;
43 static GtkWidget *startup_path_entry;
44 static GtkWidget *custom_filter_entry;
45 static GtkWidget *editor_name_entry[8];
46 static GtkWidget *editor_command_entry[8];
48 static void startup_path_set_current(GtkWidget *widget, gpointer data);
49 static void slideshow_delay_cb(GtkObject *adj, gpointer data);
50 static void zoom_mode_original_cb(GtkWidget *widget, gpointer data);
51 static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data);
52 static void zoom_mode_none_cb(GtkWidget *widget, gpointer data);
53 static void max_window_size_cb(GtkObject *adj, gpointer data);
54 static void thumb_size_48_selected(GtkWidget *w, gpointer data);
55 static void thumb_size_64_selected(GtkWidget *w, gpointer data);
56 static void thumb_size_85_selected(GtkWidget *w, gpointer data);
57 static void thumb_size_100_selected(GtkWidget *w, gpointer data);
59 static void config_window_apply();
60 static void config_window_close_cb(GtkWidget *widget, gpointer data);
61 static void config_window_destroy(GtkWidget *w, GdkEvent *event, gpointer data);
62 static void config_window_ok_cb(GtkWidget *widget, gpointer data);
63 static void config_window_save_cb(GtkWidget *widget, gpointer data);
65 static void check_button_cb(GtkWidget *widget, gpointer data);
66 static void add_check_button(gint option, gint *option_c, gchar *text, GtkWidget *box);
67 static void config_window_create(gint start_tab);
70 *-----------------------------------------------------------------------------
71 * option widget callbacks (private)
72 *-----------------------------------------------------------------------------
75 static void startup_path_set_current(GtkWidget *widget, gpointer data)
77 gtk_entry_set_text(GTK_ENTRY(startup_path_entry), current_path);
80 static void slideshow_delay_cb(GtkObject *adj, gpointer data)
82 slideshow_delay_c = (gint)GTK_ADJUSTMENT(adj)->value;
85 static void zoom_mode_original_cb(GtkWidget *widget, gpointer data)
87 if (GTK_TOGGLE_BUTTON (widget)->active)
88 zoom_mode_c = ZOOM_RESET_ORIGINAL;
91 static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data)
93 if (GTK_TOGGLE_BUTTON (widget)->active)
94 zoom_mode_c = ZOOM_RESET_FIT_WINDOW;
97 static void zoom_mode_none_cb(GtkWidget *widget, gpointer data)
99 if (GTK_TOGGLE_BUTTON (widget)->active)
100 zoom_mode_c = ZOOM_RESET_NONE;
103 static void max_window_size_cb(GtkObject *adj, gpointer data)
105 max_window_size_c = (gint)GTK_ADJUSTMENT(adj)->value;
108 static void thumb_size_48_selected(GtkWidget *w, gpointer data)
110 if (GTK_TOGGLE_BUTTON (w)->active)
112 thumb_max_width_c = 48;
113 thumb_max_height_c = 48;
117 static void thumb_size_64_selected(GtkWidget *w, gpointer data)
119 if (GTK_TOGGLE_BUTTON (w)->active)
121 thumb_max_width_c = 64;
122 thumb_max_height_c = 64;
126 static void thumb_size_85_selected(GtkWidget *w, gpointer data)
128 if (GTK_TOGGLE_BUTTON (w)->active)
130 thumb_max_width_c = 85;
131 thumb_max_height_c = 64;
135 static void thumb_size_100_selected(GtkWidget *w, gpointer data)
137 if (GTK_TOGGLE_BUTTON (w)->active)
139 thumb_max_width_c = 100;
140 thumb_max_height_c = 100;
145 *-----------------------------------------------------------------------------
146 * sync progam to config window routine (private)
147 *-----------------------------------------------------------------------------
150 static void config_window_apply()
154 gint refresh = FALSE;
158 g_free(editor_name[i]);
159 editor_name[i] = NULL;
160 buf = gtk_entry_get_text(GTK_ENTRY(editor_name_entry[i]));
161 if (buf && strlen(buf) > 0) editor_name[i] = g_strdup(buf);
163 g_free(editor_command[i]);
164 editor_command[i] = NULL;
165 buf = gtk_entry_get_text(GTK_ENTRY(editor_command_entry[i]));
166 if (buf && strlen(buf) > 0) editor_command[i] = g_strdup(buf);
168 update_edit_menus(mainwindow_accel_grp);
170 g_free(startup_path);
172 buf = gtk_entry_get_text(GTK_ENTRY(startup_path_entry));
173 if (buf && strlen(buf) > 0) startup_path = remove_trailing_slash(buf);
175 buf = gtk_entry_get_text(GTK_ENTRY(custom_filter_entry));
176 if ((buf && strlen(buf) > 0) != (custom_filter != NULL)) refresh = TRUE;
177 if ((buf && strlen(buf) > 0 && custom_filter) && strcmp(buf, custom_filter) != 0) refresh = TRUE;
178 g_free(custom_filter);
179 custom_filter = NULL;
180 if (buf && strlen(buf) > 0) custom_filter = g_strdup(buf);
182 if (show_dot_files != show_dot_files_c) refresh = TRUE;
183 if (file_filter_disable != file_filter_disable_c) refresh = TRUE;
184 if (filter_include_jpg != filter_include_jpg_c) refresh = TRUE;
185 if (filter_include_xpm != filter_include_xpm_c) refresh = TRUE;
186 if (filter_include_tif != filter_include_tif_c) refresh = TRUE;
187 if (filter_include_gif != filter_include_gif_c) refresh = TRUE;
188 if (filter_include_png != filter_include_png_c) refresh = TRUE;
189 if (filter_include_ppm != filter_include_ppm_c) refresh = TRUE;
190 if (filter_include_pgm != filter_include_pgm_c) refresh = TRUE;
191 if (filter_include_pcx != filter_include_pcx_c) refresh = TRUE;
192 if (filter_include_bmp != filter_include_bmp_c) refresh = TRUE;
194 startup_path_enable = startup_path_enable_c;
195 confirm_delete = confirm_delete_c;
196 restore_tool = restore_tool_c;
197 save_window_positions = save_window_positions_c;
198 zoom_mode = zoom_mode_c;
199 fit_window = fit_window_c;
200 limit_window_size = limit_window_size_c;
201 max_window_size = max_window_size_c;
202 progressive_key_scrolling = progressive_key_scrolling_c;
203 thumb_max_width = thumb_max_width_c;
204 thumb_max_height = thumb_max_height_c;
205 enable_thumb_caching = enable_thumb_caching_c;
206 use_xvpics_thumbnails = use_xvpics_thumbnails_c;
207 show_dot_files = show_dot_files_c;
208 file_filter_disable = file_filter_disable_c;
209 filter_include_jpg = filter_include_jpg_c;
210 filter_include_xpm = filter_include_xpm_c;
211 filter_include_tif = filter_include_tif_c;
212 filter_include_gif = filter_include_gif_c;
213 filter_include_png = filter_include_png_c;
214 filter_include_ppm = filter_include_ppm_c;
215 filter_include_pgm = filter_include_pgm_c;
216 filter_include_pcx = filter_include_pcx_c;
217 filter_include_bmp = filter_include_bmp_c;
219 slideshow_random = slideshow_random_c;
220 slideshow_repeat = slideshow_repeat_c;
221 slideshow_delay = slideshow_delay_c;
223 mousewheel_scrolls = mousewheel_scrolls_c;
227 rebuild_file_filter();
233 *-----------------------------------------------------------------------------
234 * config window main button callbacks (private)
235 *-----------------------------------------------------------------------------
238 static void config_window_close_cb(GtkWidget *widget, gpointer data)
240 gtk_widget_destroy(configwindow);
244 static void config_window_destroy(GtkWidget *w, GdkEvent *event, gpointer data)
246 config_window_close_cb(NULL, NULL);
249 static void config_window_ok_cb(GtkWidget *widget, gpointer data)
251 config_window_apply();
252 config_window_close_cb(NULL, NULL);
255 static void config_window_apply_cb(GtkWidget *widget, gpointer data)
257 config_window_apply();
261 *-----------------------------------------------------------------------------
262 * config window setup (private)
263 *-----------------------------------------------------------------------------
266 static void check_button_cb(GtkWidget *widget, gpointer data)
268 gint *value_ptr = data;
269 *value_ptr = GTK_TOGGLE_BUTTON (widget)->active;
272 static void add_check_button(gint option, gint *option_c, gchar *text, GtkWidget *box)
276 button = gtk_check_button_new_with_label (text);
277 gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
278 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), option);
279 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) check_button_cb, option_c);
280 gtk_widget_show(button);
283 static void config_window_create(gint start_tab)
295 GtkWidget *radiobuttongroup;
304 configwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
305 gtk_signal_connect (GTK_OBJECT (configwindow), "delete_event",(GtkSignalFunc) config_window_destroy, NULL);
306 gtk_window_set_policy (GTK_WINDOW (configwindow), FALSE, FALSE, FALSE);
307 gtk_window_set_title (GTK_WINDOW (configwindow), _("GQview configuration"));
308 gtk_window_set_wmclass(GTK_WINDOW (configwindow), "config", "GQview");
309 gtk_container_border_width (GTK_CONTAINER (configwindow), 5);
311 win_vbox = gtk_vbox_new(FALSE, 5);
312 gtk_container_add(GTK_CONTAINER(configwindow), win_vbox);
313 gtk_widget_show(win_vbox);
315 hbox = gtk_hbox_new (TRUE, 0);
316 gtk_box_pack_end(GTK_BOX(win_vbox), hbox, FALSE, FALSE, 0);
317 gtk_widget_show(hbox);
319 button = gtk_button_new_with_label(_("Ok"));
320 gtk_signal_connect (GTK_OBJECT (button), "clicked",(GtkSignalFunc) config_window_ok_cb, NULL);
321 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 20);
322 gtk_widget_show(button);
324 button = gtk_button_new_with_label(_("Apply"));
325 gtk_signal_connect (GTK_OBJECT (button), "clicked",(GtkSignalFunc) config_window_apply_cb, NULL);
326 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 20);
327 gtk_widget_show(button);
329 button = gtk_button_new_with_label(_("Cancel"));
330 gtk_signal_connect (GTK_OBJECT (button), "clicked",(GtkSignalFunc) config_window_close_cb, NULL);
331 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 20);
332 gtk_widget_show(button);
334 notebook = gtk_notebook_new();
335 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(notebook), GTK_POS_TOP);
336 gtk_box_pack_start (GTK_BOX(win_vbox), notebook, TRUE, TRUE, 0);
338 /* general options tab */
340 frame = gtk_frame_new(NULL);
341 gtk_container_border_width (GTK_CONTAINER (frame), 5);
342 gtk_widget_show(frame);
343 label = gtk_label_new(_("General"));
344 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), frame, label);
346 vbox = gtk_vbox_new (FALSE, 0);
347 gtk_container_border_width (GTK_CONTAINER (vbox), 5);
348 gtk_container_add (GTK_CONTAINER(frame),vbox);
349 gtk_widget_show(vbox);
351 frame = gtk_frame_new(_("Initial directory"));
352 gtk_container_border_width (GTK_CONTAINER (frame), 5);
353 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
354 gtk_widget_show(frame);
356 vbox1 = gtk_vbox_new (FALSE, 0);
357 gtk_container_add (GTK_CONTAINER(frame),vbox1);
358 gtk_widget_show(vbox1);
360 add_check_button(startup_path_enable, &startup_path_enable_c,
361 _("On startup, change to this directory:"), vbox1);
363 hbox = gtk_hbox_new (FALSE, 0);
364 gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
365 gtk_widget_show(hbox);
367 gtk_widget_realize(configwindow);
369 tabcomp = tab_completion_new(&startup_path_entry, configwindow, startup_path, NULL, NULL);
370 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0);
371 gtk_widget_show(tabcomp);
373 button = gtk_button_new_with_label (_("Use current"));
374 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) startup_path_set_current, NULL);
375 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
376 gtk_widget_show(button);
378 add_check_button(confirm_delete, &confirm_delete_c,
379 _("Confirm file delete"), vbox);
380 add_check_button(restore_tool, &restore_tool_c,
381 _("Remember tool state (float/hidden)"), vbox);
382 add_check_button(save_window_positions, &save_window_positions_c,
383 _("Remember window positions"), vbox);
385 frame = gtk_frame_new(_("Slide show"));
386 gtk_container_border_width (GTK_CONTAINER (frame), 5);
387 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
388 gtk_widget_show(frame);
390 vbox1 = gtk_vbox_new (FALSE, 0);
391 gtk_container_add (GTK_CONTAINER(frame),vbox1);
392 gtk_widget_show(vbox1);
394 hbox = gtk_hbox_new (FALSE, 0);
395 gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
396 gtk_widget_show(hbox);
398 label = gtk_label_new(_("Delay before image change (seconds):"));
399 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
400 gtk_widget_show(label);
402 slideshow_delay_c = slideshow_delay;
403 adj = gtk_adjustment_new((float)slideshow_delay_c, 1.0, 1200.0, 1, 1, 1);
404 spin = gtk_spin_button_new( GTK_ADJUSTMENT(adj), 1, 0 );
405 gtk_box_pack_start( GTK_BOX(hbox), spin, FALSE, FALSE, 5);
406 gtk_signal_connect( GTK_OBJECT(adj),"value_changed",GTK_SIGNAL_FUNC(slideshow_delay_cb), NULL);
407 gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON(spin),GTK_UPDATE_ALWAYS );
408 gtk_widget_show(spin);
410 add_check_button(slideshow_random, &slideshow_random_c,
412 add_check_button(slideshow_repeat, &slideshow_repeat_c,
417 frame = gtk_frame_new(NULL);
418 gtk_container_border_width (GTK_CONTAINER (frame), 5);
419 gtk_widget_show(frame);
420 label = gtk_label_new(_("Image"));
421 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
423 vbox = gtk_vbox_new (FALSE, 0);
424 gtk_container_border_width (GTK_CONTAINER (vbox), 5);
425 gtk_container_add (GTK_CONTAINER(frame),vbox);
426 gtk_widget_show(vbox);
428 frame = gtk_frame_new(_("When new image is selected:"));
429 gtk_container_border_width (GTK_CONTAINER (frame), 5);
430 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
431 gtk_widget_show(frame);
433 vbox1 = gtk_vbox_new (FALSE, 0);
434 gtk_container_add (GTK_CONTAINER(frame),vbox1);
435 gtk_widget_show(vbox1);
437 zoom_mode_c = zoom_mode;
438 radiobuttongroup = gtk_radio_button_new_with_label (NULL, _("Zoom to original size"));
439 if (zoom_mode == ZOOM_RESET_ORIGINAL) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(radiobuttongroup), 1);
440 gtk_signal_connect (GTK_OBJECT(radiobuttongroup),"clicked",(GtkSignalFunc) zoom_mode_original_cb, NULL);
441 gtk_box_pack_start(GTK_BOX(vbox1), radiobuttongroup, FALSE, FALSE, 0);
442 gtk_widget_show(radiobuttongroup);
444 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),_("Fit image to window"));
445 if (zoom_mode == ZOOM_RESET_FIT_WINDOW) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
446 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) zoom_mode_fit_cb, NULL);
447 gtk_box_pack_start(GTK_BOX(vbox1), button, FALSE, FALSE, 0);
448 gtk_widget_show(button);
450 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),_("Leave Zoom at previous setting"));
451 if (zoom_mode == ZOOM_RESET_NONE) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
452 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) zoom_mode_none_cb, NULL);
453 gtk_box_pack_start(GTK_BOX(vbox1), button, FALSE, FALSE, 0);
454 gtk_widget_show(button);
456 add_check_button(fit_window, &fit_window_c,
457 _("Fit window to image when tools are hidden/floating"), vbox);
459 hbox = gtk_hbox_new (FALSE, 0);
460 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
461 gtk_widget_show(hbox);
463 add_check_button(limit_window_size, &limit_window_size_c,
464 _("Limit size when auto-sizing window"), hbox);
466 max_window_size_c = max_window_size;
467 adj = gtk_adjustment_new((float)max_window_size_c, 10.0, 150.0, 1, 1, 1);
468 spin = gtk_spin_button_new( GTK_ADJUSTMENT(adj), 1, 0 );
469 gtk_box_pack_start( GTK_BOX(hbox), spin, FALSE, FALSE, 5);
470 gtk_signal_connect( GTK_OBJECT(adj),"value_changed",GTK_SIGNAL_FUNC(max_window_size_cb), NULL);
471 gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON(spin),GTK_UPDATE_ALWAYS );
472 gtk_widget_show(spin);
474 frame = gtk_frame_new(_("Thumbnails"));
475 gtk_container_border_width (GTK_CONTAINER (frame), 5);
476 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
477 gtk_widget_show(frame);
479 vbox1 = gtk_vbox_new (FALSE, 0);
480 gtk_container_add (GTK_CONTAINER(frame),vbox1);
481 gtk_widget_show(vbox1);
483 hbox = gtk_hbox_new (FALSE, 0);
484 gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
485 gtk_widget_show(hbox);
487 thumb_max_width_c = thumb_max_width;
488 thumb_max_height_c = thumb_max_height;
490 label = gtk_label_new(_("Size:"));
491 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
492 gtk_widget_show(label);
494 radiobuttongroup = gtk_radio_button_new_with_label (NULL,"48x48");
495 gtk_box_pack_start(GTK_BOX(hbox), radiobuttongroup, FALSE, FALSE, 0);
496 if (thumb_max_width_c == 48 && thumb_max_height_c == 48) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(radiobuttongroup), 1);
497 gtk_signal_connect (GTK_OBJECT(radiobuttongroup),"clicked",(GtkSignalFunc) thumb_size_48_selected, NULL);
498 gtk_widget_show(radiobuttongroup);
500 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),"64x64");
501 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
502 if (thumb_max_width_c == 64 && thumb_max_height_c == 64) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
503 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) thumb_size_64_selected, NULL);
504 gtk_widget_show(button);
506 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),"85x64");
507 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
508 if (thumb_max_width_c == 85 && thumb_max_height_c == 64) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
509 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) thumb_size_85_selected, NULL);
510 gtk_widget_show(button);
512 button = gtk_radio_button_new_with_label (gtk_radio_button_group(GTK_RADIO_BUTTON(radiobuttongroup)),"100x100");
513 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
514 if (thumb_max_width_c == 100 && thumb_max_height_c == 100) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON(button), 1);
515 gtk_signal_connect (GTK_OBJECT(button),"clicked",(GtkSignalFunc) thumb_size_100_selected, NULL);
516 gtk_widget_show(button);
518 add_check_button(enable_thumb_caching, &enable_thumb_caching_c,
519 _("Cache thumbnails"), vbox1);
520 add_check_button(use_xvpics_thumbnails, &use_xvpics_thumbnails_c,
521 _("Use xvpics thumbnails when found (read only)"), vbox1);
523 add_check_button(progressive_key_scrolling, &progressive_key_scrolling_c,
524 _("Progressive keyboard scrolling"), vbox);
525 add_check_button(mousewheel_scrolls, &mousewheel_scrolls_c,
526 _("Mouse wheel scrolls image"), vbox);
530 frame = gtk_frame_new(NULL);
531 gtk_container_border_width (GTK_CONTAINER (frame), 5);
532 gtk_widget_show(frame);
533 label = gtk_label_new(_("Filtering"));
534 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
536 vbox = gtk_vbox_new (FALSE, 0);
537 gtk_container_border_width (GTK_CONTAINER (vbox), 5);
538 gtk_container_add (GTK_CONTAINER(frame),vbox);
539 gtk_widget_show(vbox);
541 add_check_button(show_dot_files, &show_dot_files_c,
542 _("Show entries that begin with a dot"), vbox);
543 add_check_button(file_filter_disable, &file_filter_disable_c,
544 _("Disable File Filtering"), vbox);
546 frame = gtk_frame_new(_("Include files of type:"));
547 gtk_container_border_width (GTK_CONTAINER (frame), 5);
548 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
549 gtk_widget_show(frame);
551 vbox1 = gtk_vbox_new (FALSE, 0);
552 gtk_container_add (GTK_CONTAINER(frame),vbox1);
553 gtk_widget_show(vbox1);
555 hbox = gtk_hbox_new (TRUE, 0);
556 gtk_box_pack_start (GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
557 gtk_widget_show(hbox);
559 vbox2 = gtk_vbox_new (FALSE, 0);
560 gtk_box_pack_start (GTK_BOX(hbox), vbox2,FALSE, FALSE, 0);
561 gtk_widget_show(vbox2);
563 add_check_button(filter_include_jpg, &filter_include_jpg_c,
564 "JPG / JPEG", vbox2);
565 add_check_button(filter_include_xpm, &filter_include_xpm_c,
567 add_check_button(filter_include_tif, &filter_include_tif_c,
568 "TIF / TIFF", vbox2);
570 vbox2 = gtk_vbox_new (FALSE, 0);
571 gtk_box_pack_start (GTK_BOX(hbox), vbox2,FALSE, FALSE, 0);
572 gtk_widget_show(vbox2);
574 add_check_button(filter_include_gif, &filter_include_gif_c,
576 add_check_button(filter_include_png, &filter_include_png_c,
578 add_check_button(filter_include_ppm, &filter_include_ppm_c,
581 vbox2 = gtk_vbox_new (FALSE, 0);
582 gtk_box_pack_start (GTK_BOX(hbox), vbox2,FALSE, FALSE, 0);
583 gtk_widget_show(vbox2);
585 add_check_button(filter_include_pgm, &filter_include_pgm_c,
587 add_check_button(filter_include_pcx, &filter_include_pcx_c,
589 add_check_button(filter_include_bmp, &filter_include_bmp_c,
592 hbox = gtk_hbox_new (FALSE, 0);
593 gtk_box_pack_start (GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
594 gtk_widget_show(hbox);
596 label = gtk_label_new(_("Custom file types:"));
597 gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0);
598 gtk_widget_show(label);
600 custom_filter_entry = gtk_entry_new();
601 if (custom_filter) gtk_entry_set_text(GTK_ENTRY(custom_filter_entry), custom_filter);
602 gtk_box_pack_start(GTK_BOX(vbox1),custom_filter_entry,FALSE,FALSE,0);
603 gtk_widget_show(custom_filter_entry);
605 hbox = gtk_hbox_new (FALSE, 0);
606 gtk_box_pack_start (GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
607 gtk_widget_show(hbox);
609 label = gtk_label_new(_("format: [.foo;.bar]"));
610 gtk_box_pack_end(GTK_BOX(hbox),label,FALSE,FALSE,5);
611 gtk_widget_show(label);
613 /* editor entry tab */
615 frame = gtk_frame_new(NULL);
616 gtk_container_border_width (GTK_CONTAINER (frame), 5);
617 gtk_widget_show(frame);
618 label = gtk_label_new(_("External Editors"));
619 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
621 vbox = gtk_vbox_new(FALSE,0);
622 gtk_container_border_width (GTK_CONTAINER (vbox), 5);
623 gtk_container_add (GTK_CONTAINER(frame),vbox);
624 gtk_widget_show(vbox);
626 table=gtk_table_new(3,9,FALSE);
627 gtk_container_add (GTK_CONTAINER(vbox),table);
628 gtk_widget_show(table);
630 label = gtk_label_new(_("#"));
631 gtk_table_attach_defaults(GTK_TABLE (table),label, 0, 1, 0, 1);
632 gtk_widget_show(label);
633 label = gtk_label_new(_("Menu name"));
634 gtk_table_attach_defaults(GTK_TABLE (table),label, 1, 2, 0, 1);
635 gtk_widget_show(label);
636 label = gtk_label_new(_("Command Line"));
637 gtk_table_attach_defaults(GTK_TABLE (table),label, 2, 3, 0, 1);
638 gtk_widget_show(label);
642 sprintf(buf,"%d",i+1);
643 label = gtk_label_new(buf);
644 gtk_table_attach_defaults(GTK_TABLE (table),label, 0, 1, i+1, i+2);
645 gtk_widget_show(label);
647 editor_name_entry[i] = gtk_entry_new_with_max_length(32);
648 gtk_widget_set_usize(editor_name_entry[i],80,-1);
649 if (editor_name[i]) gtk_entry_set_text(GTK_ENTRY(editor_name_entry[i]),editor_name[i]);
650 gtk_table_attach_defaults(GTK_TABLE (table),editor_name_entry[i],1,2,i+1,i+2);
651 gtk_widget_show(editor_name_entry[i]);
653 editor_command_entry[i] = gtk_entry_new_with_max_length(255);
654 gtk_widget_set_usize(editor_command_entry[i],160,-1);
655 tab_completion_add_to_entry(editor_command_entry[i], NULL, NULL);
656 if (editor_command[i]) gtk_entry_set_text(GTK_ENTRY(editor_command_entry[i]), editor_command[i]);
657 gtk_table_attach_defaults(GTK_TABLE (table),editor_command_entry[i],2,3,i+1,i+2);
658 gtk_widget_show(editor_command_entry[i]);
663 frame = gtk_frame_new(NULL);
664 gtk_container_border_width (GTK_CONTAINER (frame), 5);
665 gtk_widget_show(frame);
666 label = gtk_label_new(_("About"));
667 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
669 vbox = gtk_vbox_new (FALSE, 0);
670 gtk_container_add (GTK_CONTAINER(frame),vbox);
671 gtk_widget_show(vbox);
673 im = gdk_imlib_create_image_from_data((char *)logo, NULL, logo_width, logo_height);
674 gdk_imlib_render(im, logo_width, logo_height);
675 pixmap = gdk_imlib_move_image(im);
676 gdk_imlib_destroy_image(im);
678 button=gtk_pixmap_new(pixmap, NULL);
679 gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 0);
680 gtk_widget_show (button);
682 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);
683 label = gtk_label_new(buf);
684 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
685 gtk_widget_show (label);
687 gtk_notebook_set_page (GTK_NOTEBOOK(notebook), start_tab);
688 gtk_widget_show(notebook);
690 gtk_widget_show(configwindow);
694 *-----------------------------------------------------------------------------
695 * config/about window show (public)
696 *-----------------------------------------------------------------------------
699 void show_config_window()
701 if (configwindow) return;
702 config_window_create(0);
705 void show_about_window()
707 if (configwindow) return;
708 config_window_create(4);