1
|
1 /*
|
|
2 * GQview image viewer
|
3
|
3 * (C)2000 John Ellis
|
1
|
4 *
|
|
5 * Author: John Ellis
|
|
6 *
|
|
7 */
|
|
8
|
|
9 #include "gqview.h"
|
|
10
|
|
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;
|
|
39
|
4
|
40 static gint mousewheel_scrolls_c;
|
|
41
|
1
|
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];
|
|
47
|
|
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);
|
|
58
|
|
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);
|
|
64
|
|
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);
|
|
68
|
|
69 /*
|
|
70 *-----------------------------------------------------------------------------
|
|
71 * option widget callbacks (private)
|
|
72 *-----------------------------------------------------------------------------
|
|
73 */
|
|
74
|
|
75 static void startup_path_set_current(GtkWidget *widget, gpointer data)
|
|
76 {
|
|
77 gtk_entry_set_text(GTK_ENTRY(startup_path_entry), current_path);
|
|
78 }
|
|
79
|
|
80 static void slideshow_delay_cb(GtkObject *adj, gpointer data)
|
|
81 {
|
|
82 slideshow_delay_c = (gint)GTK_ADJUSTMENT(adj)->value;
|
|
83 }
|
|
84
|
|
85 static void zoom_mode_original_cb(GtkWidget *widget, gpointer data)
|
|
86 {
|
|
87 if (GTK_TOGGLE_BUTTON (widget)->active)
|
|
88 zoom_mode_c = ZOOM_RESET_ORIGINAL;
|
|
89 }
|
|
90
|
|
91 static void zoom_mode_fit_cb(GtkWidget *widget, gpointer data)
|
|
92 {
|
|
93 if (GTK_TOGGLE_BUTTON (widget)->active)
|
|
94 zoom_mode_c = ZOOM_RESET_FIT_WINDOW;
|
|
95 }
|
|
96
|
|
97 static void zoom_mode_none_cb(GtkWidget *widget, gpointer data)
|
|
98 {
|
|
99 if (GTK_TOGGLE_BUTTON (widget)->active)
|
|
100 zoom_mode_c = ZOOM_RESET_NONE;
|
|
101 }
|
|
102
|
|
103 static void max_window_size_cb(GtkObject *adj, gpointer data)
|
|
104 {
|
|
105 max_window_size_c = (gint)GTK_ADJUSTMENT(adj)->value;
|
|
106 }
|
|
107
|
|
108 static void thumb_size_48_selected(GtkWidget *w, gpointer data)
|
|
109 {
|
|
110 if (GTK_TOGGLE_BUTTON (w)->active)
|
|
111 {
|
|
112 thumb_max_width_c = 48;
|
|
113 thumb_max_height_c = 48;
|
|
114 }
|
|
115 }
|
|
116
|
|
117 static void thumb_size_64_selected(GtkWidget *w, gpointer data)
|
|
118 {
|
|
119 if (GTK_TOGGLE_BUTTON (w)->active)
|
|
120 {
|
|
121 thumb_max_width_c = 64;
|
|
122 thumb_max_height_c = 64;
|
|
123 }
|
|
124 }
|
|
125
|
|
126 static void thumb_size_85_selected(GtkWidget *w, gpointer data)
|
|
127 {
|
|
128 if (GTK_TOGGLE_BUTTON (w)->active)
|
|
129 {
|
|
130 thumb_max_width_c = 85;
|
|
131 thumb_max_height_c = 64;
|
|
132 }
|
|
133 }
|
|
134
|
|
135 static void thumb_size_100_selected(GtkWidget *w, gpointer data)
|
|
136 {
|
|
137 if (GTK_TOGGLE_BUTTON (w)->active)
|
|
138 {
|
|
139 thumb_max_width_c = 100;
|
|
140 thumb_max_height_c = 100;
|
|
141 }
|
|
142 }
|
|
143
|
|
144 /*
|
|
145 *-----------------------------------------------------------------------------
|
|
146 * sync progam to config window routine (private)
|
|
147 *-----------------------------------------------------------------------------
|
|
148 */
|
|
149
|
|
150 static void config_window_apply()
|
|
151 {
|
|
152 gchar *buf;
|
|
153 gint i;
|
|
154 gint refresh = FALSE;
|
|
155
|
|
156 for(i=0; i<8; i++)
|
|
157 {
|
|
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);
|
|
162
|
|
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);
|
|
167 }
|
|
168 update_edit_menus(mainwindow_accel_grp);
|
|
169
|
|
170 g_free(startup_path);
|
|
171 startup_path = NULL;
|
|
172 buf = gtk_entry_get_text(GTK_ENTRY(startup_path_entry));
|
|
173 if (buf && strlen(buf) > 0) startup_path = remove_trailing_slash(buf);
|
|
174
|
|
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);
|
|
181
|
|
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;
|
|
193
|
|
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;
|
|
218
|
|
219 slideshow_random = slideshow_random_c;
|
|
220 slideshow_repeat = slideshow_repeat_c;
|
|
221 slideshow_delay = slideshow_delay_c;
|
|
222
|
4
|
223 mousewheel_scrolls = mousewheel_scrolls_c;
|
|
224
|
1
|
225 if (refresh)
|
|
226 {
|
|
227 rebuild_file_filter();
|
|
228 filelist_refresh();
|
|
229 }
|
|
230 }
|
|
231
|
|
232 /*
|
|
233 *-----------------------------------------------------------------------------
|
|
234 * config window main button callbacks (private)
|
|
235 *-----------------------------------------------------------------------------
|
|
236 */
|
|
237
|
|
238 static void config_window_close_cb(GtkWidget *widget, gpointer data)
|
|
239 {
|
|
240 gtk_widget_destroy(configwindow);
|
|
241 configwindow = NULL;
|
|
242 }
|
|
243
|
|
244 static void config_window_destroy(GtkWidget *w, GdkEvent *event, gpointer data)
|
|
245 {
|
|
246 config_window_close_cb(NULL, NULL);
|
|
247 }
|
|
248
|
|
249 static void config_window_ok_cb(GtkWidget *widget, gpointer data)
|
|
250 {
|
|
251 config_window_apply();
|
|
252 config_window_close_cb(NULL, NULL);
|
|
253 }
|
|
254
|
|
255 static void config_window_apply_cb(GtkWidget *widget, gpointer data)
|
|
256 {
|
|
257 config_window_apply();
|
|
258 }
|
|
259
|
|
260 /*
|
|
261 *-----------------------------------------------------------------------------
|
|
262 * config window setup (private)
|
|
263 *-----------------------------------------------------------------------------
|
|
264 */
|
|
265
|
|
266 static void check_button_cb(GtkWidget *widget, gpointer data)
|
|
267 {
|
|
268 gint *value_ptr = data;
|
|
269 *value_ptr = GTK_TOGGLE_BUTTON (widget)->active;
|
|
270 }
|
|
271
|
|
272 static void add_check_button(gint option, gint *option_c, gchar *text, GtkWidget *box)
|
|
273 {
|
|
274 GtkWidget *button;
|
|
275 *option_c = option;
|
|
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);
|
|
281 }
|
|
282
|
|
283 static void config_window_create(gint start_tab)
|
|
284 {
|
|
285 GtkWidget *win_vbox;
|
|
286 GtkWidget *hbox;
|
|
287 GtkWidget *notebook;
|
|
288 GtkWidget *frame;
|
|
289 GtkWidget *label;
|
|
290 GtkWidget *vbox;
|
|
291 GtkWidget *vbox1;
|
|
292 GtkWidget *vbox2;
|
|
293 GtkWidget *button;
|
|
294 GtkWidget *tabcomp;
|
|
295 GtkWidget *radiobuttongroup;
|
|
296 GtkWidget *table;
|
|
297 GtkObject *adj;
|
|
298 GtkWidget *spin;
|
|
299 GdkImlibImage* im;
|
|
300 GdkPixmap *pixmap;
|
|
301 gchar buf[255];
|
|
302 gint i;
|
|
303
|
|
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);
|
|
310
|
|
311 win_vbox = gtk_vbox_new(FALSE, 5);
|
|
312 gtk_container_add(GTK_CONTAINER(configwindow), win_vbox);
|
|
313 gtk_widget_show(win_vbox);
|
|
314
|
|
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);
|
|
318
|
|
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);
|
|
323
|
|
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);
|
|
328
|
|
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);
|
|
333
|
|
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);
|
|
337
|
|
338 /* general options tab */
|
|
339
|
|
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);
|
|
345
|
|
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);
|
|
350
|
|
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);
|
|
355
|
|
356 vbox1 = gtk_vbox_new (FALSE, 0);
|
|
357 gtk_container_add (GTK_CONTAINER(frame),vbox1);
|
|
358 gtk_widget_show(vbox1);
|
|
359
|
|
360 add_check_button(startup_path_enable, &startup_path_enable_c,
|
|
361 _("On startup, change to this directory:"), vbox1);
|
|
362
|
|
363 hbox = gtk_hbox_new (FALSE, 0);
|
|
364 gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
|
|
365 gtk_widget_show(hbox);
|
|
366
|
|
367 gtk_widget_realize(configwindow);
|
|
368
|
|
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);
|
|
372
|
|
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);
|
|
377
|
|
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);
|
|
384
|
|
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);
|
|
389
|
|
390 vbox1 = gtk_vbox_new (FALSE, 0);
|
|
391 gtk_container_add (GTK_CONTAINER(frame),vbox1);
|
|
392 gtk_widget_show(vbox1);
|
|
393
|
|
394 hbox = gtk_hbox_new (FALSE, 0);
|
|
395 gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
|
|
396 gtk_widget_show(hbox);
|
|
397
|
|
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);
|
|
401
|
|
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);
|
|
409
|
|
410 add_check_button(slideshow_random, &slideshow_random_c,
|
|
411 _("Random"), vbox1);
|
|
412 add_check_button(slideshow_repeat, &slideshow_repeat_c,
|
|
413 _("Repeat"), vbox1);
|
|
414
|
|
415 /* image tab */
|
|
416
|
|
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);
|
|
422
|
|
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);
|
|
427
|
|
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);
|
|
432
|
|
433 vbox1 = gtk_vbox_new (FALSE, 0);
|
|
434 gtk_container_add (GTK_CONTAINER(frame),vbox1);
|
|
435 gtk_widget_show(vbox1);
|
|
436
|
|
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);
|
|
443
|
|
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);
|
|
449
|
|
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);
|
|
455
|
|
456 add_check_button(fit_window, &fit_window_c,
|
|
457 _("Fit window to image when tools are hidden/floating"), vbox);
|
|
458
|
|
459 hbox = gtk_hbox_new (FALSE, 0);
|
|
460 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
|
|
461 gtk_widget_show(hbox);
|
|
462
|
|
463 add_check_button(limit_window_size, &limit_window_size_c,
|
|
464 _("Limit size when auto-sizing window"), hbox);
|
|
465
|
|
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);
|
|
473
|
|
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);
|
|
478
|
|
479 vbox1 = gtk_vbox_new (FALSE, 0);
|
|
480 gtk_container_add (GTK_CONTAINER(frame),vbox1);
|
|
481 gtk_widget_show(vbox1);
|
|
482
|
|
483 hbox = gtk_hbox_new (FALSE, 0);
|
|
484 gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
|
|
485 gtk_widget_show(hbox);
|
|
486
|
|
487 thumb_max_width_c = thumb_max_width;
|
|
488 thumb_max_height_c = thumb_max_height;
|
|
489
|
|
490 label = gtk_label_new(_("Size:"));
|
|
491 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
|
|
492 gtk_widget_show(label);
|
|
493
|
|
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);
|
|
499
|
|
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);
|
|
505
|
|
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);
|
|
511
|
|
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);
|
|
517
|
|
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);
|
|
522
|
|
523 add_check_button(progressive_key_scrolling, &progressive_key_scrolling_c,
|
|
524 _("Progressive keyboard scrolling"), vbox);
|
4
|
525 add_check_button(mousewheel_scrolls, &mousewheel_scrolls_c,
|
|
526 _("Mouse wheel scrolls image"), vbox);
|
1
|
527
|
|
528 /* filtering tab */
|
|
529
|
|
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);
|
|
535
|
|
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);
|
|
540
|
|
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);
|
|
545
|
|
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);
|
|
550
|
|
551 vbox1 = gtk_vbox_new (FALSE, 0);
|
|
552 gtk_container_add (GTK_CONTAINER(frame),vbox1);
|
|
553 gtk_widget_show(vbox1);
|
|
554
|
|
555 hbox = gtk_hbox_new (TRUE, 0);
|
|
556 gtk_box_pack_start (GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
|
|
557 gtk_widget_show(hbox);
|
|
558
|
|
559 vbox2 = gtk_vbox_new (FALSE, 0);
|
|
560 gtk_box_pack_start (GTK_BOX(hbox), vbox2,FALSE, FALSE, 0);
|
|
561 gtk_widget_show(vbox2);
|
|
562
|
|
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,
|
|
566 "XPM", vbox2);
|
|
567 add_check_button(filter_include_tif, &filter_include_tif_c,
|
|
568 "TIF / TIFF", vbox2);
|
|
569
|
|
570 vbox2 = gtk_vbox_new (FALSE, 0);
|
|
571 gtk_box_pack_start (GTK_BOX(hbox), vbox2,FALSE, FALSE, 0);
|
|
572 gtk_widget_show(vbox2);
|
|
573
|
|
574 add_check_button(filter_include_gif, &filter_include_gif_c,
|
|
575 "GIF", vbox2);
|
|
576 add_check_button(filter_include_png, &filter_include_png_c,
|
|
577 "PNG", vbox2);
|
|
578 add_check_button(filter_include_ppm, &filter_include_ppm_c,
|
|
579 "PPM", vbox2);
|
|
580
|
|
581 vbox2 = gtk_vbox_new (FALSE, 0);
|
|
582 gtk_box_pack_start (GTK_BOX(hbox), vbox2,FALSE, FALSE, 0);
|
|
583 gtk_widget_show(vbox2);
|
|
584
|
|
585 add_check_button(filter_include_pgm, &filter_include_pgm_c,
|
|
586 "PGM", vbox2);
|
|
587 add_check_button(filter_include_pcx, &filter_include_pcx_c,
|
|
588 "PCX", vbox2);
|
|
589 add_check_button(filter_include_bmp, &filter_include_bmp_c,
|
|
590 "BMP", vbox2);
|
|
591
|
|
592 hbox = gtk_hbox_new (FALSE, 0);
|
|
593 gtk_box_pack_start (GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
|
|
594 gtk_widget_show(hbox);
|
|
595
|
|
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);
|
|
599
|
|
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);
|
|
604
|
|
605 hbox = gtk_hbox_new (FALSE, 0);
|
|
606 gtk_box_pack_start (GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
|
|
607 gtk_widget_show(hbox);
|
|
608
|
|
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);
|
|
612
|
|
613 /* editor entry tab */
|
|
614
|
|
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);
|
|
620
|
|
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);
|
|
625
|
|
626 table=gtk_table_new(3,9,FALSE);
|
|
627 gtk_container_add (GTK_CONTAINER(vbox),table);
|
|
628 gtk_widget_show(table);
|
|
629
|
|
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);
|
|
639
|
|
640 for (i=0; i<8; i++)
|
|
641 {
|
|
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);
|
|
646
|
|
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]);
|
|
652
|
|
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]);
|
|
659 }
|
|
660
|
|
661 /* about tab */
|
|
662
|
|
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);
|
|
668
|
|
669 vbox = gtk_vbox_new (FALSE, 0);
|
|
670 gtk_container_add (GTK_CONTAINER(frame),vbox);
|
|
671 gtk_widget_show(vbox);
|
|
672
|
|
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);
|
|
677
|
|
678 button=gtk_pixmap_new(pixmap, NULL);
|
|
679 gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 0);
|
|
680 gtk_widget_show (button);
|
|
681
|
3
|
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);
|
1
|
683 label = gtk_label_new(buf);
|
|
684 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
|
|
685 gtk_widget_show (label);
|
|
686
|
|
687 gtk_notebook_set_page (GTK_NOTEBOOK(notebook), start_tab);
|
|
688 gtk_widget_show(notebook);
|
|
689
|
|
690 gtk_widget_show(configwindow);
|
|
691 }
|
|
692
|
|
693 /*
|
|
694 *-----------------------------------------------------------------------------
|
|
695 * config/about window show (public)
|
|
696 *-----------------------------------------------------------------------------
|
|
697 */
|
|
698
|
|
699 void show_config_window()
|
|
700 {
|
|
701 if (configwindow) return;
|
|
702 config_window_create(0);
|
|
703 }
|
|
704
|
|
705 void show_about_window()
|
|
706 {
|
|
707 if (configwindow) return;
|
|
708 config_window_create(4);
|
|
709 }
|
|
710
|