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.
22 #include "Converter.h"
23 #include "FontEnums.h"
29 #include "SpellChecker.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/FileName.h"
38 #include "support/filetools.h"
39 #include "support/gettext.h"
40 #include "support/lstrings.h"
41 #include "support/os.h"
42 #include "support/Package.h"
43 #include "support/userinfo.h"
50 using namespace lyx::support;
54 namespace os = support::os;
58 static unsigned int const LYXRC_FILEFORMAT = 7; // gb: add mime types
60 // when adding something to this array keep it sorted!
61 LexerKeyword lyxrcTags[] = {
62 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
63 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
64 { "\\alternate_language", LyXRC::RC_ALT_LANG },
65 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
66 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
67 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
68 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
69 { "\\autosave", LyXRC::RC_AUTOSAVE },
70 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
71 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
72 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
73 { "\\bind_file", LyXRC::RC_BINDFILE },
74 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
75 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
76 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
77 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
78 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
79 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
80 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
81 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
82 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
83 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
84 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
85 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
86 { "\\converter", LyXRC::RC_CONVERTER },
87 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
88 { "\\copier", LyXRC::RC_COPIER },
89 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
90 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
91 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
92 { "\\def_file", LyXRC::RC_DEFFILE },
93 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
94 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
95 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
96 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
97 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
98 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
99 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
100 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
101 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
102 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
103 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
104 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
105 { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
106 { "\\format", LyXRC::RC_FILEFORMAT },
107 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
108 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
109 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
110 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
111 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
112 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
113 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
114 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
115 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
116 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
117 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
118 { "\\icon_set", LyXRC::RC_ICON_SET },
119 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
120 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
121 { "\\input", LyXRC::RC_INPUT },
122 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
123 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
124 { "\\kbmap", LyXRC::RC_KBMAP },
125 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
126 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
127 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
128 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
129 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
130 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
131 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
132 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
133 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
134 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
135 { "\\load_session", LyXRC::RC_LOADSESSION },
136 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
137 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
138 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
139 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
140 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
141 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
142 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
143 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
144 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
145 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
146 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
147 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
148 { "\\preview", LyXRC::RC_PREVIEW },
149 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
150 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
151 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
152 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
153 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
154 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
155 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
156 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
157 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
158 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
159 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
160 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
161 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
162 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
163 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
164 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
165 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
166 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
167 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
168 { "\\printer", LyXRC::RC_PRINTER },
169 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
170 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
171 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
172 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
173 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
174 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
175 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
176 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
177 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
178 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
179 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
180 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
181 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
182 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
183 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
184 { "\\set_color", LyXRC::RC_SET_COLOR },
185 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
186 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
187 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
188 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
189 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
190 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
191 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
192 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
193 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
194 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
195 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
196 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
197 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
198 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
199 { "\\ui_file", LyXRC::RC_UIFILE },
200 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
201 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
202 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
203 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
204 // compatibility with versions older than 1.4.0 only
205 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
206 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
207 { "\\user_email", LyXRC::RC_USER_EMAIL },
208 { "\\user_name", LyXRC::RC_USER_NAME },
209 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
210 // compatibility with versions older than 1.4.0 only
211 { "\\viewer", LyXRC::RC_VIEWER},
212 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
213 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
214 { "format", LyXRC::RC_LYXRCFORMAT }
217 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
228 void LyXRC::setDefaults()
232 def_file = "default";
234 // The current document directory
235 texinputs_prefix = ".";
236 // Get printer from the environment. If fail, use default "",
237 // assuming that everything is set up correctly.
238 printer = getEnv("PRINTER");
239 print_adapt_output = false;
240 print_command = "dvips";
241 print_evenpage_flag = "-B";
242 print_oddpage_flag = "-A";
243 print_pagerange_flag = "-pp";
244 print_copies_flag = "-c";
245 print_collcopies_flag = "-C";
246 print_reverse_flag = "-r";
247 print_landscape_flag = "-t landscape";
248 print_to_printer = "-P";
249 print_to_file = "-o ";
250 print_file_extension = ".ps";
251 print_paper_flag = "-t";
252 print_paper_dimension_flag = "-T";
253 document_path.erase();
254 view_dvi_paper_option.erase();
255 default_view_format = "pdf2";
256 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
257 bibtex_command = "bibtex";
259 index_command = "makeindex -c -q";
260 nomencl_command = "makeindex -s nomencl.ist";
262 // Because a screen is typically wider than a piece of paper:
264 allow_geometry_session = true;
265 // Default LaTeX font size:
266 font_sizes[FONT_SIZE_TINY] = "5.0";
267 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
268 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
269 font_sizes[FONT_SIZE_SMALL] = "9.0";
270 font_sizes[FONT_SIZE_NORMAL] = "10.0";
271 font_sizes[FONT_SIZE_LARGE] = "12.0";
272 font_sizes[FONT_SIZE_LARGER] = "14.4";
273 font_sizes[FONT_SIZE_LARGEST] = "17.26";
274 font_sizes[FONT_SIZE_HUGE] = "20.74";
275 font_sizes[FONT_SIZE_HUGER] = "24.88";
276 use_scalable_fonts = true;
277 roman_font_name = "";
279 typewriter_font_name = "";
281 auto_region_delete = true;
282 auto_reset_options = false;
283 plaintext_linelen = 65;
284 mouse_wheel_speed = 1.0;
285 num_lastfiles = maxlastfiles;
286 check_lastfiles = true;
287 use_lastfilepos = true;
288 load_session = false;
290 save_compressed = false;
291 backupdir_path.erase();
292 display_graphics = true;
293 // Spellchecker settings:
294 // FIXME: this check should test the target platform (darwin)
295 #if defined(USE_MACOSX_PACKAGING)
296 spellchecker = "native";
297 #elif defined(USE_ASPELL)
298 spellchecker = "aspell";
299 #elif defined(USE_HUNSPELL)
300 spellchecker = "hunspell";
302 spellchecker = "aspell";
304 spellchecker_accept_compound = false;
305 spellcheck_continuously = false;
306 completion_minlength = 6;
307 spellcheck_notes = true;
310 visual_cursor = false;
312 mark_foreign_language = true;
313 language_auto_begin = true;
314 language_auto_end = true;
315 language_global_options = true;
316 language_package_selection = LP_AUTO;
317 language_custom_package = "\\usepackage{babel}";
318 language_command_begin = "\\selectlanguage{$$lang}";
319 language_command_local = "\\foreignlanguage{$$lang}{";
320 sort_layouts = false;
321 group_layouts = true;
322 default_language = "english";
323 gui_language = "auto";
325 windows_style_tex_paths = false;
326 tex_allows_spaces = false;
327 date_insert_format = "%x";
328 cursor_follows_scrollbar = false;
329 scroll_below_document = false;
330 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
331 paragraph_markers = false;
332 mac_dontswap_ctrl_meta = false;
333 mac_like_word_movement = false;
334 macro_edit_style = MACRO_EDIT_INLINE_BOX;
335 dialogs_iconify_with_main = false;
336 preview = PREVIEW_OFF;
337 preview_hashed_labels = false;
338 preview_scale_factor = 1.0;
339 use_converter_cache = true;
340 use_system_colors = false;
342 use_pixmap_cache = false;
344 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
345 user_name = to_utf8(support::user_name());
346 user_email = to_utf8(support::user_email());
347 open_buffers_in_tabs = true;
348 single_close_tab_button = false;
349 single_instance = true;
350 forward_search_dvi = string();
351 forward_search_pdf = string();
352 export_overwrite = NO_FILES;
354 // Fullscreen settings
355 full_screen_limit = false;
356 full_screen_toolbars = true;
357 full_screen_tabbar = true;
358 full_screen_menubar = true;
359 full_screen_scrollbar = true;
360 full_screen_width = 700;
362 completion_cursor_text = true;
363 completion_popup_math = true;
364 completion_popup_text = false;
365 completion_popup_delay = 2.0;
366 completion_popup_after_complete = true;
367 autocorrection_math = false;
368 completion_inline_math = true;
369 completion_inline_text = false;
370 completion_inline_dots = -1;
371 completion_inline_delay = 0.2;
372 default_decimal_point = ".";
373 default_length_unit = Length::CM;
380 void oldFontFormat(string & family, string & foundry)
382 if (family.empty() || family[0] != '-')
384 foundry = token(family, '-', 1);
385 family = token(family, '-', 2);
393 bool LyXRC::read(FileName const & filename, bool check_format)
395 Lexer lexrc(lyxrcTags);
396 lexrc.setFile(filename);
397 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
398 ReturnValues retval = read(lexrc, check_format);
399 if (!check_format || retval != FormatMismatch)
400 return retval == ReadOK;
402 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
403 FileName const tempfile = FileName::tempName("convert_lyxrc");
404 bool const success = prefs2prefs(filename, tempfile, false);
406 LYXERR0 ("Unable to convert " << filename.absFileName() <<
407 " to format " << LYXRC_FILEFORMAT);
410 // Keep this in the else branch, such that lexrc2 goes out
411 // of scope and releases the lock on tempfile before we
412 // attempt to remove it. This matters on Windows.
413 Lexer lexrc2(lyxrcTags);
414 lexrc2.setFile(tempfile);
415 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
416 retval = read(lexrc2, check_format);
418 tempfile.removeFile();
419 return retval == ReadOK;
423 // don't need to worry about conversion, because this is always
424 // from an internal source
425 bool LyXRC::read(istream & is)
427 Lexer lexrc(lyxrcTags);
429 LYXERR(Debug::LYXRC, "Reading istream...");
430 return read(lexrc, false) == ReadOK;
434 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
436 if (lyxerr.debugging(Debug::PARSER))
437 lexrc.printTable(lyxerr);
442 // default for current rowpainter capabilities
443 force_paint_single_char = true;
445 // format prior to 2.0 and introduction of format tag
446 unsigned int format = 0;
448 while (lexrc.isOK()) {
449 // By using two switches we take advantage of the compiler
450 // telling us if we have missed a LyXRCTags element in
451 // the second switch.
452 // Note that this also shows a problem with Lexer since it
453 // helps us avoid taking advantage of the strictness of the
456 int le = lexrc.lex();
458 case Lexer::LEX_UNDEF:
459 lexrc.printError("Unknown tag `$$Token'");
461 case Lexer::LEX_FEOF:
466 switch (static_cast<LyXRCTags>(le)) {
469 format = lexrc.getInteger();
471 case RC_INPUT: // Include file
474 libFileSearch(string(),
476 if (read(tmp, check_format)) {
478 "Error reading included file: " + tmp.absFileName());
484 bind_file = os::internal_path(lexrc.getString());
489 def_file = os::internal_path(lexrc.getString());
494 ui_file = os::internal_path(lexrc.getString());
497 case RC_AUTORESET_OPTIONS:
498 lexrc >> auto_reset_options;
501 case RC_DISPLAY_GRAPHICS:
503 display_graphics = lexrc.getString() == "true";
506 case RC_TEX_EXPECTS_WINDOWS_PATHS:
507 lexrc >> windows_style_tex_paths;
510 case RC_TEX_ALLOWS_SPACES:
511 lexrc >> tex_allows_spaces;
514 case RC_TEXINPUTS_PREFIX:
515 lexrc >> texinputs_prefix;
522 case RC_KBMAP_PRIMARY:
524 string const kmap(os::internal_path(lexrc.getString()));
525 if (!libFileSearch("kbd", kmap, "kmap").empty()
527 primary_kbmap = kmap;
529 lexrc.printError("LyX: Keymap `$$Token' not found");
534 case RC_KBMAP_SECONDARY:
536 string const kmap(os::internal_path(lexrc.getString()));
537 if (!libFileSearch("kbd", kmap, "kmap").empty()
539 secondary_kbmap = kmap;
541 lexrc.printError("LyX: Keymap `$$Token' not found");
546 case RC_FONT_ENCODING:
550 case RC_FORCE_PAINT_SINGLE_CHAR:
551 lexrc >> force_paint_single_char;
558 case RC_PRINT_COMMAND:
559 if (lexrc.next(true)) {
560 print_command = lexrc.getString();
564 case RC_PRINTEVENPAGEFLAG:
565 lexrc >> print_evenpage_flag;
568 case RC_PRINTODDPAGEFLAG:
569 lexrc >> print_oddpage_flag;
572 case RC_PRINTPAGERANGEFLAG:
573 lexrc >> print_pagerange_flag;
576 case RC_PRINTCOPIESFLAG:
577 lexrc >> print_copies_flag;
580 case RC_PRINTCOLLCOPIESFLAG:
581 lexrc >> print_collcopies_flag;
584 case RC_PRINTREVERSEFLAG:
585 lexrc >> print_reverse_flag;
588 case RC_PRINTLANDSCAPEFLAG:
589 lexrc >> print_landscape_flag;
592 case RC_PRINTTOPRINTER:
593 lexrc >> print_to_printer;
596 case RC_PRINT_ADAPTOUTPUT:
597 lexrc >> print_adapt_output;
602 print_to_file = os::internal_path(lexrc.getString());
606 case RC_PRINTFILEEXTENSION:
607 lexrc >> print_file_extension;
610 case RC_PRINTEXSTRAOPTIONS:
611 lexrc >> print_extra_options;
614 case RC_PRINTSPOOL_COMMAND:
615 if (lexrc.next(true)) {
616 print_spool_command = lexrc.getString();
620 case RC_PRINTSPOOL_PRINTERPREFIX:
621 lexrc >> print_spool_printerprefix;
624 case RC_PRINTPAPERDIMENSIONFLAG:
625 lexrc >> print_paper_dimension_flag;
628 case RC_PRINTPAPERFLAG:
629 lexrc >> print_paper_flag;
632 case RC_VIEWDVI_PAPEROPTION:
634 view_dvi_paper_option = lexrc.getString();
636 view_dvi_paper_option.erase();
639 case RC_CHKTEX_COMMAND:
640 if (lexrc.next(true)) {
641 chktex_command = lexrc.getString();
645 case RC_BIBTEX_ALTERNATIVES:
646 if (lexrc.next(true)) {
647 bibtex_alternatives.insert(lexrc.getString());
651 case RC_BIBTEX_COMMAND:
652 if (lexrc.next(true)) {
653 bibtex_command = lexrc.getString();
657 case RC_JBIBTEX_COMMAND:
658 if (lexrc.next(true)) {
659 jbibtex_command = lexrc.getString();
663 case RC_INDEX_ALTERNATIVES:
664 if (lexrc.next(true)) {
665 index_alternatives.insert(lexrc.getString());
669 case RC_INDEX_COMMAND:
670 if (lexrc.next(true)) {
671 index_command = lexrc.getString();
675 case RC_JINDEX_COMMAND:
676 if (lexrc.next(true)) {
677 jindex_command = lexrc.getString();
681 case RC_SPLITINDEX_COMMAND:
682 if (lexrc.next(true)) {
683 splitindex_command = lexrc.getString();
687 case RC_NOMENCL_COMMAND:
688 if (lexrc.next(true)) {
689 nomencl_command = lexrc.getString();
701 case RC_GEOMETRY_SESSION:
702 lexrc >> allow_geometry_session;
705 case RC_SCREEN_FONT_SIZES:
706 lexrc >> font_sizes[FONT_SIZE_TINY];
707 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
708 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
709 lexrc >> font_sizes[FONT_SIZE_SMALL];
710 lexrc >> font_sizes[FONT_SIZE_NORMAL];
711 lexrc >> font_sizes[FONT_SIZE_LARGE];
712 lexrc >> font_sizes[FONT_SIZE_LARGER];
713 lexrc >> font_sizes[FONT_SIZE_LARGEST];
714 lexrc >> font_sizes[FONT_SIZE_HUGE];
715 lexrc >> font_sizes[FONT_SIZE_HUGER];
718 case RC_SCREEN_FONT_SCALABLE:
719 lexrc >> use_scalable_fonts;
726 case RC_DOCUMENTPATH:
728 document_path = os::internal_path(lexrc.getString());
729 document_path = expandPath(document_path);
735 example_path = os::internal_path(lexrc.getString());
736 example_path = expandPath(example_path);
740 case RC_TEMPLATEPATH:
742 template_path = os::internal_path(lexrc.getString());
743 template_path = expandPath(template_path);
749 tempdir_path = os::internal_path(lexrc.getString());
750 tempdir_path = expandPath(tempdir_path);
754 case RC_THESAURUSDIRPATH:
756 thesaurusdir_path = os::internal_path(lexrc.getString());
757 thesaurusdir_path = expandPath(thesaurusdir_path);
761 case RC_HUNSPELLDIR_PATH:
763 hunspelldir_path = os::internal_path(lexrc.getString());
764 hunspelldir_path = expandPath(hunspelldir_path);
768 case RC_USELASTFILEPOS:
769 lexrc >> use_lastfilepos;
773 lexrc >> load_session;
776 case RC_MOUSE_WHEEL_SPEED:
777 lexrc >> mouse_wheel_speed;
780 case RC_COMPLETION_INLINE_DELAY:
781 lexrc >> completion_inline_delay;
784 case RC_COMPLETION_INLINE_MATH:
785 lexrc >> completion_inline_math;
788 case RC_COMPLETION_INLINE_TEXT:
789 lexrc >> completion_inline_text;
792 case RC_COMPLETION_INLINE_DOTS:
793 lexrc >> completion_inline_dots;
796 case RC_AUTOCORRECTION_MATH:
797 lexrc >> autocorrection_math;
800 case RC_COMPLETION_POPUP_DELAY:
801 lexrc >> completion_popup_delay;
804 case RC_COMPLETION_POPUP_MATH:
805 lexrc >> completion_popup_math;
808 case RC_COMPLETION_POPUP_TEXT:
809 lexrc >> completion_popup_text;
812 case RC_COMPLETION_CURSOR_TEXT:
813 lexrc >> completion_cursor_text;
816 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
817 lexrc >> completion_popup_after_complete;
820 case RC_COMPLETION_MINLENGTH:
821 lexrc >> completion_minlength;
824 case RC_NUMLASTFILES:
825 lexrc >> num_lastfiles;
828 case RC_CHECKLASTFILES:
829 lexrc >> check_lastfiles;
836 case RC_SCREEN_FONT_ROMAN:
838 roman_font_name = lexrc.getString();
839 oldFontFormat(roman_font_name,
844 case RC_SCREEN_FONT_SANS:
846 sans_font_name = lexrc.getString();
847 oldFontFormat(sans_font_name, sans_font_foundry);
851 case RC_SCREEN_FONT_TYPEWRITER:
853 typewriter_font_name = lexrc.getString();
854 oldFontFormat(typewriter_font_name,
855 typewriter_font_foundry);
859 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
860 lexrc >> roman_font_foundry;
863 case RC_SCREEN_FONT_SANS_FOUNDRY:
864 lexrc >> sans_font_foundry;
867 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
868 lexrc >> typewriter_font_foundry;
873 lexrc.printError("Missing color tag.");
876 string lyx_name = lexrc.getString();
879 lexrc.printError("Missing color name for color: `$$Token'");
882 string x11_name = lexrc.getString();
884 ColorCode const col =
885 lcolor.getFromLyXName(lyx_name);
886 if (col == Color_none ||
887 col == Color_inherit ||
891 if (!lcolor.setColor(col, x11_name))
892 LYXERR0("Bad lyxrc set_color for " << lyx_name);
896 case RC_AUTOREGIONDELETE:
897 // Auto region delete defaults to true
898 lexrc >> auto_region_delete;
903 lyxpipes = os::internal_path(lexrc.getString());
904 lyxpipes = expandPath(lyxpipes);
908 case RC_CURSOR_FOLLOWS_SCROLLBAR:
909 lexrc >> cursor_follows_scrollbar;
912 case RC_CURSOR_WIDTH:
913 lexrc >> cursor_width;
916 case RC_SCROLL_BELOW_DOCUMENT:
917 lexrc >> scroll_below_document;
920 case RC_PARAGRAPH_MARKERS:
921 lexrc >> paragraph_markers;
924 case RC_MAC_DONTSWAP_CTRL_META:
925 lexrc >> mac_dontswap_ctrl_meta;
928 case RC_MAC_LIKE_WORD_MOVEMENT:
929 lexrc >> mac_like_word_movement;
932 case RC_MACRO_EDIT_STYLE:
934 switch (lexrc.getInteger()) {
935 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
936 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
937 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
942 case RC_DIALOGS_ICONIFY_WITH_MAIN:
943 lexrc >> dialogs_iconify_with_main;
946 case RC_PLAINTEXT_LINELEN:
947 lexrc >> plaintext_linelen;
949 // Spellchecker settings:
950 case RC_ACCEPT_COMPOUND:
951 lexrc >> spellchecker_accept_compound;
953 case RC_USE_SYSTEM_COLORS:
954 lexrc >> use_system_colors;
957 lexrc >> use_tooltip;
959 case RC_USE_PIXMAP_CACHE:
960 lexrc >> use_pixmap_cache;
965 case RC_SPELLCHECKER:
966 lexrc >> spellchecker;
969 lexrc >> spellchecker_alt_lang;
972 lexrc >> spellchecker_esc_chars;
974 case RC_SPELLCHECK_CONTINUOUSLY:
975 lexrc >> spellcheck_continuously;
977 case RC_SPELLCHECK_NOTES:
978 lexrc >> spellcheck_notes;
981 lexrc >> make_backup;
983 case RC_SAVE_COMPRESSED:
984 lexrc >> save_compressed;
986 case RC_BACKUPDIR_PATH:
988 backupdir_path = os::internal_path(lexrc.getString());
989 backupdir_path = expandPath(backupdir_path);
992 case RC_DEFAULT_DECIMAL_POINT:
993 lexrc >> default_decimal_point;
995 case RC_DEFAULT_LENGTH_UNIT:
997 default_length_unit = (Length::UNIT) lexrc.getInteger();
999 case RC_DATE_INSERT_FORMAT:
1000 lexrc >> date_insert_format;
1002 case RC_LANGUAGE_CUSTOM_PACKAGE:
1003 lexrc >> language_custom_package;
1005 case RC_LANGUAGE_AUTO_BEGIN:
1006 lexrc >> language_auto_begin;
1008 case RC_LANGUAGE_AUTO_END:
1009 lexrc >> language_auto_end;
1011 case RC_LANGUAGE_GLOBAL_OPTIONS:
1012 lexrc >> language_global_options;
1014 case RC_LANGUAGE_PACKAGE_SELECTION:
1016 switch (lexrc.getInteger()) {
1018 language_package_selection = LP_AUTO;
1021 language_package_selection = LP_BABEL;
1024 language_package_selection = LP_CUSTOM;
1027 language_package_selection = LP_NONE;
1032 case RC_LANGUAGE_COMMAND_BEGIN:
1033 lexrc >> language_command_begin;
1035 case RC_LANGUAGE_COMMAND_END:
1036 lexrc >> language_command_end;
1038 case RC_LANGUAGE_COMMAND_LOCAL:
1039 lexrc >> language_command_local;
1041 case RC_RTL_SUPPORT:
1042 lexrc >> rtl_support;
1044 case RC_VISUAL_CURSOR:
1045 lexrc >> visual_cursor;
1047 case RC_AUTO_NUMBER:
1048 lexrc >> auto_number;
1050 case RC_MARK_FOREIGN_LANGUAGE:
1051 lexrc >> mark_foreign_language;
1055 string fmt, command;
1057 fmt = lexrc.getString();
1058 if (lexrc.next(true))
1059 command = lexrc.getString();
1060 setMover(fmt, command);
1064 case RC_CONVERTER: {
1065 string from, to, command, flags;
1067 from = lexrc.getString();
1069 to = lexrc.getString();
1070 if (lexrc.next(true))
1071 command = lexrc.getString();
1073 flags = lexrc.getString();
1074 if (command.empty())
1075 theConverters().erase(from, to);
1077 theConverters().add(from, to, command, flags);
1080 // compatibility with versions older than 1.4.0 only
1082 string format, command;
1083 lexrc >> format >> command;
1084 formats.setViewer(format, command);
1087 case RC_FILEFORMAT: {
1089 string format, extensions, prettyname, shortcut;
1090 if (!(lexrc >> format >> extensions))
1092 if (ok && lexrc.next(true))
1093 prettyname = lexrc.getString();
1097 if(!(lexrc >> shortcut))
1099 string viewer, editor;
1100 if (ok && lexrc.next(true))
1101 viewer = lexrc.getString();
1104 if (ok && lexrc.next(true))
1105 editor = lexrc.getString();
1109 if (!(lexrc >> flags >> mime))
1111 int flgs = Format::none;
1112 while (!flags.empty()) {
1114 flags = split(flags, flag, ',');
1115 if (flag == "document")
1116 flgs |= Format::document;
1117 else if (flag == "vector")
1118 flgs |= Format::vector;
1119 else if (flag == "zipped=native")
1120 flgs |= Format::zipped_native;
1121 else if (flag == "menu=export")
1122 flgs |= Format::export_menu;
1124 LYXERR0("Ignoring unknown flag `"
1125 << flag << "' for format `"
1129 LYXERR0("Syntax error in format " << format);
1130 else if (prettyname.empty()) {
1131 if (theConverters().formatIsUsed(format))
1132 LYXERR0("Can't delete format " << format);
1134 formats.erase(format);
1136 formats.add(format, extensions, prettyname,
1137 shortcut, viewer, editor, mime, flgs);
1141 case RC_VIEWER_ALTERNATIVES: {
1142 string format, command;
1144 format = lexrc.getString();
1145 if (lexrc.eatLine())
1146 command = lexrc.getString();
1147 viewer_alternatives[format].insert(command);
1150 case RC_EDITOR_ALTERNATIVES: {
1151 string format, command;
1153 format = lexrc.getString();
1154 if (lexrc.eatLine())
1155 command = lexrc.getString();
1156 editor_alternatives[format].insert(command);
1160 case RC_DEFAULT_VIEW_FORMAT:
1161 lexrc >> default_view_format;
1164 case RC_DEFAULT_LANGUAGE:
1165 lexrc >> default_language;
1168 case RC_GUI_LANGUAGE:
1169 lexrc >> gui_language;
1172 case RC_SHOW_BANNER:
1173 lexrc >> show_banner;
1178 string const tmp = lexrc.getString();
1179 if (tmp == "true" || tmp == "on")
1180 preview = PREVIEW_ON;
1181 else if (tmp == "no_math")
1182 preview = PREVIEW_NO_MATH;
1184 preview = PREVIEW_OFF;
1185 if (tmp != "false" && tmp != "off")
1186 LYXERR0("Unrecognized preview status \""
1192 case RC_PREVIEW_HASHED_LABELS:
1193 lexrc >> preview_hashed_labels;
1196 case RC_PREVIEW_SCALE_FACTOR:
1197 lexrc >> preview_scale_factor;
1204 lexrc >> user_email;
1207 case RC_PATH_PREFIX:
1208 lexrc >> path_prefix;
1211 case RC_USE_CONVERTER_CACHE:
1212 lexrc >> use_converter_cache;
1214 case RC_CONVERTER_CACHE_MAXAGE:
1215 lexrc >> converter_cache_maxage;
1218 case RC_SORT_LAYOUTS:
1219 lexrc >> sort_layouts;
1221 case RC_GROUP_LAYOUTS:
1222 lexrc >> group_layouts;
1224 case RC_FULL_SCREEN_LIMIT:
1225 lexrc >> full_screen_limit;
1227 case RC_FULL_SCREEN_TOOLBARS:
1228 lexrc >> full_screen_toolbars;
1230 case RC_FULL_SCREEN_SCROLLBAR:
1231 lexrc >> full_screen_scrollbar;
1233 case RC_FULL_SCREEN_TABBAR:
1234 lexrc >> full_screen_tabbar;
1236 case RC_FULL_SCREEN_MENUBAR:
1237 lexrc >> full_screen_menubar;
1239 case RC_FULL_SCREEN_WIDTH:
1240 lexrc >> full_screen_width;
1242 case RC_OPEN_BUFFERS_IN_TABS:
1243 lexrc >> open_buffers_in_tabs;
1245 case RC_SINGLE_CLOSE_TAB_BUTTON:
1246 lexrc >> single_close_tab_button;
1248 case RC_SINGLE_INSTANCE:
1249 lexrc >> single_instance;
1250 if (run_mode == PREFERRED)
1251 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1253 case RC_FORWARD_SEARCH_DVI:
1254 if (lexrc.next(true))
1255 forward_search_dvi = lexrc.getString();
1257 case RC_FORWARD_SEARCH_PDF:
1258 if (lexrc.next(true))
1259 forward_search_pdf = lexrc.getString();
1261 case RC_EXPORT_OVERWRITE:
1263 string const tmp = lexrc.getString();
1264 if (tmp == "all" || tmp == "true")
1265 export_overwrite = ALL_FILES;
1266 else if (tmp == "main")
1267 export_overwrite = MAIN_FILE;
1269 export_overwrite = NO_FILES;
1270 if (tmp != "ask" && tmp != "false")
1271 LYXERR0("Unrecognized export_overwrite status \""
1276 case RC_SCROLL_WHEEL_ZOOM:
1278 string const tmp = lexrc.getString();
1280 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1281 else if (tmp == "shift")
1282 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1283 else if (tmp == "alt")
1284 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1286 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1287 if (tmp != "off" && tmp != "false")
1288 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1295 break; // this is just a dummy
1298 // This is triggered the first time through the loop unless
1299 // we hit a format tag.
1300 if (check_format && format != LYXRC_FILEFORMAT)
1301 return FormatMismatch;
1304 /// Update converters data-structures
1305 theConverters().update(formats);
1306 theConverters().buildGraph();
1312 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1314 ofstream ofs(filename.toFilesystemEncoding().c_str());
1316 write(ofs, ignore_system_lyxrc);
1320 void LyXRC::print() const
1322 if (lyxerr.debugging())
1323 write(lyxerr, false);
1331 typedef pair<string, SpecialisedMover> Data;
1333 SameMover(Data const & comparison)
1334 : comparison_(comparison) {}
1336 bool operator()(Data const & data) const
1338 return data.first == comparison_.first &&
1339 data.second.command() == comparison_.second.command();
1349 // Escape \ and " so that LyXLex can read the string later
1350 string escapeCommand(string const & str) {
1351 return subst(subst(str , "\\", "\\\\"),
1358 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1360 LyXRCTags tag = RC_LAST;
1362 if (!name.empty()) {
1363 for (int i = 0; i != lyxrcCount; ++i)
1364 if ("\\" + name == lyxrcTags[i].tag)
1365 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1369 os << "# LyX " << lyx_version
1370 << " generated this file. If you want to make your own\n"
1371 << "# modifications you should do them from inside LyX and save.\n\n"
1372 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1374 // Why the switch you might ask. It is a trick to ensure that all
1375 // the elements in the LyXRCTags enum are handled. As you can see
1376 // there are no breaks at all. So it is just a huge fall-through.
1377 // The nice thing is that we will get a warning from the compiler
1378 // if we forget an element.
1382 // input/include files are not done here
1383 case RC_LYXRCFORMAT:
1385 if (ignore_system_lyxrc ||
1386 bind_file != system_lyxrc.bind_file) {
1387 string const path = os::external_path(bind_file);
1388 os << "\\bind_file \"" << path << "\"\n";
1394 if (ignore_system_lyxrc ||
1395 def_file != system_lyxrc.def_file) {
1396 string const path = os::external_path(def_file);
1397 os << "\\def_file \"" << path << "\"\n";
1406 << "# MISC SECTION ######################################\n"
1408 // bind files are not done here.
1410 case RC_PATH_PREFIX:
1411 if (ignore_system_lyxrc ||
1412 path_prefix != system_lyxrc.path_prefix) {
1413 os << "\\path_prefix \"" << path_prefix << "\"\n";
1418 if (ignore_system_lyxrc ||
1419 ui_file != system_lyxrc.ui_file) {
1420 string const path = os::external_path(ui_file);
1421 os << "\\ui_file \"" << path << "\"\n";
1425 case RC_AUTOREGIONDELETE:
1426 if (ignore_system_lyxrc ||
1427 auto_region_delete != system_lyxrc.auto_region_delete) {
1428 os << "# Set to false to inhibit automatic replacement of\n"
1429 << "# the current selection.\n"
1430 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1435 case RC_AUTORESET_OPTIONS:
1436 if (ignore_system_lyxrc ||
1437 auto_reset_options != system_lyxrc.auto_reset_options) {
1438 os << "# Set to false to inhibit automatic reset of\n"
1439 << "# the class options to defaults on class change.\n"
1440 << "\\auto_reset_options "
1441 << convert<string>(auto_reset_options)
1447 if (ignore_system_lyxrc ||
1448 autosave != system_lyxrc.autosave) {
1449 os << "# The time interval between auto-saves in seconds.\n"
1450 << "\\autosave " << autosave << '\n';
1454 case RC_DISPLAY_GRAPHICS:
1455 if (ignore_system_lyxrc ||
1456 display_graphics != system_lyxrc.display_graphics) {
1457 os << "# Display graphics within LyX\n"
1459 << "\\display_graphics "
1460 << (display_graphics ? "true" : "false")
1465 case RC_SORT_LAYOUTS:
1466 if (ignore_system_lyxrc ||
1467 sort_layouts != system_lyxrc.sort_layouts) {
1468 os << "# Sort layouts alphabetically.\n"
1469 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1473 case RC_GROUP_LAYOUTS:
1474 if (ignore_system_lyxrc ||
1475 group_layouts != system_lyxrc.group_layouts) {
1476 os << "# Group layouts by their category.\n"
1477 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1481 case RC_VIEWDVI_PAPEROPTION:
1482 if (ignore_system_lyxrc ||
1483 view_dvi_paper_option
1484 != system_lyxrc.view_dvi_paper_option) {
1485 os << "# Options used to specify paper size to the\n"
1486 << "# view_dvi_command (e.g. -paper)\n"
1487 << "\\view_dvi_paper_option \""
1488 << view_dvi_paper_option << "\"\n";
1492 case RC_CHKTEX_COMMAND:
1493 if (ignore_system_lyxrc ||
1494 chktex_command != system_lyxrc.chktex_command) {
1495 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1499 case RC_BIBTEX_ALTERNATIVES: {
1500 CommandSet::const_iterator it = bibtex_alternatives.begin();
1501 CommandSet::const_iterator end = bibtex_alternatives.end();
1502 for ( ; it != end; ++it) {
1503 if (ignore_system_lyxrc
1504 || !system_lyxrc.bibtex_alternatives.count(*it))
1505 os << "\\bibtex_alternatives \""
1511 case RC_BIBTEX_COMMAND:
1512 if (ignore_system_lyxrc ||
1513 bibtex_command != system_lyxrc.bibtex_command) {
1514 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1518 case RC_JBIBTEX_COMMAND:
1519 if (ignore_system_lyxrc ||
1520 jbibtex_command != system_lyxrc.jbibtex_command) {
1521 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1525 case RC_INDEX_ALTERNATIVES: {
1526 CommandSet::const_iterator it = index_alternatives.begin();
1527 CommandSet::const_iterator end = index_alternatives.end();
1528 for ( ; it != end; ++it) {
1529 if (ignore_system_lyxrc
1530 || !system_lyxrc.index_alternatives.count(*it))
1531 os << "\\index_alternatives \""
1537 case RC_INDEX_COMMAND:
1538 if (ignore_system_lyxrc ||
1539 index_command != system_lyxrc.index_command) {
1540 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1544 case RC_JINDEX_COMMAND:
1545 if (ignore_system_lyxrc ||
1546 jindex_command != system_lyxrc.jindex_command) {
1547 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1551 case RC_SPLITINDEX_COMMAND:
1552 if (ignore_system_lyxrc ||
1553 splitindex_command != system_lyxrc.splitindex_command) {
1554 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1558 case RC_NOMENCL_COMMAND:
1559 if (ignore_system_lyxrc ||
1560 nomencl_command != system_lyxrc.nomencl_command) {
1561 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1565 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1566 // Don't write this setting to the preferences file,
1567 // but allow temporary changes (bug 7557).
1568 if (ignore_system_lyxrc) {
1569 os << "\\tex_expects_windows_paths "
1570 << convert<string>(windows_style_tex_paths) << '\n';
1574 case RC_TEX_ALLOWS_SPACES:
1575 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1576 os << "\\tex_allows_spaces "
1577 << convert<string>(tex_allows_spaces) << '\n';
1582 if (ignore_system_lyxrc ||
1583 use_kbmap != system_lyxrc.use_kbmap) {
1584 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1588 case RC_KBMAP_PRIMARY:
1589 if (ignore_system_lyxrc ||
1590 primary_kbmap != system_lyxrc.primary_kbmap) {
1591 string const path = os::external_path(primary_kbmap);
1592 os << "\\kbmap_primary \"" << path << "\"\n";
1596 case RC_KBMAP_SECONDARY:
1597 if (ignore_system_lyxrc ||
1598 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1599 string const path = os::external_path(secondary_kbmap);
1600 os << "\\kbmap_secondary \"" << path << "\"\n";
1605 if (ignore_system_lyxrc ||
1606 lyxpipes != system_lyxrc.lyxpipes) {
1607 string const path = os::external_path(lyxpipes);
1608 os << "\\serverpipe \"" << path << "\"\n";
1612 case RC_DATE_INSERT_FORMAT:
1613 if (ignore_system_lyxrc ||
1614 date_insert_format != system_lyxrc.date_insert_format) {
1615 os << "\\date_insert_format \"" << date_insert_format
1622 os << "\\user_name \"" << user_name << "\"\n";
1627 os << "\\user_email \"" << user_email << "\"\n";
1631 case RC_SHOW_BANNER:
1632 if (ignore_system_lyxrc ||
1633 show_banner != system_lyxrc.show_banner) {
1634 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1640 if (ignore_system_lyxrc ||
1641 preview != system_lyxrc.preview) {
1647 case PREVIEW_NO_MATH:
1654 os << "\\preview " << status << '\n';
1659 case RC_PREVIEW_HASHED_LABELS:
1660 if (ignore_system_lyxrc ||
1661 preview_hashed_labels !=
1662 system_lyxrc.preview_hashed_labels) {
1663 os << "\\preview_hashed_labels "
1664 << convert<string>(preview_hashed_labels) << '\n';
1669 case RC_PREVIEW_SCALE_FACTOR:
1670 if (ignore_system_lyxrc ||
1671 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1672 os << "\\preview_scale_factor "
1673 << preview_scale_factor << '\n';
1678 case RC_USE_CONVERTER_CACHE:
1679 if (ignore_system_lyxrc ||
1680 use_converter_cache != system_lyxrc.use_converter_cache) {
1681 os << "\\use_converter_cache "
1682 << convert<string>(use_converter_cache) << '\n';
1687 case RC_CONVERTER_CACHE_MAXAGE:
1688 if (ignore_system_lyxrc ||
1689 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1690 os << "\\converter_cache_maxage "
1691 << converter_cache_maxage << '\n';
1697 << "# SCREEN & FONTS SECTION ############################\n"
1701 if (ignore_system_lyxrc ||
1702 icon_set != system_lyxrc.icon_set) {
1703 os << "\\icon_set \"" << icon_set
1710 if (ignore_system_lyxrc ||
1711 dpi != system_lyxrc.dpi) {
1712 os << "\\screen_dpi " << dpi << '\n';
1716 case RC_SCREEN_ZOOM:
1717 if (ignore_system_lyxrc ||
1718 zoom != system_lyxrc.zoom) {
1719 os << "\\screen_zoom " << zoom << '\n';
1723 case RC_GEOMETRY_SESSION:
1724 if (ignore_system_lyxrc ||
1725 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1726 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1731 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1732 if (ignore_system_lyxrc ||
1733 cursor_follows_scrollbar
1734 != system_lyxrc.cursor_follows_scrollbar) {
1735 os << "\\cursor_follows_scrollbar "
1736 << convert<string>(cursor_follows_scrollbar) << '\n';
1740 case RC_CURSOR_WIDTH:
1741 if (ignore_system_lyxrc ||
1743 != system_lyxrc.cursor_width) {
1744 os << "\\cursor_width "
1745 << cursor_width << '\n';
1749 case RC_SCROLL_BELOW_DOCUMENT:
1750 if (ignore_system_lyxrc ||
1751 scroll_below_document
1752 != system_lyxrc.scroll_below_document) {
1753 os << "\\scroll_below_document "
1754 << convert<string>(scroll_below_document) << '\n';
1758 case RC_PARAGRAPH_MARKERS:
1759 if (ignore_system_lyxrc ||
1761 != system_lyxrc.paragraph_markers) {
1762 os << "\\paragraph_markers "
1763 << convert<string>(paragraph_markers) << '\n';
1767 case RC_MAC_DONTSWAP_CTRL_META:
1768 if (ignore_system_lyxrc ||
1769 mac_dontswap_ctrl_meta
1770 != system_lyxrc.mac_dontswap_ctrl_meta) {
1771 os << "\\mac_dontswap_ctrl_meta "
1772 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1776 case RC_MAC_LIKE_WORD_MOVEMENT:
1777 if (ignore_system_lyxrc ||
1778 mac_like_word_movement
1779 != system_lyxrc.mac_like_word_movement) {
1780 os << "\\mac_like_word_movement "
1781 << convert<string>(mac_like_word_movement) << '\n';
1785 case RC_MACRO_EDIT_STYLE:
1786 if (ignore_system_lyxrc ||
1788 != system_lyxrc.macro_edit_style) {
1789 os << "\\macro_edit_style ";
1790 switch (macro_edit_style) {
1791 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1792 case MACRO_EDIT_INLINE: os << "1\n"; break;
1793 case MACRO_EDIT_LIST: os << "2\n"; break;
1798 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1799 if (ignore_system_lyxrc ||
1800 dialogs_iconify_with_main
1801 != system_lyxrc.dialogs_iconify_with_main) {
1802 os << "\\dialogs_iconify_with_main "
1803 << convert<string>(dialogs_iconify_with_main) << '\n';
1807 case RC_SCREEN_FONT_ROMAN:
1808 if (ignore_system_lyxrc ||
1809 roman_font_name != system_lyxrc.roman_font_name) {
1810 os << "\\screen_font_roman \"" << roman_font_name
1815 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1816 if (ignore_system_lyxrc ||
1817 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1818 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1823 case RC_SCREEN_FONT_SANS:
1824 if (ignore_system_lyxrc ||
1825 sans_font_name != system_lyxrc.sans_font_name) {
1826 os << "\\screen_font_sans \"" << sans_font_name
1831 case RC_SCREEN_FONT_SANS_FOUNDRY:
1832 if (ignore_system_lyxrc ||
1833 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1834 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1839 case RC_SCREEN_FONT_TYPEWRITER:
1840 if (ignore_system_lyxrc ||
1841 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1842 os << "\\screen_font_typewriter \""
1843 << typewriter_font_name << "\"\n";
1847 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1848 if (ignore_system_lyxrc ||
1849 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1850 os << "\\screen_font_typewriter_foundry \""
1851 << typewriter_font_foundry << "\"\n";
1856 case RC_SCREEN_FONT_SCALABLE:
1857 if (ignore_system_lyxrc ||
1858 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1859 os << "\\screen_font_scalable "
1860 << convert<string>(use_scalable_fonts)
1865 case RC_SCREEN_FONT_SIZES:
1866 if (ignore_system_lyxrc ||
1867 font_sizes[FONT_SIZE_TINY]
1868 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1869 font_sizes[FONT_SIZE_SCRIPT]
1870 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1871 font_sizes[FONT_SIZE_FOOTNOTE]
1872 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1873 font_sizes[FONT_SIZE_SMALL]
1874 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1875 font_sizes[FONT_SIZE_NORMAL]
1876 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1877 font_sizes[FONT_SIZE_LARGE]
1878 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1879 font_sizes[FONT_SIZE_LARGER]
1880 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1881 font_sizes[FONT_SIZE_LARGEST]
1882 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1883 font_sizes[FONT_SIZE_HUGE]
1884 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1885 font_sizes[FONT_SIZE_HUGER]
1886 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1887 os.setf(ios::fixed);
1889 os << "\\screen_font_sizes"
1890 << ' ' << font_sizes[FONT_SIZE_TINY]
1891 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1892 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1893 << ' ' << font_sizes[FONT_SIZE_SMALL]
1894 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1895 << ' ' << font_sizes[FONT_SIZE_LARGE]
1896 << ' ' << font_sizes[FONT_SIZE_LARGER]
1897 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1898 << ' ' << font_sizes[FONT_SIZE_HUGE]
1899 << ' ' << font_sizes[FONT_SIZE_HUGER]
1904 case RC_FULL_SCREEN_LIMIT:
1905 if (ignore_system_lyxrc ||
1906 full_screen_limit != system_lyxrc.full_screen_limit) {
1907 os << "\\fullscreen_limit "
1908 << convert<string>(full_screen_limit)
1913 case RC_FULL_SCREEN_TOOLBARS:
1914 if (ignore_system_lyxrc ||
1915 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1916 os << "\\fullscreen_toolbars "
1917 << convert<string>(full_screen_toolbars)
1922 case RC_FULL_SCREEN_SCROLLBAR:
1923 if (ignore_system_lyxrc ||
1924 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1925 os << "\\fullscreen_scrollbar "
1926 << convert<string>(full_screen_scrollbar)
1931 case RC_FULL_SCREEN_TABBAR:
1932 if (ignore_system_lyxrc ||
1933 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1934 os << "\\fullscreen_tabbar "
1935 << convert<string>(full_screen_tabbar)
1940 case RC_FULL_SCREEN_MENUBAR:
1941 if (ignore_system_lyxrc ||
1942 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1943 os << "\\fullscreen_menubar "
1944 << convert<string>(full_screen_menubar)
1949 case RC_FULL_SCREEN_WIDTH:
1950 if (ignore_system_lyxrc ||
1951 full_screen_width != system_lyxrc.full_screen_width) {
1952 os << "\\fullscreen_width "
1953 << convert<string>(full_screen_width)
1958 case RC_OPEN_BUFFERS_IN_TABS:
1959 if (ignore_system_lyxrc ||
1960 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1961 os << "\\open_buffers_in_tabs "
1962 << convert<string>(open_buffers_in_tabs)
1967 case RC_SINGLE_CLOSE_TAB_BUTTON:
1968 if (ignore_system_lyxrc ||
1969 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1970 os << "\\single_close_tab_button "
1971 << convert<string>(single_close_tab_button)
1976 case RC_SINGLE_INSTANCE:
1977 if (ignore_system_lyxrc ||
1978 single_instance != system_lyxrc.single_instance) {
1979 os << "\\single_instance "
1980 << convert<string>(single_instance)
1985 case RC_FORWARD_SEARCH_DVI:
1986 if (ignore_system_lyxrc ||
1987 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1988 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1992 case RC_FORWARD_SEARCH_PDF:
1993 if (ignore_system_lyxrc ||
1994 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1995 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2001 << "# COLOR SECTION ###################################\n"
2005 for (int i = 0; i < Color_ignore; ++i) {
2006 ColorCode lc = static_cast<ColorCode>(i);
2007 string const col = lcolor.getX11Name(lc);
2008 if (ignore_system_lyxrc
2009 || col != system_lcolor.getX11Name(lc)) {
2010 os << "\\set_color \""
2011 << lcolor.getLyXName(lc) << "\" \""
2019 << "# PRINTER SECTION ###################################\n"
2023 if (ignore_system_lyxrc ||
2024 printer != system_lyxrc.printer) {
2025 os << "\\printer \"" << printer << "\"\n";
2029 case RC_PRINT_ADAPTOUTPUT:
2030 if (ignore_system_lyxrc ||
2031 print_adapt_output != system_lyxrc.print_adapt_output) {
2032 os << "\\print_adapt_output "
2033 << convert<string>(print_adapt_output)
2038 case RC_PRINT_COMMAND:
2039 if (ignore_system_lyxrc ||
2040 print_command != system_lyxrc.print_command) {
2041 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2045 case RC_PRINTEXSTRAOPTIONS:
2046 if (ignore_system_lyxrc ||
2047 print_extra_options != system_lyxrc.print_extra_options) {
2048 os << "\\print_extra_options \"" << print_extra_options
2053 case RC_PRINTSPOOL_COMMAND:
2054 if (ignore_system_lyxrc ||
2055 print_spool_command != system_lyxrc.print_spool_command) {
2056 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2061 case RC_PRINTSPOOL_PRINTERPREFIX:
2062 if (ignore_system_lyxrc ||
2063 print_spool_printerprefix
2064 != system_lyxrc.print_spool_printerprefix) {
2065 os << "\\print_spool_printerprefix \""
2066 << print_spool_printerprefix << "\"\n";
2070 case RC_PRINTEVENPAGEFLAG:
2071 if (ignore_system_lyxrc ||
2072 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2073 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2078 case RC_PRINTODDPAGEFLAG:
2079 if (ignore_system_lyxrc ||
2080 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2081 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2086 case RC_PRINTREVERSEFLAG:
2087 if (ignore_system_lyxrc ||
2088 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2089 os << "\\print_reverse_flag \"" << print_reverse_flag
2094 case RC_PRINTLANDSCAPEFLAG:
2095 if (ignore_system_lyxrc ||
2096 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2097 os << "\\print_landscape_flag \"" << print_landscape_flag
2102 case RC_PRINTPAGERANGEFLAG:
2103 if (ignore_system_lyxrc ||
2104 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2105 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2110 case RC_PRINTCOPIESFLAG:
2111 if (ignore_system_lyxrc ||
2112 print_copies_flag != system_lyxrc.print_copies_flag) {
2113 os << "\\print_copies_flag \"" << print_copies_flag
2118 case RC_PRINTCOLLCOPIESFLAG:
2119 if (ignore_system_lyxrc ||
2120 print_collcopies_flag
2121 != system_lyxrc.print_collcopies_flag) {
2122 os << "\\print_collcopies_flag \""
2123 << print_collcopies_flag
2128 case RC_PRINTPAPERFLAG:
2129 if (ignore_system_lyxrc ||
2130 print_paper_flag != system_lyxrc.print_paper_flag) {
2131 os << "\\print_paper_flag \"" << print_paper_flag
2136 case RC_PRINTPAPERDIMENSIONFLAG:
2137 if (ignore_system_lyxrc ||
2138 print_paper_dimension_flag
2139 != system_lyxrc.print_paper_dimension_flag) {
2140 os << "\\print_paper_dimension_flag \""
2141 << print_paper_dimension_flag << "\"\n";
2145 case RC_PRINTTOPRINTER:
2146 if (ignore_system_lyxrc ||
2147 print_to_printer != system_lyxrc.print_to_printer) {
2148 os << "\\print_to_printer \"" << print_to_printer
2153 case RC_PRINTTOFILE:
2154 if (ignore_system_lyxrc ||
2155 print_to_file != system_lyxrc.print_to_file) {
2156 string const path = os::external_path(print_to_file);
2157 os << "\\print_to_file \"" << path << "\"\n";
2161 case RC_PRINTFILEEXTENSION:
2162 if (ignore_system_lyxrc ||
2163 print_file_extension != system_lyxrc.print_file_extension) {
2164 os << "\\print_file_extension \""
2165 << print_file_extension
2172 << "# TEX SECTION #######################################\n"
2175 case RC_TEXINPUTS_PREFIX:
2176 if (ignore_system_lyxrc ||
2177 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2178 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2183 case RC_FONT_ENCODING:
2184 if (ignore_system_lyxrc ||
2185 fontenc != system_lyxrc.fontenc) {
2186 os << "\\font_encoding \"" << fontenc << "\"\n";
2191 case RC_FORCE_PAINT_SINGLE_CHAR:
2192 if (ignore_system_lyxrc ||
2193 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2194 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2200 << "# FILE SECTION ######################################\n"
2203 case RC_DOCUMENTPATH:
2204 if (ignore_system_lyxrc ||
2205 document_path != system_lyxrc.document_path) {
2206 string const path = os::external_path(document_path);
2207 os << "\\document_path \"" << path << "\"\n";
2211 case RC_USELASTFILEPOS:
2212 if (ignore_system_lyxrc ||
2213 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2214 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2219 case RC_LOADSESSION:
2220 if (ignore_system_lyxrc ||
2221 load_session != system_lyxrc.load_session) {
2222 os << "\\load_session " << convert<string>(load_session)
2227 case RC_MOUSE_WHEEL_SPEED:
2228 if (ignore_system_lyxrc ||
2229 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2230 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2234 case RC_COMPLETION_INLINE_DELAY:
2235 if (ignore_system_lyxrc ||
2236 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2237 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2241 case RC_COMPLETION_INLINE_MATH:
2242 if (ignore_system_lyxrc ||
2243 completion_inline_math != system_lyxrc.completion_inline_math) {
2244 os << "\\completion_inline_math "
2245 << convert<string>(completion_inline_math) << '\n';
2249 case RC_COMPLETION_INLINE_TEXT:
2250 if (ignore_system_lyxrc ||
2251 completion_inline_text != system_lyxrc.completion_inline_text) {
2252 os << "\\completion_inline_text "
2253 << convert<string>(completion_inline_text) << '\n';
2257 case RC_COMPLETION_INLINE_DOTS:
2258 if (ignore_system_lyxrc ||
2259 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2260 os << "\\completion_inline_dots "
2261 << convert<string>(completion_inline_dots) << '\n';
2265 case RC_AUTOCORRECTION_MATH:
2266 if (ignore_system_lyxrc ||
2267 autocorrection_math != system_lyxrc.autocorrection_math) {
2268 os << "\\autocorrection_math "
2269 << convert<string>(autocorrection_math) << '\n';
2273 case RC_COMPLETION_POPUP_DELAY:
2274 if (ignore_system_lyxrc ||
2275 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2276 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2280 case RC_COMPLETION_POPUP_MATH:
2281 if (ignore_system_lyxrc ||
2282 completion_popup_math != system_lyxrc.completion_popup_math) {
2283 os << "\\completion_popup_math "
2284 << convert<string>(completion_popup_math) << '\n';
2288 case RC_COMPLETION_POPUP_TEXT:
2289 if (ignore_system_lyxrc ||
2290 completion_popup_text != system_lyxrc.completion_popup_text) {
2291 os << "\\completion_popup_text "
2292 << convert<string>(completion_popup_text) << '\n';
2296 case RC_COMPLETION_CURSOR_TEXT:
2297 if (ignore_system_lyxrc ||
2298 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2299 os << "\\completion_cursor_text "
2300 << convert<string>(completion_cursor_text) << '\n';
2304 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2305 if (ignore_system_lyxrc ||
2306 completion_popup_after_complete
2307 != system_lyxrc.completion_popup_after_complete) {
2308 os << "\\completion_popup_after_complete "
2309 << convert<string>(completion_popup_after_complete) << '\n';
2313 case RC_COMPLETION_MINLENGTH:
2314 if (ignore_system_lyxrc ||
2315 completion_minlength != system_lyxrc.completion_minlength) {
2316 os << "\\completion_minlength " << convert<string>(completion_minlength)
2322 case RC_NUMLASTFILES:
2323 if (ignore_system_lyxrc ||
2324 num_lastfiles != system_lyxrc.num_lastfiles) {
2325 os << "\\num_lastfiles " << num_lastfiles << '\n';
2329 case RC_CHECKLASTFILES:
2330 if (ignore_system_lyxrc ||
2331 check_lastfiles != system_lyxrc.check_lastfiles) {
2332 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2337 case RC_EXAMPLEPATH:
2338 if (ignore_system_lyxrc ||
2339 example_path != system_lyxrc.example_path) {
2340 string const path = os::external_path(example_path);
2341 os << "\\example_path \"" << path << "\"\n";
2345 case RC_TEMPLATEPATH:
2346 if (ignore_system_lyxrc ||
2347 template_path != system_lyxrc.template_path) {
2348 string const path = os::external_path(template_path);
2349 os << "\\template_path \"" << path << "\"\n";
2353 case RC_TEMPDIRPATH:
2354 if (ignore_system_lyxrc ||
2355 tempdir_path != system_lyxrc.tempdir_path) {
2356 string const path = os::external_path(tempdir_path);
2357 os << "\\tempdir_path \"" << path << "\"\n";
2361 case RC_THESAURUSDIRPATH:
2362 if (ignore_system_lyxrc ||
2363 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2364 string const path = os::external_path(thesaurusdir_path);
2365 os << "\\thesaurusdir_path \"" << path << "\"\n";
2369 case RC_HUNSPELLDIR_PATH:
2370 if (ignore_system_lyxrc ||
2371 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2372 string const path = os::external_path(hunspelldir_path);
2373 os << "\\hunspelldir_path \"" << path << "\"\n";
2377 case RC_PLAINTEXT_LINELEN:
2378 if (ignore_system_lyxrc ||
2379 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2380 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2384 case RC_MAKE_BACKUP:
2385 if (ignore_system_lyxrc ||
2386 make_backup != system_lyxrc.make_backup) {
2387 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2391 case RC_SAVE_COMPRESSED:
2392 if (ignore_system_lyxrc ||
2393 save_compressed != system_lyxrc.save_compressed) {
2394 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2398 case RC_BACKUPDIR_PATH:
2399 if (ignore_system_lyxrc ||
2400 backupdir_path != system_lyxrc.backupdir_path) {
2401 string const path = os::external_path(backupdir_path);
2402 os << "\\backupdir_path \"" << path << "\"\n";
2408 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2412 << "# SPELLCHECKER SECTION ##############################\n"
2415 case RC_ACCEPT_COMPOUND:
2416 if (ignore_system_lyxrc ||
2417 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2418 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2424 if (ignore_system_lyxrc ||
2425 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2426 os << "\\alternate_language \"" << spellchecker_alt_lang
2432 if (ignore_system_lyxrc ||
2433 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2434 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2438 case RC_USE_SYSTEM_COLORS:
2439 if (ignore_system_lyxrc ||
2440 use_system_colors != system_lyxrc.use_system_colors) {
2441 os << "\\use_system_colors "
2442 << convert<string>(use_system_colors)
2447 case RC_USE_TOOLTIP:
2448 if (ignore_system_lyxrc ||
2449 use_tooltip != system_lyxrc.use_tooltip) {
2450 os << "\\use_tooltip "
2451 << convert<string>(use_tooltip)
2456 case RC_USE_PIXMAP_CACHE:
2457 if (ignore_system_lyxrc ||
2458 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2459 os << "\\use_pixmap_cache "
2460 << convert<string>(use_pixmap_cache)
2466 if (ignore_system_lyxrc ||
2467 use_qimage != system_lyxrc.use_qimage) {
2468 os << "\\use_qimage "
2469 << convert<string>(use_qimage)
2476 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2481 case RC_DEFAULT_DECIMAL_POINT:
2482 if (ignore_system_lyxrc ||
2483 default_decimal_point != system_lyxrc.default_decimal_point) {
2484 os << "\\default_decimal_point " << default_decimal_point << '\n';
2489 case RC_DEFAULT_LENGTH_UNIT:
2490 if (ignore_system_lyxrc ||
2491 default_length_unit != system_lyxrc.default_length_unit) {
2492 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2497 case RC_SPELLCHECKER:
2498 if (ignore_system_lyxrc ||
2499 spellchecker != system_lyxrc.spellchecker) {
2500 os << "\\spellchecker " << spellchecker << '\n';
2505 case RC_SPELLCHECK_CONTINUOUSLY:
2506 if (ignore_system_lyxrc ||
2507 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2508 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2514 case RC_SPELLCHECK_NOTES:
2515 if (ignore_system_lyxrc ||
2516 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2517 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2523 case RC_RTL_SUPPORT:
2524 if (ignore_system_lyxrc ||
2525 rtl_support != system_lyxrc.rtl_support) {
2526 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2530 case RC_VISUAL_CURSOR:
2531 if (ignore_system_lyxrc ||
2532 visual_cursor != system_lyxrc.visual_cursor) {
2533 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2537 case RC_LANGUAGE_CUSTOM_PACKAGE:
2538 if (ignore_system_lyxrc ||
2539 language_custom_package != system_lyxrc.language_custom_package) {
2540 os << "\\language_custom_package \"" << language_custom_package
2545 case RC_LANGUAGE_GLOBAL_OPTIONS:
2546 if (ignore_system_lyxrc ||
2547 language_global_options
2548 != system_lyxrc.language_global_options) {
2549 os << "\\language_global_options \""
2550 << convert<string>(language_global_options)
2555 case RC_LANGUAGE_PACKAGE_SELECTION:
2556 if (ignore_system_lyxrc ||
2557 language_package_selection != system_lyxrc.language_package_selection) {
2558 os << "\\language_package_selection ";
2559 switch (language_package_selection) {
2576 case RC_LANGUAGE_COMMAND_BEGIN:
2577 if (ignore_system_lyxrc ||
2578 language_command_begin
2579 != system_lyxrc.language_command_begin) {
2580 os << "\\language_command_begin \""
2581 << language_command_begin
2586 case RC_LANGUAGE_COMMAND_END:
2587 if (ignore_system_lyxrc ||
2588 language_command_end
2589 != system_lyxrc.language_command_end) {
2590 os << "\\language_command_end \"" << language_command_end
2595 case RC_LANGUAGE_COMMAND_LOCAL:
2596 if (ignore_system_lyxrc ||
2597 language_command_local
2598 != system_lyxrc.language_command_local) {
2599 os << "\\language_command_local \""
2600 << language_command_local
2605 case RC_LANGUAGE_AUTO_BEGIN:
2606 if (ignore_system_lyxrc ||
2607 language_auto_begin != system_lyxrc.language_auto_begin) {
2608 os << "\\language_auto_begin "
2609 << convert<string>(language_auto_begin) << '\n';
2613 case RC_LANGUAGE_AUTO_END:
2614 if (ignore_system_lyxrc ||
2615 language_auto_end != system_lyxrc.language_auto_end) {
2616 os << "\\language_auto_end "
2617 << convert<string>(language_auto_end) << '\n';
2621 case RC_MARK_FOREIGN_LANGUAGE:
2622 if (ignore_system_lyxrc ||
2623 mark_foreign_language
2624 != system_lyxrc.mark_foreign_language) {
2625 os << "\\mark_foreign_language " <<
2626 convert<string>(mark_foreign_language) << '\n';
2632 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2635 case RC_AUTO_NUMBER:
2636 if (ignore_system_lyxrc ||
2637 auto_number != system_lyxrc.auto_number) {
2638 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2642 case RC_DEFAULT_LANGUAGE:
2643 if (ignore_system_lyxrc ||
2644 default_language != system_lyxrc.default_language) {
2645 os << "\\default_language " << default_language << '\n';
2649 case RC_GUI_LANGUAGE:
2650 if (ignore_system_lyxrc ||
2651 gui_language != system_lyxrc.gui_language) {
2652 os << "\\gui_language " << gui_language << '\n';
2656 case RC_EXPORT_OVERWRITE:
2657 if (ignore_system_lyxrc ||
2658 export_overwrite != system_lyxrc.export_overwrite) {
2660 switch (export_overwrite) {
2671 os << "\\export_overwrite " << status << '\n';
2676 case RC_SCROLL_WHEEL_ZOOM:
2677 if (ignore_system_lyxrc ||
2678 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2680 switch (scroll_wheel_zoom) {
2681 case SCROLL_WHEEL_ZOOM_OFF:
2684 case SCROLL_WHEEL_ZOOM_CTRL:
2687 case SCROLL_WHEEL_ZOOM_SHIFT:
2690 case SCROLL_WHEEL_ZOOM_ALT:
2694 os << "\\scroll_wheel_zoom " << status << '\n';
2700 << "# FORMATS SECTION ##########################\n"
2704 // New/modified formats
2705 for (Formats::const_iterator cit = formats.begin();
2706 cit != formats.end(); ++cit) {
2707 Format const * format =
2708 system_formats.getFormat(cit->name());
2710 format->extensions() != cit->extensions() ||
2711 format->prettyname() != cit->prettyname() ||
2712 format->shortcut() != cit->shortcut() ||
2713 format->viewer() != cit->viewer() ||
2714 format->editor() != cit->editor() ||
2715 format->documentFormat() != cit->documentFormat() ||
2716 format->vectorFormat() != cit->vectorFormat() ||
2717 format->inExportMenu() != cit->inExportMenu() ||
2718 format->mime() != cit->mime()) {
2719 os << "\\format \"" << cit->name() << "\" \""
2720 << cit->extensions() << "\" \""
2721 << cit->prettyname() << "\" \""
2722 << cit->shortcut() << "\" \""
2723 << escapeCommand(cit->viewer()) << "\" \""
2724 << escapeCommand(cit->editor()) << "\" \"";
2725 vector<string> flags;
2726 if (cit->documentFormat())
2727 flags.push_back("document");
2728 if (cit->vectorFormat())
2729 flags.push_back("vector");
2730 if (cit->zippedNative())
2731 flags.push_back("zipped=native");
2732 if (cit->inExportMenu())
2733 flags.push_back("menu=export");
2735 os << getStringFromVector(flags);
2736 os << "\" \"" << cit->mime() << "\"\n";
2740 // Look for deleted formats
2741 for (Formats::const_iterator cit = system_formats.begin();
2742 cit != system_formats.end(); ++cit)
2743 if (!formats.getFormat(cit->name()))
2744 os << "\\format \"" << cit->name()
2745 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2748 case RC_VIEWER_ALTERNATIVES: {
2749 Alternatives::const_iterator it = viewer_alternatives.begin();
2750 Alternatives::const_iterator const en = viewer_alternatives.end();
2751 Alternatives::const_iterator const sysend =
2752 system_lyxrc.viewer_alternatives.end();
2753 for (; it != en; ++it) {
2754 string const & fmt = it->first;
2755 CommandSet const & cmd = it->second;
2756 CommandSet::const_iterator sit = cmd.begin();
2757 CommandSet::const_iterator const sen = cmd.end();
2758 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2759 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2760 system_lyxrc.viewer_alternatives.find(fmt);
2761 for (; sit != sen; ++sit) {
2762 string const & cmd = *sit;
2763 if (ignore_system_lyxrc
2764 || sysfmt == sysend // format not found
2765 || sysfmt->second.count(cmd) == 0 // this command not found
2767 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2773 case RC_EDITOR_ALTERNATIVES: {
2774 Alternatives::const_iterator it = editor_alternatives.begin();
2775 Alternatives::const_iterator const en = editor_alternatives.end();
2776 Alternatives::const_iterator const sysend =
2777 system_lyxrc.editor_alternatives.end();
2778 for (; it != en; ++it) {
2779 string const & fmt = it->first;
2780 CommandSet const & cmd = it->second;
2781 CommandSet::const_iterator sit = cmd.begin();
2782 CommandSet::const_iterator const sen = cmd.end();
2783 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2784 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2785 system_lyxrc.editor_alternatives.find(fmt);
2786 for (; sit != sen; ++sit) {
2787 string const & cmd = *sit;
2788 if (ignore_system_lyxrc
2789 || sysfmt == sysend // format not found
2790 || sysfmt->second.count(cmd) == 0 // this command not found
2792 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2798 case RC_DEFAULT_VIEW_FORMAT:
2799 if (ignore_system_lyxrc ||
2800 default_view_format != system_lyxrc.default_view_format) {
2801 os << "\\default_view_format " << default_view_format << '\n';
2811 << "# CONVERTERS SECTION ##########################\n"
2815 // Look for new converters
2816 for (Converters::const_iterator cit = theConverters().begin();
2817 cit != theConverters().end(); ++cit) {
2818 Converter const * converter =
2819 theSystemConverters().getConverter(cit->from,
2822 converter->command != cit->command ||
2823 converter->flags != cit->flags)
2824 os << "\\converter \"" << cit->from << "\" \""
2825 << cit->to << "\" \""
2826 << escapeCommand(cit->command) << "\" \""
2827 << cit->flags << "\"\n";
2830 // New/modifed converters
2831 for (Converters::const_iterator cit = theSystemConverters().begin();
2832 cit != theSystemConverters().end(); ++cit)
2833 if (!theConverters().getConverter(cit->from, cit->to))
2834 os << "\\converter \"" << cit->from
2835 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2842 << "# COPIERS SECTION ##########################\n"
2845 // Look for new movers
2846 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2847 Movers::const_iterator const sysend = theSystemMovers().end();
2848 Movers::const_iterator it = theMovers().begin();
2849 Movers::const_iterator end = theMovers().end();
2851 for (; it != end; ++it) {
2852 Movers::const_iterator const sysit =
2853 find_if(sysbegin, sysend, SameMover(*it));
2854 if (sysit == sysend) {
2855 string const & fmt = it->first;
2856 string const & command =
2857 it->second.command();
2859 os << "\\copier " << fmt
2860 << " \"" << escapeCommand(command) << "\"\n";
2866 // We don't actually delete SpecialisedMover(s) from the
2867 // map, just clear their 'command', so there's no need
2868 // to test for anything else.
2875 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2877 // Why the switch you might ask. It is a trick to ensure that all
2878 // the elements in the LyXRCTags enum is handled. As you can see
2879 // there are no breaks at all. So it is just a huge fall-through.
2880 // The nice thing is that we will get a warning from the compiler
2881 // if we forget an element.
2882 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2884 case LyXRC::RC_LAST:
2885 case LyXRC::RC_ACCEPT_COMPOUND:
2886 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2887 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2888 case LyXRC::RC_ALT_LANG:
2889 case LyXRC::RC_PLAINTEXT_LINELEN:
2890 case LyXRC::RC_AUTOCORRECTION_MATH:
2891 case LyXRC::RC_AUTOREGIONDELETE:
2892 case LyXRC::RC_AUTORESET_OPTIONS:
2893 case LyXRC::RC_AUTOSAVE:
2894 case LyXRC::RC_AUTO_NUMBER:
2895 case LyXRC::RC_BACKUPDIR_PATH:
2896 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2897 case LyXRC::RC_BIBTEX_COMMAND:
2898 case LyXRC::RC_BINDFILE:
2899 case LyXRC::RC_CHECKLASTFILES:
2900 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2901 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2902 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2903 case LyXRC::RC_COMPLETION_INLINE_MATH:
2904 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2905 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2906 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2907 case LyXRC::RC_COMPLETION_POPUP_MATH:
2908 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2909 case LyXRC::RC_COMPLETION_MINLENGTH:
2910 case LyXRC::RC_USELASTFILEPOS:
2911 case LyXRC::RC_LOADSESSION:
2912 case LyXRC::RC_CHKTEX_COMMAND:
2913 case LyXRC::RC_CONVERTER:
2914 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2915 case LyXRC::RC_COPIER:
2916 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2917 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2918 case LyXRC::RC_DATE_INSERT_FORMAT:
2919 case LyXRC::RC_DEFAULT_LANGUAGE:
2920 case LyXRC::RC_GUI_LANGUAGE:
2921 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2922 case LyXRC::RC_DEFFILE:
2923 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2924 case LyXRC::RC_DISPLAY_GRAPHICS:
2925 case LyXRC::RC_DOCUMENTPATH:
2926 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2927 FileName path(lyxrc_new.document_path);
2928 if (path.exists() && path.isDirectory())
2929 package().document_dir() = FileName(lyxrc.document_path);
2931 case LyXRC::RC_EDITOR_ALTERNATIVES:
2932 case LyXRC::RC_ESC_CHARS:
2933 case LyXRC::RC_EXAMPLEPATH:
2934 case LyXRC::RC_FONT_ENCODING:
2935 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2936 case LyXRC::RC_FILEFORMAT:
2937 case LyXRC::RC_GROUP_LAYOUTS:
2938 case LyXRC::RC_HUNSPELLDIR_PATH:
2939 case LyXRC::RC_ICON_SET:
2940 case LyXRC::RC_INDEX_ALTERNATIVES:
2941 case LyXRC::RC_INDEX_COMMAND:
2942 case LyXRC::RC_JBIBTEX_COMMAND:
2943 case LyXRC::RC_JINDEX_COMMAND:
2944 case LyXRC::RC_NOMENCL_COMMAND:
2945 case LyXRC::RC_INPUT:
2946 case LyXRC::RC_KBMAP:
2947 case LyXRC::RC_KBMAP_PRIMARY:
2948 case LyXRC::RC_KBMAP_SECONDARY:
2949 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2950 case LyXRC::RC_LANGUAGE_AUTO_END:
2951 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2952 case LyXRC::RC_LANGUAGE_COMMAND_END:
2953 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2954 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2955 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2956 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2957 case LyXRC::RC_LYXRCFORMAT:
2958 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2959 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2960 case LyXRC::RC_MACRO_EDIT_STYLE:
2961 case LyXRC::RC_MAKE_BACKUP:
2962 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2963 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2964 case LyXRC::RC_NUMLASTFILES:
2965 case LyXRC::RC_PARAGRAPH_MARKERS:
2966 case LyXRC::RC_PATH_PREFIX:
2967 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2968 prependEnvPath("PATH", lyxrc_new.path_prefix);
2970 case LyXRC::RC_PREVIEW:
2971 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2972 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2973 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2974 case LyXRC::RC_PRINTCOPIESFLAG:
2975 case LyXRC::RC_PRINTER:
2976 case LyXRC::RC_PRINTEVENPAGEFLAG:
2977 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2978 case LyXRC::RC_PRINTFILEEXTENSION:
2979 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2980 case LyXRC::RC_PRINTODDPAGEFLAG:
2981 case LyXRC::RC_PRINTPAGERANGEFLAG:
2982 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2983 case LyXRC::RC_PRINTPAPERFLAG:
2984 case LyXRC::RC_PRINTREVERSEFLAG:
2985 case LyXRC::RC_PRINTSPOOL_COMMAND:
2986 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2987 case LyXRC::RC_PRINTTOFILE:
2988 case LyXRC::RC_PRINTTOPRINTER:
2989 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2990 case LyXRC::RC_PRINT_COMMAND:
2991 case LyXRC::RC_RTL_SUPPORT:
2992 case LyXRC::RC_SAVE_COMPRESSED:
2993 case LyXRC::RC_SCREEN_DPI:
2994 case LyXRC::RC_SCREEN_FONT_ROMAN:
2995 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2996 case LyXRC::RC_SCREEN_FONT_SANS:
2997 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2998 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2999 case LyXRC::RC_SCREEN_FONT_SIZES:
3000 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3001 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3002 case LyXRC::RC_GEOMETRY_SESSION:
3003 case LyXRC::RC_SCREEN_ZOOM:
3004 case LyXRC::RC_SERVERPIPE:
3005 case LyXRC::RC_SET_COLOR:
3006 case LyXRC::RC_SHOW_BANNER:
3007 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3008 case LyXRC::RC_SPELLCHECKER:
3009 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3011 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3012 case LyXRC::RC_SPELLCHECK_NOTES:
3013 case LyXRC::RC_SPLITINDEX_COMMAND:
3014 case LyXRC::RC_TEMPDIRPATH:
3015 case LyXRC::RC_TEMPLATEPATH:
3016 case LyXRC::RC_TEX_ALLOWS_SPACES:
3017 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3018 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3019 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3021 case LyXRC::RC_TEXINPUTS_PREFIX:
3022 case LyXRC::RC_THESAURUSDIRPATH:
3023 case LyXRC::RC_UIFILE:
3024 case LyXRC::RC_USER_EMAIL:
3025 case LyXRC::RC_USER_NAME:
3026 case LyXRC::RC_USE_CONVERTER_CACHE:
3027 case LyXRC::RC_USE_SYSTEM_COLORS:
3028 case LyXRC::RC_USE_TOOLTIP:
3029 case LyXRC::RC_USE_PIXMAP_CACHE:
3030 case LyXRC::RC_USE_QIMAGE:
3031 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3032 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3033 case LyXRC::RC_SINGLE_INSTANCE:
3034 case LyXRC::RC_SORT_LAYOUTS:
3035 case LyXRC::RC_FULL_SCREEN_LIMIT:
3036 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3037 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3038 case LyXRC::RC_FULL_SCREEN_TABBAR:
3039 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3040 case LyXRC::RC_FULL_SCREEN_WIDTH:
3041 case LyXRC::RC_VISUAL_CURSOR:
3042 case LyXRC::RC_VIEWER:
3043 case LyXRC::RC_VIEWER_ALTERNATIVES:
3044 case LyXRC::RC_FORWARD_SEARCH_DVI:
3045 case LyXRC::RC_FORWARD_SEARCH_PDF:
3046 case LyXRC::RC_EXPORT_OVERWRITE:
3047 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3048 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3049 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3050 case LyXRC::RC_CURSOR_WIDTH:
3057 string const LyXRC::getDescription(LyXRCTags tag)
3062 case RC_ACCEPT_COMPOUND:
3063 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3067 str = _("Specify an alternate language. The default is to use the language of the document.");
3070 case RC_PLAINTEXT_LINELEN:
3071 str = _("The maximum line length of exported plain text/LaTeX/SGML files. If set to 0, paragraphs are output in a single line; if the line length is > 0, paragraphs are separated by a blank line.");
3074 case RC_AUTOREGIONDELETE:
3075 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3078 case RC_AUTORESET_OPTIONS:
3079 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3083 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3086 case RC_AUTO_NUMBER:
3089 case RC_BACKUPDIR_PATH:
3090 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.");
3093 case RC_BIBTEX_COMMAND:
3094 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3097 case RC_JBIBTEX_COMMAND:
3098 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3102 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3105 case RC_CHECKLASTFILES:
3106 str = _("Select to check whether the lastfiles still exist.");
3109 case RC_CHKTEX_COMMAND:
3110 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3119 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3120 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.");
3123 case RC_CURSOR_WIDTH:
3124 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3127 case RC_SCROLL_BELOW_DOCUMENT:
3128 str = _("LyX normally doesn't allow the user to scroll further than the bottom of the document. Set to true if you prefer to scroll the bottom of the document to the top of the screen");
3131 case RC_MAC_DONTSWAP_CTRL_META:
3132 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3135 case RC_MAC_LIKE_WORD_MOVEMENT:
3136 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3139 case RC_SHOW_MACRO_LABEL:
3140 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3143 case RC_DATE_INSERT_FORMAT:
3144 //xgettext:no-c-format
3145 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3149 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3152 case RC_DEFAULT_VIEW_FORMAT:
3153 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3156 case RC_DEFAULT_LANGUAGE:
3157 str = _("New documents will be assigned this language.");
3160 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3161 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3164 case RC_DISPLAY_GRAPHICS:
3165 str = _("Select how LyX will display any graphics.");
3168 case RC_DOCUMENTPATH:
3169 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3173 str = _("Specify additional chars that can be part of a word.");
3176 case RC_EXAMPLEPATH:
3177 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3180 case RC_FONT_ENCODING:
3181 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3184 case RC_FORCE_PAINT_SINGLE_CHAR:
3185 str = _("Disable any kerning and ligatures for text drawing on screen.");
3191 case RC_INDEX_COMMAND:
3192 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\".");
3195 case RC_JINDEX_COMMAND:
3196 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3199 case RC_NOMENCL_COMMAND:
3200 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3207 case RC_KBMAP_PRIMARY:
3208 case RC_KBMAP_SECONDARY:
3209 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.");
3212 case RC_LANGUAGE_AUTO_BEGIN:
3213 str = _("Select if a language switching command is needed at the beginning of the document.");
3216 case RC_LANGUAGE_AUTO_END:
3217 str = _("Select if a language switching command is needed at the end of the document.");
3220 case RC_LANGUAGE_COMMAND_BEGIN:
3221 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.");
3224 case RC_LANGUAGE_COMMAND_END:
3225 str = _("The LaTeX command for changing back to the language of the document.");
3228 case RC_LANGUAGE_COMMAND_LOCAL:
3229 str = _("The LaTeX command for local changing of the language.");
3232 case RC_LANGUAGE_GLOBAL_OPTIONS:
3233 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3236 case RC_LANGUAGE_CUSTOM_PACKAGE:
3237 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3240 case RC_LANGUAGE_PACKAGE_SELECTION:
3241 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3244 case RC_USELASTFILEPOS:
3245 str = _("De-select if you do not want LyX to scroll to saved position.");
3248 case RC_LOADSESSION:
3249 str = _("De-select to prevent loading files opened from the last LyX session.");
3252 case RC_MAKE_BACKUP:
3253 str = _("De-select if you don't want LyX to create backup files.");
3256 case RC_MARK_FOREIGN_LANGUAGE:
3257 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3260 case RC_MOUSE_WHEEL_SPEED:
3261 str = bformat(_("The scrolling speed of the mouse wheel."),
3265 case RC_COMPLETION_POPUP_DELAY:
3266 str = _("The completion popup delay.");
3269 case RC_COMPLETION_POPUP_MATH:
3270 str = _("Select to display the completion popup in math mode.");
3273 case RC_COMPLETION_POPUP_TEXT:
3274 str = _("Select to display the completion popup in text mode.");
3277 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3278 str = _("Show the completion popup without delay after non-unique completion attempt.");
3281 case RC_COMPLETION_POPUP_TEXT:
3282 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3285 case RC_COMPLETION_POPUP_DELAY:
3286 str = _("The inline completion delay.");
3289 case RC_COMPLETION_INLINE_MATH:
3290 str = _("Select to display the inline completion in math mode.");
3293 case RC_COMPLETION_INLINE_TEXT:
3294 str = _("Select to display the inline completion in text mode.");
3297 case RC_COMPLETION_INLINE_DOTS:
3298 str = _("Use \"...\" to shorten long completions.");
3301 case RC_AUTOCORRECTION_MATH:
3302 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3305 case RC_NUMLASTFILES:
3306 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3310 case RC_PATH_PREFIX:
3311 str = _("Specify those directories which should be "
3312 "prepended to the PATH environment variable.\n"
3313 "Use the OS native format.");
3317 str = _("Shows a typeset preview of things such as math");
3320 case RC_PREVIEW_HASHED_LABELS:
3321 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3324 case RC_PREVIEW_SCALE_FACTOR:
3325 str = _("Scale the preview size to suit.");
3328 case RC_PRINTCOLLCOPIESFLAG:
3329 str = _("The option for specifying whether the copies should be collated.");
3332 case RC_PRINTCOPIESFLAG:
3333 str = _("The option for specifying the number of copies to print.");
3337 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3340 case RC_PRINTEVENPAGEFLAG:
3341 str = _("The option to print only even pages.");
3344 case RC_PRINTEXSTRAOPTIONS:
3345 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3348 case RC_PRINTFILEEXTENSION:
3349 str = _("Extension of printer program output file. Usually \".ps\".");
3352 case RC_PRINTLANDSCAPEFLAG:
3353 str = _("The option to print out in landscape.");
3356 case RC_PRINTODDPAGEFLAG:
3357 str = _("The option to print only odd pages.");
3360 case RC_PRINTPAGERANGEFLAG:
3361 str = _("The option for specifying a comma-separated list of pages to print.");
3364 case RC_PRINTPAPERDIMENSIONFLAG:
3365 str = _("Option to specify the dimensions of the print paper.");
3368 case RC_PRINTPAPERFLAG:
3369 str = _("The option to specify paper type.");
3372 case RC_PRINTREVERSEFLAG:
3373 str = _("The option to reverse the order of the pages printed.");
3376 case RC_PRINTSPOOL_COMMAND:
3377 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.");
3380 case RC_PRINTSPOOL_PRINTERPREFIX:
3381 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.");
3384 case RC_PRINTTOFILE:
3385 str = _("Option to pass to the print program to print to a file.");
3388 case RC_PRINTTOPRINTER:
3389 str = _("Option to pass to the print program to print on a specific printer.");
3392 case RC_PRINT_ADAPTOUTPUT:
3393 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3396 case RC_PRINT_COMMAND:
3397 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3400 case RC_RTL_SUPPORT:
3401 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3404 case RC_VISUAL_CURSOR:
3405 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3409 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3412 case RC_SCREEN_FONT_ROMAN:
3413 case RC_SCREEN_FONT_SANS:
3414 case RC_SCREEN_FONT_TYPEWRITER:
3415 str = _("The screen fonts used to display the text while editing.");
3418 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3419 case RC_SCREEN_FONT_SANS_FOUNDRY:
3420 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3423 case RC_SCREEN_FONT_SCALABLE:
3424 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.");
3427 case RC_SCREEN_FONT_SIZES:
3428 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3431 case RC_SCREEN_ZOOM:
3432 //xgettext:no-c-format
3433 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3436 case RC_GEOMETRY_SESSION:
3437 str = _("Allow session manager to save and restore windows geometry.");
3441 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3447 case RC_SHOW_BANNER:
3448 str = _("De-select if you don't want the startup banner.");
3451 case RC_TEMPDIRPATH:
3452 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3455 case RC_THESAURUSDIRPATH:
3456 str = _("This is the place where the files of the thesaurus library reside.");
3459 case RC_TEMPLATEPATH:
3460 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3463 case RC_TEX_ALLOWS_SPACES:
3466 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3469 case RC_TEXINPUTS_PREFIX:
3470 str = _("Specify those directories which should be "
3471 "prepended to the TEXINPUTS environment variable.\n"
3472 "A '.' represents the current document directory. "
3473 "Use the OS native format.");
3477 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3486 case RC_USE_USE_SYSTEM_COLORS:
3487 str = _("Enable use the system colors for some things like main window background and selection.");
3490 case RC_USE_TOOLTIP:
3491 str = _("Enable the automatic appearance of tool tips in the work area.");
3494 case RC_USE_PIXMAP_CACHE:
3495 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3498 case RC_VIEWDVI_PAPEROPTION:
3499 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3514 // The global instance
3517 // The global copy of the system lyxrc entries (everything except preferences)