comparison src/rcfile.c @ 327:049d6b00cc14

Rename color profile options.
author zas_
date Sat, 12 Apr 2008 08:05:44 +0000
parents 509b84801d66
children a51242c032ea
comparison
equal deleted inserted replaced
326:509b84801d66 327:049d6b00cc14
273 secure_fprintf(ssi, "# but user comments and formatting will be lost.\n"); 273 secure_fprintf(ssi, "# but user comments and formatting will be lost.\n");
274 secure_fputc(ssi, '\n'); 274 secure_fputc(ssi, '\n');
275 275
276 secure_fprintf(ssi, "##### General Options #####\n\n"); 276 secure_fprintf(ssi, "##### General Options #####\n\n");
277 277
278 write_int_option(ssi, "layout_style", options->layout_style); 278 write_int_option(ssi, "layout.style", options->layout.style);
279 write_char_option(ssi, "layout_order", options->layout_order); 279 write_char_option(ssi, "layout.order", options->layout.order);
280 secure_fputc(ssi, '\n'); 280 secure_fputc(ssi, '\n');
281 281
282 write_bool_option(ssi, "layout_view_as_icons", options->layout_view_icons); 282 write_bool_option(ssi, "layout.view_as_icons", options->layout.view_as_icons);
283 write_bool_option(ssi, "layout_view_as_tree", options->layout_view_tree); 283 write_bool_option(ssi, "layout.view_as_tree", options->layout.view_as_tree);
284 write_bool_option(ssi, "show_icon_names", options->show_icon_names); 284 write_bool_option(ssi, "show_icon_names", options->show_icon_names);
285 secure_fputc(ssi, '\n'); 285 secure_fputc(ssi, '\n');
286 286
287 write_bool_option(ssi, "tree_descend_folders", options->tree_descend_subdirs); 287 write_bool_option(ssi, "tree_descend_folders", options->tree_descend_subdirs);
288 write_bool_option(ssi, "lazy_image_sync", options->lazy_image_sync); 288 write_bool_option(ssi, "lazy_image_sync", options->lazy_image_sync);
391 #ifndef HAVE_LCMS 391 #ifndef HAVE_LCMS
392 secure_fprintf(ssi, "# NOTICE: %s was not built with support for color profiles,\n" 392 secure_fprintf(ssi, "# NOTICE: %s was not built with support for color profiles,\n"
393 "# color profile options will have no effect.\n\n", GQ_APPNAME); 393 "# color profile options will have no effect.\n\n", GQ_APPNAME);
394 #endif 394 #endif
395 395
396 write_bool_option(ssi, "color_profile_enabled", options->color_profile_enabled); 396 write_bool_option(ssi, "color_profile.enabled", options->color_profile.enabled);
397 write_bool_option(ssi, "color_profile_use_image", options->color_profile_use_image); 397 write_bool_option(ssi, "color_profile.use_image", options->color_profile.use_image);
398 write_int_option(ssi, "color_profile_input_type", options->color_profile_input_type); 398 write_int_option(ssi, "color_profile.input_type", options->color_profile.input_type);
399 for (i = 0; i < COLOR_PROFILE_INPUTS; i++) 399 for (i = 0; i < COLOR_PROFILE_INPUTS; i++)
400 { 400 {
401 gchar *buf; 401 gchar *buf;
402 402
403 buf = g_strdup_printf("color_profile_input_file_%d", i + 1); 403 buf = g_strdup_printf("color_profile.input_file_%d", i + 1);
404 write_char_option(ssi, buf, options->color_profile_input_file[i]); 404 write_char_option(ssi, buf, options->color_profile.input_file[i]);
405 g_free(buf); 405 g_free(buf);
406 406
407 buf = g_strdup_printf("color_profile_input_name_%d", i + 1); 407 buf = g_strdup_printf("color_profile.input_name_%d", i + 1);
408 write_char_option(ssi, buf, options->color_profile_input_name[i]); 408 write_char_option(ssi, buf, options->color_profile.input_name[i]);
409 g_free(buf); 409 g_free(buf);
410 } 410 }
411 secure_fputc(ssi, '\n'); 411 secure_fputc(ssi, '\n');
412 write_int_option(ssi, "color_profile_screen_type", options->color_profile_screen_type); 412 write_int_option(ssi, "color_profile.screen_type", options->color_profile.screen_type);
413 write_char_option(ssi, "color_profile_screen_file_1", options->color_profile_screen_file); 413 write_char_option(ssi, "color_profile.screen_file", options->color_profile.screen_file);
414 414
415 secure_fprintf(ssi, "\n##### External Programs #####\n"); 415 secure_fprintf(ssi, "\n##### External Programs #####\n");
416 secure_fprintf(ssi, "# Maximum of 10 programs (external_1 through external_10)\n"); 416 secure_fprintf(ssi, "# Maximum of 10 programs (external_1 through external_10)\n");
417 secure_fprintf(ssi, "# format: external_n: \"menu name\" \"command line\"\n\n"); 417 secure_fprintf(ssi, "# format: external_n: \"menu name\" \"command line\"\n\n");
418 418
525 strncpy(option, s_buf, sizeof(option)); 525 strncpy(option, s_buf, sizeof(option));
526 strncpy(value, s_buf_ptr, sizeof(value)); 526 strncpy(value, s_buf_ptr, sizeof(value));
527 527
528 /* general options */ 528 /* general options */
529 529
530 options->layout_style = read_int_option(f, option, 530 options->layout.style = read_int_option(f, option,
531 "layout_style", value, options->layout_style); 531 "layout.style", value, options->layout.style);
532 options->layout_order = read_char_option(f, option, 532 options->layout.order = read_char_option(f, option,
533 "layout_order", value, options->layout_order); 533 "layout.order", value, options->layout.order);
534 options->layout_view_icons = read_bool_option(f, option, 534 options->layout.view_as_icons = read_bool_option(f, option,
535 "layout_view_as_icons", value, options->layout_view_icons); 535 "layout.view_as_icons", value, options->layout.view_as_icons);
536 options->layout_view_tree = read_bool_option(f, option, 536 options->layout.view_as_tree = read_bool_option(f, option,
537 "layout_view_as_tree", value, options->layout_view_tree); 537 "layout.view_as_tree", value, options->layout.view_as_tree);
538 options->show_icon_names = read_bool_option(f, option, 538 options->show_icon_names = read_bool_option(f, option,
539 "show_icon_names", value, options->show_icon_names); 539 "show_icon_names", value, options->show_icon_names);
540 540
541 options->tree_descend_subdirs = read_bool_option(f, option, 541 options->tree_descend_subdirs = read_bool_option(f, option,
542 "tree_descend_folders", value, options->tree_descend_subdirs); 542 "tree_descend_folders", value, options->tree_descend_subdirs);
702 sidecar_ext_parse(value_all, TRUE); 702 sidecar_ext_parse(value_all, TRUE);
703 } 703 }
704 704
705 /* Color Profiles */ 705 /* Color Profiles */
706 706
707 options->color_profile_enabled = read_bool_option(f, option, 707 options->color_profile.enabled = read_bool_option(f, option,
708 "color_profile_enabled", value, options->color_profile_enabled); 708 "color_profile.enabled", value, options->color_profile.enabled);
709 options->color_profile_use_image = read_bool_option(f, option, 709 options->color_profile.use_image = read_bool_option(f, option,
710 "color_profile_use_image", value, options->color_profile_use_image); 710 "color_profile.use_image", value, options->color_profile.use_image);
711 options->color_profile_input_type = read_int_option(f, option, 711 options->color_profile.input_type = read_int_option(f, option,
712 "color_profile_input_type", value, options->color_profile_input_type); 712 "color_profile.input_type", value, options->color_profile.input_type);
713 713
714 if (strncasecmp(option, "color_profile_input_file_", 25) == 0) 714 if (strncasecmp(option, "color_profile.input_file_", 25) == 0)
715 { 715 {
716 i = strtol(option + 25, NULL, 0) - 1; 716 i = strtol(option + 25, NULL, 0) - 1;
717 if (i >= 0 && i < COLOR_PROFILE_INPUTS) 717 if (i >= 0 && i < COLOR_PROFILE_INPUTS)
718 { 718 {
719 options->color_profile_input_file[i] = read_char_option(f, option, 719 options->color_profile.input_file[i] = read_char_option(f, option,
720 option, value, options->color_profile_input_file[i]); 720 option, value, options->color_profile.input_file[i]);
721 } 721 }
722 } 722 }
723 if (strncasecmp(option, "color_profile_input_name_", 25) == 0) 723 if (strncasecmp(option, "color_profile.input_name_", 25) == 0)
724 { 724 {
725 i = strtol(option + 25, NULL, 0) - 1; 725 i = strtol(option + 25, NULL, 0) - 1;
726 if (i >= 0 && i < COLOR_PROFILE_INPUTS) 726 if (i >= 0 && i < COLOR_PROFILE_INPUTS)
727 { 727 {
728 options->color_profile_input_name[i] = read_char_option(f, option, 728 options->color_profile.input_name[i] = read_char_option(f, option,
729 option, value, options->color_profile_input_name[i]); 729 option, value, options->color_profile.input_name[i]);
730 } 730 }
731 } 731 }
732 732
733 options->color_profile_screen_type = read_int_option(f, option, 733 options->color_profile.screen_type = read_int_option(f, option,
734 "color_profile_screen_type", value, options->color_profile_screen_type); 734 "color_profile.screen_type", value, options->color_profile.screen_type);
735 options->color_profile_screen_file = read_char_option(f, option, 735 options->color_profile.screen_file = read_char_option(f, option,
736 "color_profile_screen_file_1", value, options->color_profile_screen_file); 736 "color_profile.screen_file", value, options->color_profile.screen_file);
737 737
738 /* External Programs */ 738 /* External Programs */
739 739
740 if (strncasecmp(option, "external_", 9) == 0) 740 if (strncasecmp(option, "external_", 9) == 0)
741 { 741 {