comparison src/preferences.c @ 320:c74af1cbd61a

Move more options to ConfOptions.
author zas_
date Fri, 11 Apr 2008 22:52:22 +0000
parents f9611a6cf0e2
children 20d9b3cd7434
comparison
equal deleted inserted replaced
319:f9611a6cf0e2 320:c74af1cbd61a
256 { 256 {
257 g_free(options->fullscreen_info); 257 g_free(options->fullscreen_info);
258 options->fullscreen_info = g_strdup(options_c->fullscreen_info); 258 options->fullscreen_info = g_strdup(options_c->fullscreen_info);
259 } 259 }
260 260
261 update_on_time_change = update_on_time_change_c; 261 options->update_on_time_change = update_on_time_change_c;
262 exif_rotate_enable = exif_rotate_enable_c; 262 options->exif_rotate_enable = exif_rotate_enable_c;
263 263
264 options->dupe_custom_threshold = options_c->dupe_custom_threshold; 264 options->dupe_custom_threshold = options_c->dupe_custom_threshold;
265 265
266 tree_descend_subdirs = tree_descend_subdirs_c; 266 options->tree_descend_subdirs = tree_descend_subdirs_c;
267 #ifdef DEBUG 267 #ifdef DEBUG
268 debug = debug_c; 268 debug = debug_c;
269 #endif 269 #endif
270 270
271 #ifdef HAVE_LCMS 271 #ifdef HAVE_LCMS
272 for (i = 0; i < COLOR_PROFILE_INPUTS; i++) 272 for (i = 0; i < COLOR_PROFILE_INPUTS; i++)
273 { 273 {
274 g_free(color_profile_input_name[i]); 274 g_free(options->color_profile_input_name[i]);
275 color_profile_input_name[i] = NULL; 275 options->color_profile_input_name[i] = NULL;
276 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_input_name_entry[i])); 276 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_input_name_entry[i]));
277 if (buf && strlen(buf) > 0) color_profile_input_name[i] = g_strdup(buf); 277 if (buf && strlen(buf) > 0) options->color_profile_input_name[i] = g_strdup(buf);
278 278
279 g_free(color_profile_input_file[i]); 279 g_free(options->color_profile_input_file[i]);
280 color_profile_input_file[i] = NULL; 280 options->color_profile_input_file[i] = NULL;
281 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_input_file_entry[i])); 281 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_input_file_entry[i]));
282 if (buf && strlen(buf) > 0) color_profile_input_file[i] = g_strdup(buf); 282 if (buf && strlen(buf) > 0) options->color_profile_input_file[i] = g_strdup(buf);
283 } 283 }
284 g_free(color_profile_screen_file); 284 g_free(options->color_profile_screen_file);
285 color_profile_screen_file = NULL; 285 options->color_profile_screen_file = NULL;
286 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_screen_file_entry)); 286 buf = gtk_entry_get_text(GTK_ENTRY(color_profile_screen_file_entry));
287 if (buf && strlen(buf) > 0) color_profile_screen_file = g_strdup(buf); 287 if (buf && strlen(buf) > 0) options->color_profile_screen_file = g_strdup(buf);
288 #endif 288 #endif
289 289
290 for (i=0; ExifUIList[i].key; i++) 290 for (i=0; ExifUIList[i].key; i++)
291 { 291 {
292 ExifUIList[i].current = ExifUIList[i].temp; 292 ExifUIList[i].current = ExifUIList[i].temp;
293 } 293 }
294 294
295 l_conf = layout_config_get(layout_widget, &new_style); 295 l_conf = layout_config_get(layout_widget, &new_style);
296 296
297 if (new_style != layout_style || 297 if (new_style != options->layout_style ||
298 (l_conf == NULL) != (layout_order == NULL) || 298 (l_conf == NULL) != (options->layout_order == NULL) ||
299 !layout_order || 299 !options->layout_order ||
300 strcmp(buf, layout_order) != 0) 300 strcmp(buf, options->layout_order) != 0)
301 { 301 {
302 if (refresh) filter_rebuild(); 302 if (refresh) filter_rebuild();
303 refresh = FALSE; 303 refresh = FALSE;
304 304
305 g_free(layout_order); 305 g_free(options->layout_order);
306 layout_order = l_conf; 306 options->layout_order = l_conf;
307 l_conf = NULL; 307 l_conf = NULL;
308 308
309 layout_style = new_style; 309 options->layout_style = new_style;
310 310
311 layout_styles_update(); 311 layout_styles_update();
312 } 312 }
313 313
314 g_free(l_conf); 314 g_free(l_conf);
931 G_CALLBACK(pref_background_color_set_cb), &options_c->window_background_color); 931 G_CALLBACK(pref_background_color_set_cb), &options_c->window_background_color);
932 932
933 group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL); 933 group = pref_group_new(vbox, FALSE, _("Convenience"), GTK_ORIENTATION_VERTICAL);
934 934
935 pref_checkbox_new_int(group, _("Refresh on file change"), 935 pref_checkbox_new_int(group, _("Refresh on file change"),
936 update_on_time_change, &update_on_time_change_c); 936 options->update_on_time_change, &update_on_time_change_c);
937 pref_checkbox_new_int(group, _("Preload next image"), 937 pref_checkbox_new_int(group, _("Preload next image"),
938 options->enable_read_ahead, &options_c->enable_read_ahead); 938 options->enable_read_ahead, &options_c->enable_read_ahead);
939 pref_checkbox_new_int(group, _("Auto rotate image using Exif information"), 939 pref_checkbox_new_int(group, _("Auto rotate image using Exif information"),
940 exif_rotate_enable, &exif_rotate_enable_c); 940 options->exif_rotate_enable, &exif_rotate_enable_c);
941 } 941 }
942 942
943 /* windows tab */ 943 /* windows tab */
944 static void config_tab_windows(GtkWidget *notebook) 944 static void config_tab_windows(GtkWidget *notebook)
945 { 945 {
977 pref_checkbox_link_sensitivity(ct_button, spin); 977 pref_checkbox_link_sensitivity(ct_button, spin);
978 978
979 group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL); 979 group = pref_group_new(vbox, FALSE, _("Layout"), GTK_ORIENTATION_VERTICAL);
980 980
981 layout_widget = layout_config_new(); 981 layout_widget = layout_config_new();
982 layout_config_set(layout_widget, layout_style, layout_order); 982 layout_config_set(layout_widget, options->layout_style, options->layout_order);
983 gtk_box_pack_start(GTK_BOX(group), layout_widget, FALSE, FALSE, 0); 983 gtk_box_pack_start(GTK_BOX(group), layout_widget, FALSE, FALSE, 0);
984 gtk_widget_show(layout_widget); 984 gtk_widget_show(layout_widget);
985 } 985 }
986 986
987 /* filtering tab */ 987 /* filtering tab */
1356 1356
1357 pref_checkbox_new_int(group, _("Rectangular selection in icon view"), 1357 pref_checkbox_new_int(group, _("Rectangular selection in icon view"),
1358 options->collection_rectangular_selection, &options_c->collection_rectangular_selection); 1358 options->collection_rectangular_selection, &options_c->collection_rectangular_selection);
1359 1359
1360 pref_checkbox_new_int(group, _("Descend folders in tree view"), 1360 pref_checkbox_new_int(group, _("Descend folders in tree view"),
1361 tree_descend_subdirs, &tree_descend_subdirs_c); 1361 options->tree_descend_subdirs, &tree_descend_subdirs_c);
1362 1362
1363 pref_checkbox_new_int(group, _("In place renaming"), 1363 pref_checkbox_new_int(group, _("In place renaming"),
1364 options->enable_in_place_rename, &options_c->enable_in_place_rename); 1364 options->enable_in_place_rename, &options_c->enable_in_place_rename);
1365 1365
1366 group = pref_group_new(vbox, FALSE, _("Navigation"), GTK_ORIENTATION_VERTICAL); 1366 group = pref_group_new(vbox, FALSE, _("Navigation"), GTK_ORIENTATION_VERTICAL);
1408 g_free(buf); 1408 g_free(buf);
1409 1409
1410 entry = gtk_entry_new(); 1410 entry = gtk_entry_new();
1411 gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_NAME_MAX_LENGTH); 1411 gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_NAME_MAX_LENGTH);
1412 gtk_widget_set_size_request(editor_name_entry[i], 30, -1); 1412 gtk_widget_set_size_request(editor_name_entry[i], 30, -1);
1413 if (color_profile_input_name[i]) gtk_entry_set_text(GTK_ENTRY(entry), color_profile_input_name[i]); 1413 if (options->color_profile_input_name[i])
1414 {
1415 gtk_entry_set_text(GTK_ENTRY(entry), options->color_profile_input_name[i]);
1416 }
1414 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i + 1, i + 2, 1417 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i + 1, i + 2,
1415 GTK_FILL | GTK_EXPAND, 0, 0, 0); 1418 GTK_FILL | GTK_EXPAND, 0, 0, 0);
1416 gtk_widget_show(entry); 1419 gtk_widget_show(entry);
1417 color_profile_input_name_entry[i] = entry; 1420 color_profile_input_name_entry[i] = entry;
1418 1421
1419 tabcomp = tab_completion_new(&entry, color_profile_input_file[i], NULL, NULL); 1422 tabcomp = tab_completion_new(&entry, options->color_profile_input_file[i], NULL, NULL);
1420 tab_completion_add_select_button(entry, _("Select color profile"), FALSE); 1423 tab_completion_add_select_button(entry, _("Select color profile"), FALSE);
1421 gtk_widget_set_size_request(entry, 160, -1); 1424 gtk_widget_set_size_request(entry, 160, -1);
1422 gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, i + 1, i + 2, 1425 gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, i + 1, i + 2,
1423 GTK_FILL | GTK_EXPAND, 0, 0, 0); 1426 GTK_FILL | GTK_EXPAND, 0, 0, 0);
1424 gtk_widget_show(tabcomp); 1427 gtk_widget_show(tabcomp);
1425 color_profile_input_file_entry[i] = entry; 1428 color_profile_input_file_entry[i] = entry;
1426 } 1429 }
1427 1430
1428 pref_table_label(table, 0, COLOR_PROFILE_INPUTS + 1, _("Screen:"), 1.0); 1431 pref_table_label(table, 0, COLOR_PROFILE_INPUTS + 1, _("Screen:"), 1.0);
1429 tabcomp = tab_completion_new(&color_profile_screen_file_entry, 1432 tabcomp = tab_completion_new(&color_profile_screen_file_entry,
1430 color_profile_screen_file, NULL, NULL); 1433 options->color_profile_screen_file, NULL, NULL);
1431 tab_completion_add_select_button(color_profile_screen_file_entry, _("Select color profile"), FALSE); 1434 tab_completion_add_select_button(color_profile_screen_file_entry, _("Select color profile"), FALSE);
1432 gtk_widget_set_size_request(color_profile_screen_file_entry, 160, -1); 1435 gtk_widget_set_size_request(color_profile_screen_file_entry, 160, -1);
1433 gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, 1436 gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3,
1434 COLOR_PROFILE_INPUTS + 1, COLOR_PROFILE_INPUTS + 2, 1437 COLOR_PROFILE_INPUTS + 1, COLOR_PROFILE_INPUTS + 2,
1435 GTK_FILL | GTK_EXPAND, 0, 0, 0); 1438 GTK_FILL | GTK_EXPAND, 0, 0, 0);