3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
25 #include "converter.h"
34 #include "graphics/GraphicsTypes.h"
36 #include "support/convert.h"
37 #include "support/environment.h"
38 #include "support/filetools.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
43 namespace os = lyx::support::os;
46 using lyx::support::ascii_lowercase;
47 using lyx::support::bformat;
48 using lyx::support::expandPath;
49 using lyx::support::getEnv;
50 using lyx::support::libFileSearch;
51 using lyx::support::token;
52 using lyx::support::tokenPos;
65 // when adding something to this array keep it sorted!
66 keyword_item lyxrcTags[] = {
67 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
68 { "\\alternate_language", LyXRC::RC_ALT_LANG },
69 { "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
70 { "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
71 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
72 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
73 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
74 { "\\autosave", LyXRC::RC_AUTOSAVE },
75 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
76 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
77 { "\\bind_file", LyXRC::RC_BINDFILE },
78 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
79 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
80 { "\\converter", LyXRC::RC_CONVERTER },
81 { "\\copier", LyXRC::RC_COPIER },
82 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
83 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
84 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
85 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
86 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
87 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
88 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
89 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
90 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
91 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
92 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
93 { "\\format", LyXRC::RC_FORMAT },
94 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
95 { "\\input", LyXRC::RC_INPUT },
96 { "\\kbmap", LyXRC::RC_KBMAP },
97 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
98 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
99 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
100 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
101 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
102 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
103 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
104 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
105 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
106 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
107 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
108 { "\\load_session", LyXRC::RC_LOADSESSION },
109 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
110 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
111 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
112 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
113 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
114 { "\\popup_bold_font", LyXRC::RC_POPUP_BOLD_FONT },
115 { "\\popup_font_encoding", LyXRC::RC_POPUP_FONT_ENCODING },
116 { "\\popup_normal_font", LyXRC::RC_POPUP_NORMAL_FONT },
117 { "\\preview", LyXRC::RC_PREVIEW },
118 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
119 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
120 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
121 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
122 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
123 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
124 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
125 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
126 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
127 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
128 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
129 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
130 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
131 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
132 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
133 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
134 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
135 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
136 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
137 { "\\printer", LyXRC::RC_PRINTER },
138 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
139 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
140 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
141 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
142 { "\\screen_font_encoding_menu", LyXRC::RC_POPUP_FONT_ENCODING },
143 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
144 { "\\screen_font_menu", LyXRC::RC_POPUP_BOLD_FONT },
145 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
146 { "\\screen_font_popup", LyXRC::RC_POPUP_NORMAL_FONT },
147 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
148 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
149 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
150 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
151 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
152 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
153 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
154 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
155 { "\\screen_geometry_height", LyXRC::RC_SCREEN_GEOMETRY_HEIGHT },
156 { "\\screen_geometry_width", LyXRC::RC_SCREEN_GEOMETRY_WIDTH },
157 { "\\screen_geometry_xysaved", LyXRC::RC_SCREEN_GEOMETRY_XYSAVED },
158 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
159 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
160 { "\\set_color", LyXRC::RC_SET_COLOR },
161 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
162 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
163 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
164 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
165 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
166 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
167 { "\\ui_file", LyXRC::RC_UIFILE },
168 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
169 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
170 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
171 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
172 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
173 // compatibility with versions older than 1.4.0 only
174 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
175 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
176 // compatibility with versions older than 1.4.0 only
177 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
178 { "\\user_email", LyXRC::RC_USER_EMAIL },
179 { "\\user_name", LyXRC::RC_USER_NAME },
180 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
181 // compatibility with versions older than 1.4.0 only
182 { "\\viewer" ,LyXRC::RC_VIEWER}
185 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
196 void LyXRC::setDefaults() {
199 // Get printer from the environment. If fail, use default "",
200 // assuming that everything is set up correctly.
201 printer = getEnv("PRINTER");
202 print_adapt_output = false;
203 print_command = "dvips";
204 print_evenpage_flag = "-B";
205 print_oddpage_flag = "-A";
206 print_pagerange_flag = "-pp";
207 print_copies_flag = "-c";
208 print_collcopies_flag = "-C";
209 print_reverse_flag = "-r";
210 print_landscape_flag = "-t landscape";
211 print_to_printer = "-P";
212 print_to_file = "-o ";
213 print_file_extension = ".ps";
214 print_paper_flag = "-t";
215 print_paper_dimension_flag = "-T";
216 document_path.erase();
217 view_dvi_paper_option.erase();
218 default_papersize = PAPER_DEFAULT;
219 custom_export_format = "ps";
220 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
221 bibtex_command = "bibtex";
223 index_command = "makeindex -c -q";
225 // Because a screen typically is wider than a piece of paper:
229 geometry_xysaved = true;
230 // Default LaTeX font size:
231 font_sizes[LyXFont::SIZE_TINY] = "5.0";
232 font_sizes[LyXFont::SIZE_SCRIPT] = "7.0";
233 font_sizes[LyXFont::SIZE_FOOTNOTE] = "8.0";
234 font_sizes[LyXFont::SIZE_SMALL] = "9.0";
235 font_sizes[LyXFont::SIZE_NORMAL] = "10.0";
236 font_sizes[LyXFont::SIZE_LARGE] = "12.0";
237 font_sizes[LyXFont::SIZE_LARGER] = "14.4";
238 font_sizes[LyXFont::SIZE_LARGEST] = "17.26";
239 font_sizes[LyXFont::SIZE_HUGE] = "20.74";
240 font_sizes[LyXFont::SIZE_HUGER] = "24.88";
241 use_scalable_fonts = true;
242 roman_font_name = "";
244 typewriter_font_name = "";
245 popup_bold_font = "-*-helvetica-bold-r";
246 popup_normal_font = "-*-helvetica-medium-r";
247 font_norm = "iso8859-1";
248 font_norm_type = ISO_8859_1;
249 popup_font_encoding.erase();
251 auto_region_delete = true;
252 auto_reset_options = false;
254 num_lastfiles = maxlastfiles;
255 check_lastfiles = true;
256 use_lastfilepos = true;
257 load_session = false;
259 backupdir_path.erase();
260 display_graphics = lyx::graphics::ColorDisplay;
261 // Spellchecker settings:
262 use_spell_lib = true;
263 isp_command = "ispell";
264 isp_accept_compound = false;
265 isp_use_input_encoding = false;
266 isp_use_alt_lang = false;
267 isp_use_pers_dict = false;
268 isp_use_esc_chars = false;
272 mark_foreign_language = true;
273 language_auto_begin = true;
274 language_auto_end = true;
275 language_global_options = true;
276 language_use_babel = true;
277 language_package = "\\usepackage{babel}";
278 language_command_begin = "\\selectlanguage{$$lang}";
279 language_command_local = "\\foreignlanguage{$$lang}{";
280 default_language = "english";
282 windows_style_tex_paths = false;
283 tex_allows_spaces = false;
284 date_insert_format = "%A, %e %B %Y";
285 cursor_follows_scrollbar = false;
286 dialogs_iconify_with_main = false;
287 label_init_length = 3;
288 preview = PREVIEW_OFF;
289 preview_hashed_labels = false;
290 preview_scale_factor = "0.9";
292 user_name = lyx::support::user_name();
294 user_email = lyx::support::user_email();
300 void oldFontFormat(string & family, string & foundry)
302 if (family.empty() || family[0] != '-')
304 foundry = token(family, '-', 1);
305 family = token(family, '-', 2);
313 int LyXRC::read(string const & filename)
315 LyXLex lexrc(lyxrcTags, lyxrcCount);
316 if (lyxerr.debugging(Debug::PARSER))
317 lexrc.printTable(lyxerr);
319 lexrc.setFile(filename);
320 if (!lexrc.isOK()) return -2;
322 lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
328 int LyXRC::read(std::istream & is)
330 LyXLex lexrc(lyxrcTags, lyxrcCount);
331 if (lyxerr.debugging(Debug::PARSER))
332 lexrc.printTable(lyxerr);
335 if (!lexrc.isOK()) return -2;
337 lyxerr[Debug::LYXRC] << "Reading istream..." << endl;
343 int LyXRC::read(LyXLex & lexrc)
345 if (!lexrc.isOK()) return -2;
347 while (lexrc.isOK()) {
348 // By using two switches we take advantage of the compiler
349 // telling us if we have missed a LyXRCTags element in
350 // the second switch.
351 // Note that this also shows a problem with LyXLex since it
352 // helps us avoid taking advantage of the strictness of the
355 int le = lexrc.lex();
357 case LyXLex::LEX_UNDEF:
358 lexrc.printError("Unknown tag `$$Token'");
360 case LyXLex::LEX_FEOF:
364 switch (static_cast<LyXRCTags>(le)) {
365 case RC_INPUT: // Include file
368 libFileSearch(string(),
371 lexrc.printError("Error reading "
372 "included file: "+tmp);
378 bind_file = os::internal_path(lexrc.getString());
384 ui_file = os::internal_path(lexrc.getString());
388 case RC_AUTORESET_OPTIONS:
390 auto_reset_options = lexrc.getBool();
394 case RC_DISPLAY_GRAPHICS:
396 display_graphics = lyx::graphics::displayTranslator().find(lexrc.getString());
400 case RC_TEX_EXPECTS_WINDOWS_PATHS:
402 windows_style_tex_paths = lexrc.getBool();
406 case RC_TEX_ALLOWS_SPACES:
408 tex_allows_spaces = lexrc.getBool();
414 use_kbmap = lexrc.getBool();
418 case RC_KBMAP_PRIMARY:
420 string const kmap(os::internal_path(lexrc.getString()));
423 } else if (!libFileSearch("kbd", kmap,
425 primary_kbmap = kmap;
427 lexrc.printError("LyX: Keymap `$$Token' not found");
432 case RC_KBMAP_SECONDARY:
434 string const kmap(os::internal_path(lexrc.getString()));
437 } else if (!libFileSearch("kbd", kmap,
439 secondary_kbmap = kmap;
441 lexrc.printError("LyX: Keymap `$$Token' not found");
446 case RC_FONT_ENCODING:
448 fontenc = lexrc.getString();
454 printer = lexrc.getString();
458 case RC_PRINT_COMMAND:
460 print_command = lexrc.getString();
464 case RC_PRINTEVENPAGEFLAG:
466 print_evenpage_flag = lexrc.getString();
470 case RC_PRINTODDPAGEFLAG:
472 print_oddpage_flag = lexrc.getString();
476 case RC_PRINTPAGERANGEFLAG:
478 print_pagerange_flag = lexrc.getString();
482 case RC_PRINTCOPIESFLAG:
484 print_copies_flag = lexrc.getString();
488 case RC_PRINTCOLLCOPIESFLAG:
490 print_collcopies_flag = lexrc.getString();
494 case RC_PRINTREVERSEFLAG:
496 print_reverse_flag = lexrc.getString();
500 case RC_PRINTLANDSCAPEFLAG:
502 print_landscape_flag = lexrc.getString();
506 case RC_PRINTTOPRINTER:
508 print_to_printer = lexrc.getString();
512 case RC_PRINT_ADAPTOUTPUT:
514 print_adapt_output = lexrc.getBool();
520 print_to_file = os::internal_path(lexrc.getString());
524 case RC_PRINTFILEEXTENSION:
526 print_file_extension = lexrc.getString();
530 case RC_PRINTEXSTRAOPTIONS:
532 print_extra_options = lexrc.getString();
536 case RC_PRINTSPOOL_COMMAND:
538 print_spool_command = lexrc.getString();
542 case RC_PRINTSPOOL_PRINTERPREFIX:
544 print_spool_printerprefix = lexrc.getString();
548 case RC_PRINTPAPERDIMENSIONFLAG:
550 print_paper_dimension_flag = lexrc.getString();
554 case RC_PRINTPAPERFLAG:
556 print_paper_flag = lexrc.getString();
560 case RC_CUSTOM_EXPORT_COMMAND:
562 custom_export_command = lexrc.getString();
566 case RC_CUSTOM_EXPORT_FORMAT:
568 custom_export_format = lexrc.getString();
572 case RC_DEFAULT_PAPERSIZE:
575 ascii_lowercase(lexrc.getString());
576 if (size == "usletter")
579 else if (size == "legal")
582 else if (size == "executive")
585 else if (size == "a3")
588 else if (size == "a4")
591 else if (size == "a5")
594 else if (size == "b5")
597 else if (size == "default")
603 case RC_VIEWDVI_PAPEROPTION:
605 view_dvi_paper_option = lexrc.getString();
607 view_dvi_paper_option.erase();
611 case RC_CHKTEX_COMMAND:
613 chktex_command = lexrc.getString();
617 case RC_BIBTEX_COMMAND:
619 bibtex_command = lexrc.getString();
623 case RC_INDEX_COMMAND:
625 index_command = lexrc.getString();
631 dpi = lexrc.getInteger();
637 zoom = lexrc.getInteger();
641 case RC_SCREEN_GEOMETRY_HEIGHT:
643 geometry_height = lexrc.getInteger();
647 case RC_SCREEN_GEOMETRY_WIDTH:
649 geometry_width = lexrc.getInteger();
653 case RC_SCREEN_GEOMETRY_XYSAVED:
655 geometry_xysaved = lexrc.getBool();
659 case RC_SCREEN_FONT_SIZES:
661 font_sizes[LyXFont::SIZE_TINY] =
665 font_sizes[LyXFont::SIZE_SCRIPT] =
669 font_sizes[LyXFont::SIZE_FOOTNOTE] =
673 font_sizes[LyXFont::SIZE_SMALL] =
677 font_sizes[LyXFont::SIZE_NORMAL] =
681 font_sizes[LyXFont::SIZE_LARGE] =
685 font_sizes[LyXFont::SIZE_LARGER] =
689 font_sizes[LyXFont::SIZE_LARGEST] =
693 font_sizes[LyXFont::SIZE_HUGE] =
697 font_sizes[LyXFont::SIZE_HUGER] =
702 case RC_SCREEN_FONT_SCALABLE:
704 use_scalable_fonts = lexrc.getBool();
710 autosave = lexrc.getInteger();
714 case RC_DOCUMENTPATH:
716 document_path = os::internal_path(lexrc.getString());
717 document_path = expandPath(document_path);
721 case RC_TEMPLATEPATH:
723 template_path = os::internal_path(lexrc.getString());
724 template_path = expandPath(template_path);
730 tempdir_path = os::internal_path(lexrc.getString());
731 tempdir_path = expandPath(tempdir_path);
737 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
741 case RC_USELASTFILEPOS:
743 use_lastfilepos = lexrc.getBool();
749 load_session = lexrc.getBool();
753 case RC_NUMLASTFILES:
755 num_lastfiles = lexrc.getInteger();
759 case RC_CHECKLASTFILES:
761 check_lastfiles = lexrc.getBool();
765 case RC_SCREEN_FONT_ROMAN:
767 roman_font_name = lexrc.getString();
768 oldFontFormat(roman_font_name,
773 case RC_SCREEN_FONT_SANS:
775 sans_font_name = lexrc.getString();
776 oldFontFormat(sans_font_name, sans_font_foundry);
780 case RC_SCREEN_FONT_TYPEWRITER:
782 typewriter_font_name = lexrc.getString();
783 oldFontFormat(typewriter_font_name,
784 typewriter_font_foundry);
788 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
790 roman_font_foundry = lexrc.getString();
794 case RC_SCREEN_FONT_SANS_FOUNDRY:
796 sans_font_foundry = lexrc.getString();
800 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
802 typewriter_font_foundry = lexrc.getString();
806 case RC_SCREEN_FONT_ENCODING:
808 font_norm = lexrc.getString();
809 set_font_norm_type();
813 case RC_POPUP_BOLD_FONT:
815 popup_bold_font = lexrc.getString();
819 case RC_POPUP_NORMAL_FONT:
821 popup_normal_font = lexrc.getString();
825 case RC_POPUP_FONT_ENCODING:
827 popup_font_encoding = lexrc.getString();
833 string lyx_name, x11_name;
836 lyx_name = lexrc.getString();
838 lexrc.printError("Missing color tag.");
843 x11_name = lexrc.getString();
845 lexrc.printError("Missing color name for color: `$$Token'");
849 LColor::color const col =
850 lcolor.getFromLyXName(lyx_name);
851 if (col == LColor::none ||
852 col == LColor::inherit ||
853 col == LColor::ignore)
856 if (!lcolor.setColor(col, x11_name)) {
857 lyxerr << "Bad lyxrc set_color for "
863 case RC_AUTOREGIONDELETE:
864 // Auto region delete defaults to true
866 auto_region_delete = lexrc.getBool();
872 lyxpipes = os::internal_path(lexrc.getString());
873 lyxpipes = expandPath(lyxpipes);
877 case RC_CURSOR_FOLLOWS_SCROLLBAR:
879 cursor_follows_scrollbar = lexrc.getBool();
883 case RC_DIALOGS_ICONIFY_WITH_MAIN:
885 dialogs_iconify_with_main = lexrc.getBool();
889 case RC_ASCIIROFF_COMMAND:
891 ascii_roff_command = lexrc.getString();
894 case RC_ASCII_LINELEN:
896 ascii_linelen = lexrc.getInteger();
899 // Spellchecker settings:
900 case RC_USE_SPELL_LIB:
902 use_spell_lib = lexrc.getBool();
905 case RC_SPELL_COMMAND:
907 isp_command = lexrc.getString();
910 case RC_ACCEPT_COMPOUND:
912 isp_accept_compound = lexrc.getBool();
917 isp_use_input_encoding = lexrc.getBool();
920 case RC_USE_ALT_LANG:
922 isp_use_alt_lang = lexrc.getBool();
925 case RC_USE_PERS_DICT:
927 isp_use_pers_dict = lexrc.getBool();
930 case RC_USE_ESC_CHARS:
932 isp_use_esc_chars = lexrc.getBool();
937 isp_alt_lang = lexrc.getString();
942 isp_pers_dict = os::internal_path(lexrc.getString());
947 isp_esc_chars = lexrc.getString();
952 make_backup = lexrc.getBool();
955 case RC_BACKUPDIR_PATH:
957 backupdir_path = os::internal_path(lexrc.getString());
958 backupdir_path = expandPath(backupdir_path);
961 case RC_DATE_INSERT_FORMAT:
963 date_insert_format = lexrc.getString();
966 case RC_LANGUAGE_PACKAGE:
968 language_package = lexrc.getString();
971 case RC_LANGUAGE_AUTO_BEGIN:
973 language_auto_begin = lexrc.getBool();
976 case RC_LANGUAGE_AUTO_END:
978 language_auto_end = lexrc.getBool();
981 case RC_LANGUAGE_GLOBAL_OPTIONS:
983 language_global_options = lexrc.getBool();
986 case RC_LANGUAGE_USE_BABEL:
988 language_use_babel = lexrc.getBool();
991 case RC_LANGUAGE_COMMAND_BEGIN:
993 language_command_begin = lexrc.getString();
996 case RC_LANGUAGE_COMMAND_END:
998 language_command_end = lexrc.getString();
1001 case RC_LANGUAGE_COMMAND_LOCAL:
1003 language_command_local = lexrc.getString();
1006 case RC_RTL_SUPPORT:
1008 rtl_support = lexrc.getBool();
1011 case RC_AUTO_NUMBER:
1013 auto_number = lexrc.getBool();
1016 case RC_MARK_FOREIGN_LANGUAGE:
1018 mark_foreign_language = lexrc.getBool();
1023 string fmt, command;
1025 fmt = lexrc.getString();
1028 command = lexrc.getString();
1030 movers.set(fmt, command);
1034 case RC_CONVERTER: {
1035 string from, to, command, flags;
1037 from = lexrc.getString();
1040 to = lexrc.getString();
1043 command = lexrc.getString();
1046 flags = lexrc.getString();
1048 if (command.empty()) {
1049 converters.erase(from, to);
1051 converters.add(from, to, command, flags);
1055 // compatibility with versions older than 1.4.0 only
1057 string format, command;
1059 format = lexrc.getString();
1062 command = lexrc.getString();
1064 formats.setViewer(format, command);
1068 string format, extension, prettyname, shortcut;
1070 format = lexrc.getString();
1073 extension = lexrc.getString();
1076 prettyname = lexrc.getString();
1079 shortcut = lexrc.getString();
1081 string viewer, editor;
1083 viewer = lexrc.getString();
1085 editor = lexrc.getString();
1086 // The only supported flag for now is "document".
1087 // More flags could be added in the future.
1088 // Therefore we use tokenPos below to read the flag.
1090 // Hack to ensure compatibility with versions older
1092 int le = lexrc.lex();
1093 if (le != LyXLex::LEX_FEOF && le != LyXLex::LEX_UNDEF) {
1094 flags = lexrc.getString();
1095 if (le != LyXLex::LEX_DATA) {
1096 // We have got a known token.
1097 // Therefore this is an old style
1098 // format definition without
1100 lexrc.pushToken(flags);
1104 bool const document =
1105 (tokenPos(flags, ',', "document") >= 0);
1106 if (!flags.empty() && flags != "document")
1107 lyxerr << "Ignoring flags other than "
1108 "`document' in `" << flags
1109 << "' for format `" << format << "'."
1111 if (prettyname.empty()) {
1112 if (converters.formatIsUsed(format)) {
1113 lyxerr << "Can't delete format "
1116 formats.erase(format);
1119 formats.add(format, extension, prettyname,
1120 shortcut, viewer, editor, document);
1124 case RC_DEFAULT_LANGUAGE:
1126 default_language = lexrc.getString();
1130 case RC_LABEL_INIT_LENGTH:
1132 label_init_length = lexrc.getInteger();
1136 case RC_SHOW_BANNER:
1138 show_banner = lexrc.getBool();
1144 string const tmp = lexrc.getString();
1145 if (tmp == "true" || tmp == "on")
1146 preview = PREVIEW_ON;
1147 else if (tmp == "no_math")
1148 preview = PREVIEW_NO_MATH;
1150 preview = PREVIEW_OFF;
1151 if (tmp != "false" && tmp != "off")
1152 lyxerr << "Unrecognized "
1154 << tmp << '\n' << endl;
1159 case RC_PREVIEW_HASHED_LABELS:
1161 preview_hashed_labels = lexrc.getBool();
1165 case RC_PREVIEW_SCALE_FACTOR:
1167 preview_scale_factor = lexrc.getString();
1173 user_name = lexrc.getString();
1178 user_email = lexrc.getString();
1181 case RC_PATH_PREFIX:
1183 path_prefix = lexrc.getString();
1186 case RC_LAST: break; // this is just a dummy
1190 /// Update converters data-structures
1191 converters.update(formats);
1192 converters.buildGraph();
1198 void LyXRC::write(string const & filename, bool ignore_system_lyxrc) const
1200 ofstream ofs(filename.c_str());
1202 write(ofs, ignore_system_lyxrc);
1206 void LyXRC::print() const
1208 if (lyxerr.debugging())
1209 write(lyxerr, false);
1217 typedef std::pair<std::string, SpecialisedMover> Data;
1219 SameMover(Data const & comparison)
1220 : comparison_(comparison) {}
1222 bool operator()(Data const & data) const
1224 return data.first == comparison_.first &&
1225 data.second.command() == comparison_.second.command();
1233 void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
1235 os << "### This file is part of\n"
1236 << "### ========================================================\n"
1237 << "### LyX, The Document Processor\n"
1239 << "### Copyright 1995 Matthias Ettrich\n"
1240 << "### Copyright 1995-2001 The LyX Team.\n"
1242 << "### ========================================================\n"
1244 << "# This file is written by LyX, if you want to make your own\n"
1245 << "# modifications you should do them from inside LyX and save\n"
1248 // Why the switch you might ask. It is a trick to ensure that all
1249 // the elements in the LyXRCTags enum is handled. As you can see
1250 // there are no breaks at all. So it is just a huge fall-through.
1251 // The nice thing is that we will get a warning from the compiler
1252 // if we forget an element.
1253 LyXRCTags tag = RC_LAST;
1257 // input/include files are not done here
1259 if (ignore_system_lyxrc ||
1260 bind_file != system_lyxrc.bind_file) {
1261 string const path = os::external_path(bind_file);
1262 os << "\\bind_file \"" << path << "\"\n";
1268 << "# MISC SECTION ######################################\n"
1271 // bind files are not done here.
1273 case RC_PATH_PREFIX:
1274 if (ignore_system_lyxrc ||
1275 path_prefix != system_lyxrc.path_prefix) {
1276 os << "\\path_prefix \"" << path_prefix << "\"\n";
1280 if (ignore_system_lyxrc ||
1281 ui_file != system_lyxrc.ui_file) {
1282 string const path = os::external_path(ui_file);
1283 os << "\\ui_file \"" << path << "\"\n";
1285 case RC_AUTOREGIONDELETE:
1286 if (ignore_system_lyxrc ||
1287 auto_region_delete != system_lyxrc.auto_region_delete) {
1288 os << "# Set to false to inhibit automatic replacement of\n"
1289 << "# the current selection.\n"
1290 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1293 case RC_AUTORESET_OPTIONS:
1294 if (ignore_system_lyxrc ||
1295 auto_reset_options != system_lyxrc.auto_reset_options) {
1296 os << "# Set to false to inhibit automatic reset of\n"
1297 << "# the class options to defaults on class change.\n"
1298 << "\\auto_reset_options "
1299 << convert<string>(auto_reset_options)
1303 if (ignore_system_lyxrc ||
1304 autosave != system_lyxrc.autosave) {
1305 os << "# The time interval between auto-saves in seconds.\n"
1306 << "\\autosave " << autosave << '\n';
1308 case RC_DISPLAY_GRAPHICS:
1309 if (ignore_system_lyxrc ||
1310 display_graphics != system_lyxrc.display_graphics) {
1311 os << "# Display graphics within LyX\n"
1312 << "# monochrome|grayscale|color|none\n"
1313 << "\\display_graphics "
1314 << lyx::graphics::displayTranslator().find(display_graphics)
1318 case RC_VIEWDVI_PAPEROPTION:
1319 if (ignore_system_lyxrc ||
1320 view_dvi_paper_option
1321 != system_lyxrc.view_dvi_paper_option) {
1322 os << "# Options used to specify paper size to the\n"
1323 << "# view_dvi_command (e.g. -paper)\n"
1324 << "\\view_dvi_paper_option \""
1325 << view_dvi_paper_option << "\"\n";
1327 case RC_DEFAULT_PAPERSIZE:
1328 if (ignore_system_lyxrc ||
1329 default_papersize != system_lyxrc.default_papersize) {
1330 os << "# The default papersize to use.\n"
1331 << "\\default_papersize \"";
1332 switch (default_papersize) {
1334 os << "default"; break;
1335 case PAPER_USLETTER:
1336 os << "usletter"; break;
1338 os << "legal"; break;
1339 case PAPER_USEXECUTIVE:
1340 os << "executive"; break;
1351 case PAPER_B4: break;
1355 case RC_CHKTEX_COMMAND:
1356 if (ignore_system_lyxrc ||
1357 chktex_command != system_lyxrc.chktex_command) {
1358 os << "\\chktex_command \"" << chktex_command << "\"\n";
1360 case RC_BIBTEX_COMMAND:
1361 if (ignore_system_lyxrc ||
1362 bibtex_command != system_lyxrc.bibtex_command) {
1363 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1365 case RC_INDEX_COMMAND:
1366 if (ignore_system_lyxrc ||
1367 index_command != system_lyxrc.index_command) {
1368 os << "\\index_command \"" << index_command << "\"\n";
1370 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1371 if (ignore_system_lyxrc ||
1372 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1373 os << "\\tex_expects_windows_paths "
1374 << convert<string>(windows_style_tex_paths) << '\n';
1376 case RC_TEX_ALLOWS_SPACES:
1377 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1378 os << "\\tex_allows_spaces "
1379 << convert<string>(tex_allows_spaces) << '\n';
1382 if (ignore_system_lyxrc ||
1383 use_kbmap != system_lyxrc.use_kbmap) {
1384 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1386 case RC_KBMAP_PRIMARY:
1387 if (ignore_system_lyxrc ||
1388 primary_kbmap != system_lyxrc.primary_kbmap) {
1389 string const path = os::external_path(primary_kbmap);
1390 os << "\\kbmap_primary \"" << path << "\"\n";
1392 case RC_KBMAP_SECONDARY:
1393 if (ignore_system_lyxrc ||
1394 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1395 string const path = os::external_path(secondary_kbmap);
1396 os << "\\kbmap_secondary \"" << path << "\"\n";
1399 if (ignore_system_lyxrc ||
1400 lyxpipes != system_lyxrc.lyxpipes) {
1401 string const path = os::external_path(lyxpipes);
1402 os << "\\serverpipe \"" << path << "\"\n";
1404 case RC_DATE_INSERT_FORMAT:
1405 if (ignore_system_lyxrc ||
1406 date_insert_format != system_lyxrc.date_insert_format) {
1407 os << "\\date_insert_format \"" << date_insert_format
1410 case RC_LABEL_INIT_LENGTH:
1411 if (ignore_system_lyxrc ||
1412 label_init_length != system_lyxrc.label_init_length) {
1413 os << "\\label_init_length " << label_init_length
1418 os << "\\user_name \"" << user_name << "\"\n";
1421 os << "\\user_email \"" << user_email << "\"\n";
1423 case RC_SHOW_BANNER:
1424 if (ignore_system_lyxrc ||
1425 show_banner != system_lyxrc.show_banner) {
1426 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1430 if (ignore_system_lyxrc ||
1431 preview != system_lyxrc.preview) {
1437 case PREVIEW_NO_MATH:
1444 os << "\\preview " << status << '\n';
1447 case RC_PREVIEW_HASHED_LABELS:
1448 if (ignore_system_lyxrc ||
1449 preview_hashed_labels !=
1450 system_lyxrc.preview_hashed_labels) {
1451 os << "\\preview_hashed_labels "
1452 << convert<string>(preview_hashed_labels) << '\n';
1455 case RC_PREVIEW_SCALE_FACTOR:
1456 if (ignore_system_lyxrc ||
1457 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1458 os << "\\preview_scale_factor "
1459 << preview_scale_factor << '\n';
1463 << "# SCREEN & FONTS SECTION ############################\n"
1466 case RC_POPUP_NORMAL_FONT:
1467 if (ignore_system_lyxrc ||
1468 popup_normal_font != system_lyxrc.popup_normal_font) {
1469 os << "\\popup_normal_font \"" << popup_normal_font
1472 case RC_POPUP_BOLD_FONT:
1473 if (ignore_system_lyxrc ||
1474 popup_bold_font != system_lyxrc.popup_bold_font) {
1475 os << "\\popup_bold_font \"" << popup_bold_font
1478 case RC_POPUP_FONT_ENCODING:
1479 if (ignore_system_lyxrc ||
1480 popup_font_encoding != system_lyxrc.popup_font_encoding) {
1481 os << "\\popup_font_encoding \"" << popup_font_encoding
1485 if (ignore_system_lyxrc ||
1486 dpi != system_lyxrc.dpi) {
1487 os << "\\screen_dpi " << dpi << '\n';
1489 case RC_SCREEN_ZOOM:
1490 if (ignore_system_lyxrc ||
1491 zoom != system_lyxrc.zoom) {
1492 os << "\\screen_zoom " << zoom << '\n';
1494 case RC_SCREEN_GEOMETRY_HEIGHT:
1495 if (ignore_system_lyxrc ||
1496 geometry_height != system_lyxrc.geometry_height) {
1497 os << "\\screen_geometry_height " << geometry_height
1500 case RC_SCREEN_GEOMETRY_WIDTH:
1501 if (ignore_system_lyxrc ||
1502 geometry_width != system_lyxrc.geometry_width) {
1503 os << "\\screen_geometry_width " << geometry_width
1506 case RC_SCREEN_GEOMETRY_XYSAVED:
1507 if (ignore_system_lyxrc ||
1508 geometry_xysaved != system_lyxrc.geometry_xysaved) {
1509 os << "\\screen_geometry_xysaved " << convert<string>(geometry_xysaved)
1512 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1513 if (ignore_system_lyxrc ||
1514 cursor_follows_scrollbar
1515 != system_lyxrc.cursor_follows_scrollbar) {
1516 os << "\\cursor_follows_scrollbar "
1517 << convert<string>(cursor_follows_scrollbar) << '\n';
1519 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1520 if (ignore_system_lyxrc ||
1521 dialogs_iconify_with_main
1522 != system_lyxrc.dialogs_iconify_with_main) {
1523 os << "\\dialogs_iconify_with_main "
1524 << convert<string>(dialogs_iconify_with_main) << '\n';
1526 case RC_SCREEN_FONT_ROMAN:
1527 if (ignore_system_lyxrc ||
1528 roman_font_name != system_lyxrc.roman_font_name) {
1529 os << "\\screen_font_roman \"" << roman_font_name
1532 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1533 if (ignore_system_lyxrc ||
1534 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1535 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1538 case RC_SCREEN_FONT_SANS:
1539 if (ignore_system_lyxrc ||
1540 sans_font_name != system_lyxrc.sans_font_name) {
1541 os << "\\screen_font_sans \"" << sans_font_name
1544 case RC_SCREEN_FONT_SANS_FOUNDRY:
1545 if (ignore_system_lyxrc ||
1546 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1547 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1550 case RC_SCREEN_FONT_TYPEWRITER:
1551 if (ignore_system_lyxrc ||
1552 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1553 os << "\\screen_font_typewriter \""
1554 << typewriter_font_name << "\"\n";
1556 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1557 if (ignore_system_lyxrc ||
1558 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1559 os << "\\screen_font_typewriter_foundry \""
1560 << typewriter_font_foundry << "\"\n";
1563 case RC_SCREEN_FONT_SCALABLE:
1564 if (ignore_system_lyxrc ||
1565 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1566 os << "\\screen_font_scalable "
1567 << convert<string>(use_scalable_fonts)
1570 case RC_SCREEN_FONT_ENCODING:
1571 if (ignore_system_lyxrc ||
1572 font_norm != system_lyxrc.font_norm) {
1573 os << "\\screen_font_encoding \"" << font_norm
1576 case RC_SCREEN_FONT_SIZES:
1577 if (ignore_system_lyxrc ||
1578 font_sizes[LyXFont::SIZE_TINY]
1579 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1580 font_sizes[LyXFont::SIZE_SCRIPT]
1581 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1582 font_sizes[LyXFont::SIZE_FOOTNOTE]
1583 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1584 font_sizes[LyXFont::SIZE_SMALL]
1585 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1586 font_sizes[LyXFont::SIZE_NORMAL]
1587 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1588 font_sizes[LyXFont::SIZE_LARGE]
1589 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1590 font_sizes[LyXFont::SIZE_LARGER]
1591 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1592 font_sizes[LyXFont::SIZE_LARGEST]
1593 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1594 font_sizes[LyXFont::SIZE_HUGE]
1595 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1596 font_sizes[LyXFont::SIZE_HUGER]
1597 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1598 os.setf(ios::fixed);
1600 os << "\\screen_font_sizes"
1601 << ' ' << font_sizes[LyXFont::SIZE_TINY]
1602 << ' ' << font_sizes[LyXFont::SIZE_SCRIPT]
1603 << ' ' << font_sizes[LyXFont::SIZE_FOOTNOTE]
1604 << ' ' << font_sizes[LyXFont::SIZE_SMALL]
1605 << ' ' << font_sizes[LyXFont::SIZE_NORMAL]
1606 << ' ' << font_sizes[LyXFont::SIZE_LARGE]
1607 << ' ' << font_sizes[LyXFont::SIZE_LARGER]
1608 << ' ' << font_sizes[LyXFont::SIZE_LARGEST]
1609 << ' ' << font_sizes[LyXFont::SIZE_HUGE]
1610 << ' ' << font_sizes[LyXFont::SIZE_HUGER]
1615 << "# COLOR SECTION ###################################\n"
1619 for (int i = 0; i < LColor::ignore; ++i) {
1620 LColor::color lc = static_cast<LColor::color>(i);
1622 string const col(lcolor.getX11Name(lc));
1623 if (ignore_system_lyxrc ||
1624 col != system_lcolor.getX11Name(lc)) {
1625 os << "\\set_color \""
1626 << lcolor.getLyXName(lc) << "\" \""
1632 << "# PRINTER SECTION ###################################\n"
1636 if (ignore_system_lyxrc ||
1637 printer != system_lyxrc.printer) {
1638 os << "\\printer \"" << printer << "\"\n";
1640 case RC_PRINT_ADAPTOUTPUT:
1641 if (ignore_system_lyxrc ||
1642 print_adapt_output != system_lyxrc.print_adapt_output) {
1643 os << "\\print_adapt_output "
1644 << convert<string>(print_adapt_output)
1647 case RC_PRINT_COMMAND:
1648 if (ignore_system_lyxrc ||
1649 print_command != system_lyxrc.print_command) {
1650 os << "\\print_command \"" << print_command << "\"\n";
1652 case RC_PRINTEXSTRAOPTIONS:
1653 if (ignore_system_lyxrc ||
1654 print_extra_options != system_lyxrc.print_extra_options) {
1655 os << "\\print_extra_options \"" << print_extra_options
1658 case RC_PRINTSPOOL_COMMAND:
1659 if (ignore_system_lyxrc ||
1660 print_spool_command != system_lyxrc.print_spool_command) {
1661 os << "\\print_spool_command \"" << print_spool_command
1664 case RC_PRINTSPOOL_PRINTERPREFIX:
1665 if (ignore_system_lyxrc ||
1666 print_spool_printerprefix
1667 != system_lyxrc.print_spool_printerprefix) {
1668 os << "\\print_spool_printerprefix \""
1669 << print_spool_printerprefix << "\"\n";
1671 case RC_PRINTEVENPAGEFLAG:
1672 if (ignore_system_lyxrc ||
1673 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1674 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1677 case RC_PRINTODDPAGEFLAG:
1678 if (ignore_system_lyxrc ||
1679 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1680 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1683 case RC_PRINTREVERSEFLAG:
1684 if (ignore_system_lyxrc ||
1685 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1686 os << "\\print_reverse_flag \"" << print_reverse_flag
1689 case RC_PRINTLANDSCAPEFLAG:
1690 if (ignore_system_lyxrc ||
1691 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1692 os << "\\print_landscape_flag \"" << print_landscape_flag
1695 case RC_PRINTPAGERANGEFLAG:
1696 if (ignore_system_lyxrc ||
1697 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1698 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1701 case RC_PRINTCOPIESFLAG:
1702 if (ignore_system_lyxrc ||
1703 print_copies_flag != system_lyxrc.print_copies_flag) {
1704 os << "\\print_copies_flag \"" << print_copies_flag
1707 case RC_PRINTCOLLCOPIESFLAG:
1708 if (ignore_system_lyxrc ||
1709 print_collcopies_flag
1710 != system_lyxrc.print_collcopies_flag) {
1711 os << "\\print_collcopies_flag \""
1712 << print_collcopies_flag
1715 case RC_PRINTPAPERFLAG:
1716 if (ignore_system_lyxrc ||
1717 print_paper_flag != system_lyxrc.print_paper_flag) {
1718 os << "\\print_paper_flag \"" << print_paper_flag
1721 case RC_PRINTPAPERDIMENSIONFLAG:
1722 if (ignore_system_lyxrc ||
1723 print_paper_dimension_flag
1724 != system_lyxrc.print_paper_dimension_flag) {
1725 os << "\\print_paper_dimension_flag \""
1726 << print_paper_dimension_flag << "\"\n";
1728 case RC_PRINTTOPRINTER:
1729 if (ignore_system_lyxrc ||
1730 print_to_printer != system_lyxrc.print_to_printer) {
1731 os << "\\print_to_printer \"" << print_to_printer
1734 case RC_PRINTTOFILE:
1735 if (ignore_system_lyxrc ||
1736 print_to_file != system_lyxrc.print_to_file) {
1737 string const path = os::external_path(print_to_file);
1738 os << "\\print_to_file \"" << path << "\"\n";
1740 case RC_PRINTFILEEXTENSION:
1741 if (ignore_system_lyxrc ||
1742 print_file_extension != system_lyxrc.print_file_extension) {
1743 os << "\\print_file_extension \""
1744 << print_file_extension
1749 << "# EXPORT SECTION ####################################\n"
1752 case RC_CUSTOM_EXPORT_COMMAND:
1753 if (ignore_system_lyxrc ||
1754 custom_export_command
1755 != system_lyxrc.custom_export_command) {
1756 os << "\\custom_export_command \""
1757 << custom_export_command
1760 case RC_CUSTOM_EXPORT_FORMAT:
1761 if (ignore_system_lyxrc ||
1762 custom_export_format
1763 != system_lyxrc.custom_export_format) {
1764 os << "\\custom_export_format \"" << custom_export_format
1769 << "# TEX SECTION #######################################\n"
1772 case RC_FONT_ENCODING:
1773 if (ignore_system_lyxrc ||
1774 fontenc != system_lyxrc.fontenc) {
1775 os << "\\font_encoding \"" << fontenc << "\"\n";
1779 << "# FILE SECTION ######################################\n"
1782 case RC_DOCUMENTPATH:
1783 if (ignore_system_lyxrc ||
1784 document_path != system_lyxrc.document_path) {
1785 string const path = os::external_path(document_path);
1786 os << "\\document_path \"" << path << "\"\n";
1788 case RC_USELASTFILEPOS:
1789 if (ignore_system_lyxrc ||
1790 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1791 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1794 case RC_LOADSESSION:
1795 if (ignore_system_lyxrc ||
1796 load_session != system_lyxrc.load_session) {
1797 os << "\\load_session " << convert<string>(load_session)
1800 case RC_NUMLASTFILES:
1801 if (ignore_system_lyxrc ||
1802 num_lastfiles != system_lyxrc.num_lastfiles) {
1803 os << "\\num_lastfiles " << num_lastfiles << '\n';
1805 case RC_CHECKLASTFILES:
1806 if (ignore_system_lyxrc ||
1807 check_lastfiles != system_lyxrc.check_lastfiles) {
1808 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
1811 case RC_TEMPLATEPATH:
1812 if (ignore_system_lyxrc ||
1813 template_path != system_lyxrc.template_path) {
1814 string const path = os::external_path(template_path);
1815 os << "\\template_path \"" << path << "\"\n";
1817 case RC_TEMPDIRPATH:
1818 if (ignore_system_lyxrc ||
1819 tempdir_path != system_lyxrc.tempdir_path) {
1820 string const path = os::external_path(tempdir_path);
1821 os << "\\tempdir_path \"" << path << "\"\n";
1825 case RC_ASCII_LINELEN:
1826 if (ignore_system_lyxrc ||
1827 ascii_linelen != system_lyxrc.ascii_linelen) {
1828 os << "\\ascii_linelen " << ascii_linelen << '\n';
1830 case RC_MAKE_BACKUP:
1831 if (ignore_system_lyxrc ||
1832 make_backup != system_lyxrc.make_backup) {
1833 os << "\\make_backup " << convert<string>(make_backup) << '\n';
1835 case RC_BACKUPDIR_PATH:
1836 if (ignore_system_lyxrc ||
1837 backupdir_path != system_lyxrc.backupdir_path) {
1838 string const path = os::external_path(backupdir_path);
1839 os << "\\backupdir_path \"" << path << "\"\n";
1843 << "# ASCII EXPORT SECTION ##############################\n"
1846 case RC_ASCIIROFF_COMMAND:
1847 if (ignore_system_lyxrc ||
1848 ascii_roff_command != system_lyxrc.ascii_roff_command) {
1849 os << "\\ascii_roff_command \"" << ascii_roff_command
1854 << "# SPELLCHECKER SECTION ##############################\n"
1856 case RC_USE_SPELL_LIB:
1857 if (ignore_system_lyxrc ||
1858 use_spell_lib != system_lyxrc.use_spell_lib) {
1859 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
1861 case RC_SPELL_COMMAND:
1862 if (ignore_system_lyxrc ||
1863 isp_command != system_lyxrc.isp_command) {
1864 os << "\\spell_command \"" << isp_command << "\"\n";
1866 case RC_ACCEPT_COMPOUND:
1867 if (ignore_system_lyxrc ||
1868 isp_accept_compound != system_lyxrc.isp_accept_compound) {
1869 os << "\\accept_compound " << convert<string>(isp_accept_compound)
1872 case RC_USE_ALT_LANG:
1873 if (ignore_system_lyxrc ||
1874 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1875 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
1879 if (ignore_system_lyxrc ||
1880 isp_alt_lang != system_lyxrc.isp_alt_lang) {
1881 os << "\\alternate_language \"" << isp_alt_lang
1884 case RC_USE_ESC_CHARS:
1885 if (ignore_system_lyxrc ||
1886 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1887 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
1891 if (ignore_system_lyxrc ||
1892 isp_esc_chars != system_lyxrc.isp_esc_chars) {
1893 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1895 case RC_USE_PERS_DICT:
1896 if (ignore_system_lyxrc ||
1897 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1898 os << "\\use_personal_dictionary "
1899 << convert<string>(isp_use_pers_dict)
1903 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1904 string const path = os::external_path(isp_pers_dict);
1905 os << "\\personal_dictionary \"" << path << "\"\n";
1907 case RC_USE_INP_ENC:
1908 if (ignore_system_lyxrc ||
1909 isp_use_input_encoding
1910 != system_lyxrc.isp_use_input_encoding) {
1911 os << "\\use_input_encoding "
1912 << convert<string>(isp_use_input_encoding)
1917 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1920 case RC_RTL_SUPPORT:
1921 if (ignore_system_lyxrc ||
1922 rtl_support != system_lyxrc.rtl_support) {
1923 os << "\\rtl " << convert<string>(rtl_support) << '\n';
1925 case RC_LANGUAGE_PACKAGE:
1926 if (ignore_system_lyxrc ||
1927 language_package != system_lyxrc.language_package) {
1928 os << "\\language_package \"" << language_package
1931 case RC_LANGUAGE_GLOBAL_OPTIONS:
1932 if (ignore_system_lyxrc ||
1933 language_global_options
1934 != system_lyxrc.language_global_options) {
1935 os << "\\language_global_options \""
1936 << convert<string>(language_global_options)
1939 case RC_LANGUAGE_USE_BABEL:
1940 if (ignore_system_lyxrc ||
1941 language_use_babel != system_lyxrc.language_use_babel) {
1942 os << "\\language_use_babel \""
1943 << convert<string>(language_use_babel)
1946 case RC_LANGUAGE_COMMAND_BEGIN:
1947 if (ignore_system_lyxrc ||
1948 language_command_begin
1949 != system_lyxrc.language_command_begin) {
1950 os << "\\language_command_begin \""
1951 << language_command_begin
1954 case RC_LANGUAGE_COMMAND_END:
1955 if (ignore_system_lyxrc ||
1956 language_command_end
1957 != system_lyxrc.language_command_end) {
1958 os << "\\language_command_end \"" << language_command_end
1961 case RC_LANGUAGE_COMMAND_LOCAL:
1962 if (ignore_system_lyxrc ||
1963 language_command_local
1964 != system_lyxrc.language_command_local) {
1965 os << "\\language_command_local \""
1966 << language_command_local
1969 case RC_LANGUAGE_AUTO_BEGIN:
1970 if (ignore_system_lyxrc ||
1971 language_auto_begin != system_lyxrc.language_auto_begin) {
1972 os << "\\language_auto_begin "
1973 << convert<string>(language_auto_begin) << '\n';
1975 case RC_LANGUAGE_AUTO_END:
1976 if (ignore_system_lyxrc ||
1977 language_auto_end != system_lyxrc.language_auto_end) {
1978 os << "\\language_auto_end "
1979 << convert<string>(language_auto_end) << '\n';
1981 case RC_MARK_FOREIGN_LANGUAGE:
1982 if (ignore_system_lyxrc ||
1983 mark_foreign_language
1984 != system_lyxrc.mark_foreign_language) {
1985 os << "\\mark_foreign_language " <<
1986 convert<string>(mark_foreign_language) << '\n';
1990 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1993 case RC_AUTO_NUMBER:
1994 if (ignore_system_lyxrc ||
1995 auto_number != system_lyxrc.auto_number) {
1996 os << "\\auto_number " << convert<string>(auto_number) << '\n';
1998 case RC_DEFAULT_LANGUAGE:
1999 if (ignore_system_lyxrc ||
2000 default_language != system_lyxrc.default_language) {
2001 os << "\\default_language " << default_language << '\n';
2005 << "# FORMATS SECTION ##########################\n"
2009 // New/modified formats
2010 for (Formats::const_iterator cit = formats.begin();
2011 cit != formats.end(); ++cit) {
2012 Format const * format =
2013 system_formats.getFormat(cit->name());
2015 format->extension() != cit->extension() ||
2016 format->prettyname() != cit->prettyname() ||
2017 format->shortcut() != cit->shortcut() ||
2018 format->viewer() != cit->viewer() ||
2019 format->editor() != cit->editor() ||
2020 format->documentFormat() != cit->documentFormat()) {
2021 os << "\\format \"" << cit->name() << "\" \""
2022 << cit->extension() << "\" \""
2023 << cit->prettyname() << "\" \""
2024 << cit->shortcut() << "\" \""
2025 << cit->viewer() << "\" \""
2026 << cit->editor() << "\" \"";
2027 if (cit->documentFormat())
2033 // Look for deleted formats
2034 for (Formats::const_iterator cit = system_formats.begin();
2035 cit != system_formats.end(); ++cit)
2036 if (!formats.getFormat(cit->name()))
2037 os << "\\format \"" << cit->name()
2038 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2043 << "# CONVERTERS SECTION ##########################\n"
2047 // Look for new converters
2048 for (Converters::const_iterator cit = converters.begin();
2049 cit != converters.end(); ++cit) {
2050 Converter const * converter =
2051 system_converters.getConverter(cit->from,
2054 converter->command != cit->command ||
2055 converter->flags != cit->flags)
2056 os << "\\converter \"" << cit->from << "\" \""
2057 << cit->to << "\" \""
2058 << cit->command << "\" \""
2059 << cit->flags << "\"\n";
2062 // New/modifed converters
2063 for (Converters::const_iterator cit = system_converters.begin();
2064 cit != system_converters.end(); ++cit)
2065 if (!converters.getConverter(cit->from, cit->to))
2066 os << "\\converter \"" << cit->from
2067 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2071 << "# COPIERS SECTION ##########################\n"
2074 // Look for new movers
2075 Movers::iterator const sysbegin = system_movers.begin();
2076 Movers::iterator const sysend = system_movers.end();
2078 for (Movers::iterator it = movers.begin(), end = movers.end();
2080 Movers::iterator const sysit =
2081 std::find_if(sysbegin, sysend, SameMover(*it));
2082 if (sysit == sysend) {
2083 std::string const & fmt = it->first;
2084 std::string const & command =
2085 it->second.command();
2087 os << "\\copier " << fmt
2088 << " \"" << command << "\"\n";
2092 // We don't actually delete SpecialisedMover(s) from the
2093 // map, just clear their 'command', so there's no need
2094 // to test for anything else.
2100 void LyXRC::set_font_norm_type()
2102 if (font_norm == "iso10646-1")
2103 font_norm_type = ISO_10646_1;
2104 else if (font_norm == "iso8859-1")
2105 font_norm_type = ISO_8859_1;
2106 else if (font_norm == "iso8859-3")
2107 font_norm_type = ISO_8859_3;
2108 else if (font_norm == "iso8859-4")
2109 font_norm_type = ISO_8859_4;
2110 else if (font_norm == "iso8859-6.8x")
2111 font_norm_type = ISO_8859_6_8;
2112 else if (font_norm == "iso8859-9")
2113 font_norm_type = ISO_8859_9;
2114 else if (font_norm == "iso8859-15")
2115 font_norm_type = ISO_8859_15;
2117 font_norm_type = OTHER_ENCODING;
2121 string const LyXRC::getDescription(LyXRCTags tag)
2126 case RC_ACCEPT_COMPOUND:
2127 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2131 case RC_USE_ALT_LANG:
2132 str = _("Specify an alternate language. The default is to use the language of the document.");
2135 case RC_ASCIIROFF_COMMAND:
2136 str = _("Use to define an external program to render tables in plain text output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"\" is specified, an internal routine is used.");
2139 case RC_ASCII_LINELEN:
2140 str = _("This is the maximum line length of an exported text file (LaTeX, SGML or plain text).");
2143 case RC_AUTOREGIONDELETE:
2144 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2147 case RC_AUTORESET_OPTIONS:
2148 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2152 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2155 case RC_AUTO_NUMBER:
2158 case RC_BACKUPDIR_PATH:
2159 str = _("The path for storing backup files. If it is an empty string, LyX will store the backup file in the same directory as the original file.");
2162 case RC_BIBTEX_COMMAND:
2163 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2167 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2170 case RC_CHECKLASTFILES:
2171 str = _("Select to check whether the lastfiles still exist.");
2174 case RC_CHKTEX_COMMAND:
2175 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2184 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2185 str = _("LyX normally doesn't update the cursor position if you move the scrollbar. Set to true if you'd prefer to always have the cursor on screen.");
2188 case RC_CUSTOM_EXPORT_COMMAND:
2191 case RC_CUSTOM_EXPORT_FORMAT:
2194 case RC_DATE_INSERT_FORMAT:
2195 //xgettext:no-c-format
2196 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2199 case RC_DEFAULT_LANGUAGE:
2200 str = _("New documents will be assigned this language.");
2203 case RC_DEFAULT_PAPERSIZE:
2204 str = _("Specify the default paper size.");
2207 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2208 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2211 case RC_DISPLAY_GRAPHICS:
2212 str = _("Select how LyX will display any graphics.");
2215 case RC_DOCUMENTPATH:
2216 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2220 case RC_USE_ESC_CHARS:
2221 str = _("Specify additional chars that can be part of a word.");
2224 case RC_FONT_ENCODING:
2225 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2231 case RC_INDEX_COMMAND:
2232 str = _("Define the options of makeindex (cf. man makeindex) or select an alternative compiler. E.g., using xindy/make-rules, the command string would be \"makeindex.sh -m $$lang\".");
2239 case RC_KBMAP_PRIMARY:
2240 case RC_KBMAP_SECONDARY:
2241 str = _("Use this to set the correct mapping file for your keyboard. You'll need this if you for instance want to type German documents on an American keyboard.");
2244 case RC_LABEL_INIT_LENGTH:
2245 str = _("Maximum number of words in the initialization string for a new label");
2248 case RC_LANGUAGE_AUTO_BEGIN:
2249 str = _("Select if a language switching command is needed at the beginning of the document.");
2252 case RC_LANGUAGE_AUTO_END:
2253 str = _("Select if a language switching command is needed at the end of the document.");
2256 case RC_LANGUAGE_COMMAND_BEGIN:
2257 str = _("The LaTeX command for changing from the language of the document to another language. E.g. \\selectlanguage{$$lang} where $$lang is substituted by the name of the second language.");
2260 case RC_LANGUAGE_COMMAND_END:
2261 str = _("The LaTeX command for changing back to the language of the document.");
2264 case RC_LANGUAGE_COMMAND_LOCAL:
2265 str = _("The LaTeX command for local changing of the language.");
2268 case RC_LANGUAGE_GLOBAL_OPTIONS:
2269 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2272 case RC_LANGUAGE_PACKAGE:
2273 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2276 case RC_LANGUAGE_USE_BABEL:
2277 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2280 case RC_USELASTFILEPOS:
2281 str = _("De-select if you do not want LyX to scroll to saved position.");
2284 case RC_LOADSESSION:
2285 str = _("De-select to prevent loading files opened from the last lyx session.");
2288 case RC_MAKE_BACKUP:
2289 str = _("De-select if you don't want LyX to create backup files.");
2292 case RC_MARK_FOREIGN_LANGUAGE:
2293 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2296 case RC_NUMLASTFILES:
2297 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2301 case RC_PATH_PREFIX:
2302 str = _("Specify those directories which should be "
2303 "prepended to the PATH environment variable. "
2304 "Use the OS native format.");
2308 case RC_USE_PERS_DICT:
2309 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2312 case RC_POPUP_BOLD_FONT:
2313 str = _("The bold font in the dialogs.");
2316 case RC_POPUP_FONT_ENCODING:
2317 str = _("The encoding for the menu/popups fonts.");
2320 case RC_POPUP_NORMAL_FONT:
2321 str = _("The normal font in the dialogs.");
2325 str = _("Shows a typeset preview of things such as math");
2328 case RC_PREVIEW_HASHED_LABELS:
2329 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2332 case RC_PREVIEW_SCALE_FACTOR:
2333 str = _("Scale the preview size to suit.");
2336 case RC_PRINTCOLLCOPIESFLAG:
2337 str = _("The option for specifying whether the copies should be collated.");
2340 case RC_PRINTCOPIESFLAG:
2341 str = _("The option for specifying the number of copies to print.");
2345 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2348 case RC_PRINTEVENPAGEFLAG:
2349 str = _("The option to print only even pages.");
2352 case RC_PRINTEXSTRAOPTIONS:
2353 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2356 case RC_PRINTFILEEXTENSION:
2357 str = _("Extension of printer program output file. Usually \".ps\".");
2360 case RC_PRINTLANDSCAPEFLAG:
2361 str = _("The option to print out in landscape.");
2364 case RC_PRINTODDPAGEFLAG:
2365 str = _("The option to print only odd pages.");
2368 case RC_PRINTPAGERANGEFLAG:
2369 str = _("The option for specifying a comma-separated list of pages to print.");
2372 case RC_PRINTPAPERDIMENSIONFLAG:
2373 str = _("Option to specify the dimensions of the print paper.");
2376 case RC_PRINTPAPERFLAG:
2377 str = _("The option to specify paper type.");
2380 case RC_PRINTREVERSEFLAG:
2381 str = _("The option to reverse the order of the pages printed.");
2384 case RC_PRINTSPOOL_COMMAND:
2385 str = _("When set, this printer option automatically prints to a file and then calls a separate print spooling program on that file with the given name and arguments.");
2388 case RC_PRINTSPOOL_PRINTERPREFIX:
2389 str = _("If you specify a printer name in the print dialog, the following argument is prepended along with the printer name after the spool command.");
2392 case RC_PRINTTOFILE:
2393 str = _("Option to pass to the print program to print to a file.");
2396 case RC_PRINTTOPRINTER:
2397 str = _("Option to pass to the print program to print on a specific printer.");
2400 case RC_PRINT_ADAPTOUTPUT:
2401 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2404 case RC_PRINT_COMMAND:
2405 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2408 case RC_RTL_SUPPORT:
2409 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2413 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2416 case RC_SCREEN_FONT_ENCODING:
2417 str = _("The encoding for the screen fonts.");
2420 case RC_SCREEN_FONT_ROMAN:
2421 case RC_SCREEN_FONT_SANS:
2422 case RC_SCREEN_FONT_TYPEWRITER:
2423 str = _("The screen fonts used to display the text while editing.");
2426 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2427 case RC_SCREEN_FONT_SANS_FOUNDRY:
2428 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2431 case RC_SCREEN_FONT_SCALABLE:
2432 str = _("Allow bitmap fonts to be resized. If you are using a bitmap font, selecting this option may make some fonts look blocky in LyX. Deselecting this option makes LyX use the nearest bitmap font size available, instead of scaling.");
2435 case RC_SCREEN_FONT_SIZES:
2436 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2439 case RC_SCREEN_ZOOM:
2440 //xgettext:no-c-format
2441 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2444 case RC_SCREEN_GEOMETRY_HEIGHT:
2445 case RC_SCREEN_GEOMETRY_WIDTH:
2446 str = _("Specify geometry of the main view in width x height (values from last session will not be used if non-zero values are specified).");
2449 case RC_SCREEN_GEOMETRY_XYSAVED:
2450 str = _("Allow session manager to save and restore windows position.");
2454 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2460 case RC_SHOW_BANNER:
2461 str = _("De-select if you don't want the startup banner.");
2464 case RC_SPELL_COMMAND:
2465 str = _("What command runs the spellchecker?");
2468 case RC_TEMPDIRPATH:
2469 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2472 case RC_TEMPLATEPATH:
2473 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2476 case RC_TEX_ALLOWS_SPACES:
2479 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2483 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2495 case RC_USE_INP_ENC:
2496 str = _("Specify whether to pass the -T input encoding option to ispell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
2499 case RC_USE_SPELL_LIB:
2502 case RC_VIEWDVI_PAPEROPTION:
2503 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2513 return lyx::to_utf8(str);
2516 // The global instance
2519 // The global copy of the system lyxrc entries (everything except preferences)