comparison src/rcfile.c @ 377:9efefd85684a

Cleanup read/write of image.zoom_mode option.
author zas_
date Tue, 15 Apr 2008 21:06:00 +0000
parents 9c89fc358c16
children 5afe77bb563a
comparison
equal deleted inserted replaced
376:9c89fc358c16 377:9efefd85684a
365 365
366 WRITE_BOOL(layout.toolbar_hidden); 366 WRITE_BOOL(layout.toolbar_hidden);
367 367
368 368
369 WRITE_SUBTITLE("Image Options"); 369 WRITE_SUBTITLE("Image Options");
370 370
371 secure_fprintf(ssi, "# image.zoom_mode possible values are:\n"
372 "# original\n"
373 "# fit\n"
374 "# dont_change\n");
371 secure_fprintf(ssi, "image.zoom_mode: "); 375 secure_fprintf(ssi, "image.zoom_mode: ");
372 if (options->image.zoom_mode == ZOOM_RESET_ORIGINAL) secure_fprintf(ssi, "original\n"); 376 if (options->image.zoom_mode == ZOOM_RESET_ORIGINAL)
373 if (options->image.zoom_mode == ZOOM_RESET_FIT_WINDOW) secure_fprintf(ssi, "fit\n"); 377 secure_fprintf(ssi, "original\n");
374 if (options->image.zoom_mode == ZOOM_RESET_NONE) secure_fprintf(ssi, "dont_change\n"); 378 else if (options->image.zoom_mode == ZOOM_RESET_FIT_WINDOW)
379 secure_fprintf(ssi, "fit\n");
380 else if (options->image.zoom_mode == ZOOM_RESET_NONE)
381 secure_fprintf(ssi, "dont_change\n");
382 WRITE_SEPARATOR();
375 WRITE_BOOL(image.zoom_2pass); 383 WRITE_BOOL(image.zoom_2pass);
376 WRITE_BOOL(image.zoom_to_fit_allow_expand); 384 WRITE_BOOL(image.zoom_to_fit_allow_expand);
377 WRITE_INT(image.zoom_quality); 385 WRITE_INT(image.zoom_quality);
378 WRITE_INT(image.zoom_increment); 386 WRITE_INT(image.zoom_increment);
379 WRITE_BOOL(image.fit_window_to_image); 387 WRITE_BOOL(image.fit_window_to_image);
637 645
638 646
639 /* image options */ 647 /* image options */
640 if (strcasecmp(option, "image.zoom_mode") == 0) 648 if (strcasecmp(option, "image.zoom_mode") == 0)
641 { 649 {
642 if (strcasecmp(value, "original") == 0) options->image.zoom_mode = ZOOM_RESET_ORIGINAL; 650 if (strcasecmp(value, "original") == 0)
643 if (strcasecmp(value, "fit") == 0) options->image.zoom_mode = ZOOM_RESET_FIT_WINDOW; 651 options->image.zoom_mode = ZOOM_RESET_ORIGINAL;
644 if (strcasecmp(value, "dont_change") == 0) options->image.zoom_mode = ZOOM_RESET_NONE; 652 else if (strcasecmp(value, "fit") == 0)
653 options->image.zoom_mode = ZOOM_RESET_FIT_WINDOW;
654 else if (strcasecmp(value, "dont_change") == 0)
655 options->image.zoom_mode = ZOOM_RESET_NONE;
645 } 656 }
646 READ_BOOL(image.zoom_2pass); 657 READ_BOOL(image.zoom_2pass);
647 READ_BOOL(image.zoom_to_fit_allow_expand); 658 READ_BOOL(image.zoom_to_fit_allow_expand);
648 READ_BOOL(image.fit_window_to_image); 659 READ_BOOL(image.fit_window_to_image);
649 READ_BOOL(image.limit_window_size); 660 READ_BOOL(image.limit_window_size);