Mercurial > geeqie
comparison src/rcfile.c @ 737:8a8873e7a552
Make shell command and its option rc file options instead of hardcoded strings.
This allows users to modify the shell command that execute "editors".
Two new options appear in rc file:
- shell.path (default to "/bin/sh")
- shell.options (default to "-c")
These options can only be changed from the rc file, not at runtime.
Tests are made to check that shell.path is not empty and lead to
an executable file.
author | zas_ |
---|---|
date | Thu, 22 May 2008 20:22:13 +0000 |
parents | 2d8a8e892b5e |
children | ff8b802eac58 |
comparison
equal
deleted
inserted
replaced
736:a7289f9e8d29 | 737:8a8873e7a552 |
---|---|
545 } | 545 } |
546 | 546 |
547 WRITE_SEPARATOR(); | 547 WRITE_SEPARATOR(); |
548 WRITE_INT(color_profile.screen_type); | 548 WRITE_INT(color_profile.screen_type); |
549 WRITE_CHAR(color_profile.screen_file); | 549 WRITE_CHAR(color_profile.screen_file); |
550 | |
551 | |
552 WRITE_SUBTITLE("Shell command"); | |
553 WRITE_CHAR(shell.path); | |
554 WRITE_CHAR(shell.options); | |
555 | |
550 | 556 |
551 WRITE_SUBTITLE("External Programs"); | 557 WRITE_SUBTITLE("External Programs"); |
552 secure_fprintf(ssi, "# Maximum of %d programs (external_1 through external_%d)\n", GQ_EDITOR_GENERIC_SLOTS, GQ_EDITOR_GENERIC_SLOTS); | 558 secure_fprintf(ssi, "# Maximum of %d programs (external_1 through external_%d)\n", GQ_EDITOR_GENERIC_SLOTS, GQ_EDITOR_GENERIC_SLOTS); |
553 secure_fprintf(ssi, "# external_%d through external_%d are used for file ops\n", GQ_EDITOR_GENERIC_SLOTS + 1, GQ_EDITOR_SLOTS); | 559 secure_fprintf(ssi, "# external_%d through external_%d are used for file ops\n", GQ_EDITOR_GENERIC_SLOTS + 1, GQ_EDITOR_SLOTS); |
554 secure_fprintf(ssi, "# format: external_n: \"menu name\" \"command line\"\n\n"); | 560 secure_fprintf(ssi, "# format: external_n: \"menu name\" \"command line\"\n\n"); |
877 } | 883 } |
878 | 884 |
879 READ_INT(color_profile.screen_type); | 885 READ_INT(color_profile.screen_type); |
880 READ_CHAR(color_profile.screen_file); | 886 READ_CHAR(color_profile.screen_file); |
881 | 887 |
888 /* Shell command */ | |
889 READ_CHAR(shell.path); | |
890 READ_CHAR(shell.options); | |
891 | |
882 /* External Programs */ | 892 /* External Programs */ |
883 | 893 |
884 if (is_numbered_option(option, "external_", &i)) | 894 if (is_numbered_option(option, "external_", &i)) |
885 { | 895 { |
886 if (i > 0 && i <= GQ_EDITOR_SLOTS) | 896 if (i > 0 && i <= GQ_EDITOR_SLOTS) |