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 = 9; // spitz: remove \\default_language
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_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
95 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
96 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
97 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
98 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
99 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
100 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
101 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
102 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
103 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
104 { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
105 { "\\format", LyXRC::RC_FILEFORMAT },
106 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
107 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
108 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
109 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
110 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
111 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
112 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
113 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
114 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
115 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
116 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
117 { "\\icon_set", LyXRC::RC_ICON_SET },
118 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
119 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
120 { "\\input", LyXRC::RC_INPUT },
121 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
122 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
123 { "\\kbmap", LyXRC::RC_KBMAP },
124 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
125 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
126 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
127 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
128 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
129 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
130 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
131 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
132 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
133 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
134 { "\\load_session", LyXRC::RC_LOADSESSION },
135 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
136 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
137 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
138 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
139 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
140 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
141 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
142 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
143 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
144 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
145 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
146 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
147 { "\\preview", LyXRC::RC_PREVIEW },
148 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
149 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
150 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
151 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
152 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
153 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
154 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
155 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
156 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
157 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
158 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
159 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
160 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
161 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
162 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
163 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
164 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
165 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
166 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
167 { "\\printer", LyXRC::RC_PRINTER },
168 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
169 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
170 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
171 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
172 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
173 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
174 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
175 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
176 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
177 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
178 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
179 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
180 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
181 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
182 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
183 { "\\set_color", LyXRC::RC_SET_COLOR },
184 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
185 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
186 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
187 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
188 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
189 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
190 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
191 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
192 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
193 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
194 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
195 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
196 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
197 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
198 { "\\ui_file", LyXRC::RC_UIFILE },
199 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
200 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
201 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
202 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
203 // compatibility with versions older than 1.4.0 only
204 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
205 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
206 { "\\user_email", LyXRC::RC_USER_EMAIL },
207 { "\\user_name", LyXRC::RC_USER_NAME },
208 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
209 // compatibility with versions older than 1.4.0 only
210 { "\\viewer", LyXRC::RC_VIEWER},
211 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
212 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
213 { "format", LyXRC::RC_LYXRCFORMAT }
216 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
227 void LyXRC::setDefaults()
231 def_file = "default";
233 // The current document directory
234 texinputs_prefix = ".";
235 // Get printer from the environment. If fail, use default "",
236 // assuming that everything is set up correctly.
237 printer = getEnv("PRINTER");
238 print_adapt_output = false;
239 print_command = "dvips";
240 print_evenpage_flag = "-B";
241 print_oddpage_flag = "-A";
242 print_pagerange_flag = "-pp";
243 print_copies_flag = "-c";
244 print_collcopies_flag = "-C";
245 print_reverse_flag = "-r";
246 print_landscape_flag = "-t landscape";
247 print_to_printer = "-P";
248 print_to_file = "-o ";
249 print_file_extension = ".ps";
250 print_paper_flag = "-t";
251 print_paper_dimension_flag = "-T";
252 document_path.erase();
253 view_dvi_paper_option.erase();
254 default_view_format = "pdf2";
255 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
256 bibtex_command = "bibtex";
258 index_command = "makeindex -c -q";
259 nomencl_command = "makeindex -s nomencl.ist";
261 // Because a screen is typically wider than a piece of paper:
263 allow_geometry_session = true;
264 // Default LaTeX font size:
265 font_sizes[FONT_SIZE_TINY] = "5.0";
266 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
267 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
268 font_sizes[FONT_SIZE_SMALL] = "9.0";
269 font_sizes[FONT_SIZE_NORMAL] = "10.0";
270 font_sizes[FONT_SIZE_LARGE] = "12.0";
271 font_sizes[FONT_SIZE_LARGER] = "14.4";
272 font_sizes[FONT_SIZE_LARGEST] = "17.26";
273 font_sizes[FONT_SIZE_HUGE] = "20.74";
274 font_sizes[FONT_SIZE_HUGER] = "24.88";
275 use_scalable_fonts = true;
276 roman_font_name = "";
278 typewriter_font_name = "";
280 auto_region_delete = true;
281 auto_reset_options = false;
282 plaintext_linelen = 65;
283 mouse_wheel_speed = 1.0;
284 num_lastfiles = maxlastfiles;
285 check_lastfiles = true;
286 use_lastfilepos = true;
287 load_session = false;
289 save_compressed = false;
290 backupdir_path.erase();
291 display_graphics = true;
292 // Spellchecker settings:
293 // FIXME: this check should test the target platform (darwin)
294 #if defined(USE_MACOSX_PACKAGING)
295 spellchecker = "native";
296 #elif defined(USE_ASPELL)
297 spellchecker = "aspell";
298 #elif defined(USE_HUNSPELL)
299 spellchecker = "hunspell";
301 spellchecker = "aspell";
303 spellchecker_accept_compound = false;
304 spellcheck_continuously = false;
305 completion_minlength = 6;
306 spellcheck_notes = true;
309 visual_cursor = false;
311 mark_foreign_language = true;
312 language_auto_begin = true;
313 language_auto_end = true;
314 language_global_options = true;
315 language_package_selection = LP_AUTO;
316 language_custom_package = "\\usepackage{babel}";
317 language_command_begin = "\\selectlanguage{$$lang}";
318 language_command_local = "\\foreignlanguage{$$lang}{";
319 sort_layouts = false;
320 group_layouts = true;
321 gui_language = "auto";
323 windows_style_tex_paths = false;
324 tex_allows_spaces = false;
325 date_insert_format = "%x";
326 cursor_follows_scrollbar = false;
327 scroll_below_document = false;
328 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
329 paragraph_markers = false;
330 mac_dontswap_ctrl_meta = false;
331 mac_like_word_movement = false;
332 macro_edit_style = MACRO_EDIT_INLINE_BOX;
333 dialogs_iconify_with_main = false;
334 preview = PREVIEW_OFF;
335 preview_hashed_labels = false;
336 preview_scale_factor = 1.0;
337 use_converter_cache = true;
338 use_system_colors = false;
340 use_pixmap_cache = false;
342 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
343 user_name = to_utf8(support::user_name());
344 user_email = to_utf8(support::user_email());
345 open_buffers_in_tabs = true;
346 single_close_tab_button = false;
347 single_instance = true;
348 forward_search_dvi = string();
349 forward_search_pdf = string();
350 export_overwrite = NO_FILES;
352 // Fullscreen settings
353 full_screen_limit = false;
354 full_screen_toolbars = true;
355 full_screen_tabbar = true;
356 full_screen_menubar = true;
357 full_screen_scrollbar = true;
358 full_screen_width = 700;
360 completion_cursor_text = true;
361 completion_popup_math = true;
362 completion_popup_text = false;
363 completion_popup_delay = 2.0;
364 completion_popup_after_complete = true;
365 autocorrection_math = false;
366 completion_inline_math = true;
367 completion_inline_text = false;
368 completion_inline_dots = -1;
369 completion_inline_delay = 0.2;
370 default_decimal_point = ".";
371 default_length_unit = Length::CM;
378 void oldFontFormat(string & family, string & foundry)
380 if (family.empty() || family[0] != '-')
382 foundry = token(family, '-', 1);
383 family = token(family, '-', 2);
391 bool LyXRC::read(FileName const & filename, bool check_format)
393 Lexer lexrc(lyxrcTags);
394 lexrc.setFile(filename);
395 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
396 ReturnValues retval = read(lexrc, check_format);
397 if (!check_format || retval != FormatMismatch)
398 return retval == ReadOK;
400 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
401 FileName const tempfile = FileName::tempName("convert_lyxrc");
402 bool const success = prefs2prefs(filename, tempfile, false);
404 LYXERR0 ("Unable to convert " << filename.absFileName() <<
405 " to format " << LYXRC_FILEFORMAT);
408 // Keep this in the else branch, such that lexrc2 goes out
409 // of scope and releases the lock on tempfile before we
410 // attempt to remove it. This matters on Windows.
411 Lexer lexrc2(lyxrcTags);
412 lexrc2.setFile(tempfile);
413 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
414 retval = read(lexrc2, check_format);
416 tempfile.removeFile();
417 return retval == ReadOK;
421 // don't need to worry about conversion, because this is always
422 // from an internal source
423 bool LyXRC::read(istream & is)
425 Lexer lexrc(lyxrcTags);
427 LYXERR(Debug::LYXRC, "Reading istream...");
428 return read(lexrc, false) == ReadOK;
432 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
434 if (lyxerr.debugging(Debug::PARSER))
435 lexrc.printTable(lyxerr);
440 // default for current rowpainter capabilities
441 force_paint_single_char = true;
443 // format prior to 2.0 and introduction of format tag
444 unsigned int format = 0;
446 while (lexrc.isOK()) {
447 // By using two switches we take advantage of the compiler
448 // telling us if we have missed a LyXRCTags element in
449 // the second switch.
450 // Note that this also shows a problem with Lexer since it
451 // helps us avoid taking advantage of the strictness of the
454 int le = lexrc.lex();
456 case Lexer::LEX_UNDEF:
457 lexrc.printError("Unknown tag `$$Token'");
459 case Lexer::LEX_FEOF:
464 switch (static_cast<LyXRCTags>(le)) {
467 format = lexrc.getInteger();
469 case RC_INPUT: // Include file
472 libFileSearch(string(),
474 if (read(tmp, check_format)) {
476 "Error reading included file: " + tmp.absFileName());
482 bind_file = os::internal_path(lexrc.getString());
487 def_file = os::internal_path(lexrc.getString());
492 ui_file = os::internal_path(lexrc.getString());
495 case RC_AUTORESET_OPTIONS:
496 lexrc >> auto_reset_options;
499 case RC_DISPLAY_GRAPHICS:
501 display_graphics = lexrc.getString() == "true";
504 case RC_TEX_EXPECTS_WINDOWS_PATHS:
505 lexrc >> windows_style_tex_paths;
508 case RC_TEX_ALLOWS_SPACES:
509 lexrc >> tex_allows_spaces;
512 case RC_TEXINPUTS_PREFIX:
513 lexrc >> texinputs_prefix;
520 case RC_KBMAP_PRIMARY:
522 string const kmap(os::internal_path(lexrc.getString()));
523 if (!libFileSearch("kbd", kmap, "kmap").empty()
525 primary_kbmap = kmap;
527 lexrc.printError("LyX: Keymap `$$Token' not found");
532 case RC_KBMAP_SECONDARY:
534 string const kmap(os::internal_path(lexrc.getString()));
535 if (!libFileSearch("kbd", kmap, "kmap").empty()
537 secondary_kbmap = kmap;
539 lexrc.printError("LyX: Keymap `$$Token' not found");
544 case RC_FONT_ENCODING:
548 case RC_FORCE_PAINT_SINGLE_CHAR:
549 lexrc >> force_paint_single_char;
556 case RC_PRINT_COMMAND:
557 if (lexrc.next(true)) {
558 print_command = lexrc.getString();
562 case RC_PRINTEVENPAGEFLAG:
563 lexrc >> print_evenpage_flag;
566 case RC_PRINTODDPAGEFLAG:
567 lexrc >> print_oddpage_flag;
570 case RC_PRINTPAGERANGEFLAG:
571 lexrc >> print_pagerange_flag;
574 case RC_PRINTCOPIESFLAG:
575 lexrc >> print_copies_flag;
578 case RC_PRINTCOLLCOPIESFLAG:
579 lexrc >> print_collcopies_flag;
582 case RC_PRINTREVERSEFLAG:
583 lexrc >> print_reverse_flag;
586 case RC_PRINTLANDSCAPEFLAG:
587 lexrc >> print_landscape_flag;
590 case RC_PRINTTOPRINTER:
591 lexrc >> print_to_printer;
594 case RC_PRINT_ADAPTOUTPUT:
595 lexrc >> print_adapt_output;
600 print_to_file = os::internal_path(lexrc.getString());
604 case RC_PRINTFILEEXTENSION:
605 lexrc >> print_file_extension;
608 case RC_PRINTEXSTRAOPTIONS:
609 lexrc >> print_extra_options;
612 case RC_PRINTSPOOL_COMMAND:
613 if (lexrc.next(true)) {
614 print_spool_command = lexrc.getString();
618 case RC_PRINTSPOOL_PRINTERPREFIX:
619 lexrc >> print_spool_printerprefix;
622 case RC_PRINTPAPERDIMENSIONFLAG:
623 lexrc >> print_paper_dimension_flag;
626 case RC_PRINTPAPERFLAG:
627 lexrc >> print_paper_flag;
630 case RC_VIEWDVI_PAPEROPTION:
632 view_dvi_paper_option = lexrc.getString();
634 view_dvi_paper_option.erase();
637 case RC_CHKTEX_COMMAND:
638 if (lexrc.next(true)) {
639 chktex_command = lexrc.getString();
643 case RC_BIBTEX_ALTERNATIVES:
644 if (lexrc.next(true)) {
645 bibtex_alternatives.insert(lexrc.getString());
649 case RC_BIBTEX_COMMAND:
650 if (lexrc.next(true)) {
651 bibtex_command = lexrc.getString();
655 case RC_JBIBTEX_COMMAND:
656 if (lexrc.next(true)) {
657 jbibtex_command = lexrc.getString();
661 case RC_INDEX_ALTERNATIVES:
662 if (lexrc.next(true)) {
663 index_alternatives.insert(lexrc.getString());
667 case RC_INDEX_COMMAND:
668 if (lexrc.next(true)) {
669 index_command = lexrc.getString();
673 case RC_JINDEX_COMMAND:
674 if (lexrc.next(true)) {
675 jindex_command = lexrc.getString();
679 case RC_SPLITINDEX_COMMAND:
680 if (lexrc.next(true)) {
681 splitindex_command = lexrc.getString();
685 case RC_NOMENCL_COMMAND:
686 if (lexrc.next(true)) {
687 nomencl_command = lexrc.getString();
699 case RC_GEOMETRY_SESSION:
700 lexrc >> allow_geometry_session;
703 case RC_SCREEN_FONT_SIZES:
704 lexrc >> font_sizes[FONT_SIZE_TINY];
705 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
706 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
707 lexrc >> font_sizes[FONT_SIZE_SMALL];
708 lexrc >> font_sizes[FONT_SIZE_NORMAL];
709 lexrc >> font_sizes[FONT_SIZE_LARGE];
710 lexrc >> font_sizes[FONT_SIZE_LARGER];
711 lexrc >> font_sizes[FONT_SIZE_LARGEST];
712 lexrc >> font_sizes[FONT_SIZE_HUGE];
713 lexrc >> font_sizes[FONT_SIZE_HUGER];
716 case RC_SCREEN_FONT_SCALABLE:
717 lexrc >> use_scalable_fonts;
724 case RC_DOCUMENTPATH:
726 document_path = os::internal_path(lexrc.getString());
727 document_path = expandPath(document_path);
733 example_path = os::internal_path(lexrc.getString());
734 example_path = expandPath(example_path);
738 case RC_TEMPLATEPATH:
740 template_path = os::internal_path(lexrc.getString());
741 template_path = expandPath(template_path);
747 tempdir_path = os::internal_path(lexrc.getString());
748 tempdir_path = expandPath(tempdir_path);
752 case RC_THESAURUSDIRPATH:
754 thesaurusdir_path = os::internal_path(lexrc.getString());
755 thesaurusdir_path = expandPath(thesaurusdir_path);
759 case RC_HUNSPELLDIR_PATH:
761 hunspelldir_path = os::internal_path(lexrc.getString());
762 hunspelldir_path = expandPath(hunspelldir_path);
766 case RC_USELASTFILEPOS:
767 lexrc >> use_lastfilepos;
771 lexrc >> load_session;
774 case RC_MOUSE_WHEEL_SPEED:
775 lexrc >> mouse_wheel_speed;
778 case RC_COMPLETION_INLINE_DELAY:
779 lexrc >> completion_inline_delay;
782 case RC_COMPLETION_INLINE_MATH:
783 lexrc >> completion_inline_math;
786 case RC_COMPLETION_INLINE_TEXT:
787 lexrc >> completion_inline_text;
790 case RC_COMPLETION_INLINE_DOTS:
791 lexrc >> completion_inline_dots;
794 case RC_AUTOCORRECTION_MATH:
795 lexrc >> autocorrection_math;
798 case RC_COMPLETION_POPUP_DELAY:
799 lexrc >> completion_popup_delay;
802 case RC_COMPLETION_POPUP_MATH:
803 lexrc >> completion_popup_math;
806 case RC_COMPLETION_POPUP_TEXT:
807 lexrc >> completion_popup_text;
810 case RC_COMPLETION_CURSOR_TEXT:
811 lexrc >> completion_cursor_text;
814 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
815 lexrc >> completion_popup_after_complete;
818 case RC_COMPLETION_MINLENGTH:
819 lexrc >> completion_minlength;
822 case RC_NUMLASTFILES:
823 lexrc >> num_lastfiles;
826 case RC_CHECKLASTFILES:
827 lexrc >> check_lastfiles;
834 case RC_SCREEN_FONT_ROMAN:
836 roman_font_name = lexrc.getString();
837 oldFontFormat(roman_font_name,
842 case RC_SCREEN_FONT_SANS:
844 sans_font_name = lexrc.getString();
845 oldFontFormat(sans_font_name, sans_font_foundry);
849 case RC_SCREEN_FONT_TYPEWRITER:
851 typewriter_font_name = lexrc.getString();
852 oldFontFormat(typewriter_font_name,
853 typewriter_font_foundry);
857 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
858 lexrc >> roman_font_foundry;
861 case RC_SCREEN_FONT_SANS_FOUNDRY:
862 lexrc >> sans_font_foundry;
865 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
866 lexrc >> typewriter_font_foundry;
871 lexrc.printError("Missing color tag.");
874 string lyx_name = lexrc.getString();
877 lexrc.printError("Missing color name for color: `$$Token'");
880 string x11_name = lexrc.getString();
882 ColorCode const col =
883 lcolor.getFromLyXName(lyx_name);
884 if (col == Color_none ||
885 col == Color_inherit ||
889 if (!lcolor.setColor(col, x11_name))
890 LYXERR0("Bad lyxrc set_color for " << lyx_name);
894 case RC_AUTOREGIONDELETE:
895 // Auto region delete defaults to true
896 lexrc >> auto_region_delete;
901 lyxpipes = os::internal_path(lexrc.getString());
902 lyxpipes = expandPath(lyxpipes);
906 case RC_CURSOR_FOLLOWS_SCROLLBAR:
907 lexrc >> cursor_follows_scrollbar;
910 case RC_CURSOR_WIDTH:
911 lexrc >> cursor_width;
914 case RC_SCROLL_BELOW_DOCUMENT:
915 lexrc >> scroll_below_document;
918 case RC_PARAGRAPH_MARKERS:
919 lexrc >> paragraph_markers;
922 case RC_MAC_DONTSWAP_CTRL_META:
923 lexrc >> mac_dontswap_ctrl_meta;
926 case RC_MAC_LIKE_WORD_MOVEMENT:
927 lexrc >> mac_like_word_movement;
930 case RC_MACRO_EDIT_STYLE:
932 switch (lexrc.getInteger()) {
933 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
934 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
935 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
940 case RC_DIALOGS_ICONIFY_WITH_MAIN:
941 lexrc >> dialogs_iconify_with_main;
944 case RC_PLAINTEXT_LINELEN:
945 lexrc >> plaintext_linelen;
947 // Spellchecker settings:
948 case RC_ACCEPT_COMPOUND:
949 lexrc >> spellchecker_accept_compound;
951 case RC_USE_SYSTEM_COLORS:
952 lexrc >> use_system_colors;
955 lexrc >> use_tooltip;
957 case RC_USE_PIXMAP_CACHE:
958 lexrc >> use_pixmap_cache;
963 case RC_SPELLCHECKER:
964 lexrc >> spellchecker;
967 lexrc >> spellchecker_alt_lang;
970 lexrc >> spellchecker_esc_chars;
972 case RC_SPELLCHECK_CONTINUOUSLY:
973 lexrc >> spellcheck_continuously;
975 case RC_SPELLCHECK_NOTES:
976 lexrc >> spellcheck_notes;
979 lexrc >> make_backup;
981 case RC_SAVE_COMPRESSED:
982 lexrc >> save_compressed;
984 case RC_BACKUPDIR_PATH:
986 backupdir_path = os::internal_path(lexrc.getString());
987 backupdir_path = expandPath(backupdir_path);
990 case RC_DEFAULT_DECIMAL_POINT:
991 lexrc >> default_decimal_point;
993 case RC_DEFAULT_LENGTH_UNIT:
995 default_length_unit = (Length::UNIT) lexrc.getInteger();
997 case RC_DATE_INSERT_FORMAT:
998 lexrc >> date_insert_format;
1000 case RC_LANGUAGE_CUSTOM_PACKAGE:
1001 lexrc >> language_custom_package;
1003 case RC_LANGUAGE_AUTO_BEGIN:
1004 lexrc >> language_auto_begin;
1006 case RC_LANGUAGE_AUTO_END:
1007 lexrc >> language_auto_end;
1009 case RC_LANGUAGE_GLOBAL_OPTIONS:
1010 lexrc >> language_global_options;
1012 case RC_LANGUAGE_PACKAGE_SELECTION:
1014 switch (lexrc.getInteger()) {
1016 language_package_selection = LP_AUTO;
1019 language_package_selection = LP_BABEL;
1022 language_package_selection = LP_CUSTOM;
1025 language_package_selection = LP_NONE;
1030 case RC_LANGUAGE_COMMAND_BEGIN:
1031 lexrc >> language_command_begin;
1033 case RC_LANGUAGE_COMMAND_END:
1034 lexrc >> language_command_end;
1036 case RC_LANGUAGE_COMMAND_LOCAL:
1037 lexrc >> language_command_local;
1039 case RC_RTL_SUPPORT:
1040 lexrc >> rtl_support;
1042 case RC_VISUAL_CURSOR:
1043 lexrc >> visual_cursor;
1045 case RC_AUTO_NUMBER:
1046 lexrc >> auto_number;
1048 case RC_MARK_FOREIGN_LANGUAGE:
1049 lexrc >> mark_foreign_language;
1053 string fmt, command;
1055 fmt = lexrc.getString();
1056 if (lexrc.next(true))
1057 command = lexrc.getString();
1058 setMover(fmt, command);
1062 case RC_CONVERTER: {
1063 string from, to, command, flags;
1065 from = lexrc.getString();
1067 to = lexrc.getString();
1068 if (lexrc.next(true))
1069 command = lexrc.getString();
1071 flags = lexrc.getString();
1072 if (command.empty())
1073 theConverters().erase(from, to);
1075 theConverters().add(from, to, command, flags);
1078 // compatibility with versions older than 1.4.0 only
1080 string format, command;
1081 lexrc >> format >> command;
1082 formats.setViewer(format, command);
1085 case RC_FILEFORMAT: {
1087 string format, extensions, prettyname, shortcut;
1088 if (!(lexrc >> format >> extensions))
1090 if (ok && lexrc.next(true))
1091 prettyname = lexrc.getString();
1095 if(!(lexrc >> shortcut))
1097 string viewer, editor;
1098 if (ok && lexrc.next(true))
1099 viewer = lexrc.getString();
1102 if (ok && lexrc.next(true))
1103 editor = lexrc.getString();
1107 if (!(lexrc >> flags >> mime))
1109 int flgs = Format::none;
1110 while (!flags.empty()) {
1112 flags = split(flags, flag, ',');
1113 if (flag == "document")
1114 flgs |= Format::document;
1115 else if (flag == "vector")
1116 flgs |= Format::vector;
1117 else if (flag == "zipped=native")
1118 flgs |= Format::zipped_native;
1119 else if (flag == "menu=export")
1120 flgs |= Format::export_menu;
1122 LYXERR0("Ignoring unknown flag `"
1123 << flag << "' for format `"
1127 LYXERR0("Syntax error in format " << format);
1128 else if (prettyname.empty()) {
1129 if (theConverters().formatIsUsed(format))
1130 LYXERR0("Can't delete format " << format);
1132 formats.erase(format);
1134 formats.add(format, extensions, prettyname,
1135 shortcut, viewer, editor, mime, flgs);
1139 case RC_VIEWER_ALTERNATIVES: {
1140 string format, command;
1142 format = lexrc.getString();
1143 if (lexrc.eatLine())
1144 command = lexrc.getString();
1145 viewer_alternatives[format].insert(command);
1148 case RC_EDITOR_ALTERNATIVES: {
1149 string format, command;
1151 format = lexrc.getString();
1152 if (lexrc.eatLine())
1153 command = lexrc.getString();
1154 editor_alternatives[format].insert(command);
1158 case RC_DEFAULT_VIEW_FORMAT:
1159 lexrc >> default_view_format;
1162 case RC_GUI_LANGUAGE:
1163 lexrc >> gui_language;
1166 case RC_SHOW_BANNER:
1167 lexrc >> show_banner;
1172 string const tmp = lexrc.getString();
1173 if (tmp == "true" || tmp == "on")
1174 preview = PREVIEW_ON;
1175 else if (tmp == "no_math")
1176 preview = PREVIEW_NO_MATH;
1178 preview = PREVIEW_OFF;
1179 if (tmp != "false" && tmp != "off")
1180 LYXERR0("Unrecognized preview status \""
1186 case RC_PREVIEW_HASHED_LABELS:
1187 lexrc >> preview_hashed_labels;
1190 case RC_PREVIEW_SCALE_FACTOR:
1191 lexrc >> preview_scale_factor;
1198 lexrc >> user_email;
1201 case RC_PATH_PREFIX:
1202 lexrc >> path_prefix;
1205 case RC_USE_CONVERTER_CACHE:
1206 lexrc >> use_converter_cache;
1208 case RC_CONVERTER_CACHE_MAXAGE:
1209 lexrc >> converter_cache_maxage;
1212 case RC_SORT_LAYOUTS:
1213 lexrc >> sort_layouts;
1215 case RC_GROUP_LAYOUTS:
1216 lexrc >> group_layouts;
1218 case RC_FULL_SCREEN_LIMIT:
1219 lexrc >> full_screen_limit;
1221 case RC_FULL_SCREEN_TOOLBARS:
1222 lexrc >> full_screen_toolbars;
1224 case RC_FULL_SCREEN_SCROLLBAR:
1225 lexrc >> full_screen_scrollbar;
1227 case RC_FULL_SCREEN_TABBAR:
1228 lexrc >> full_screen_tabbar;
1230 case RC_FULL_SCREEN_MENUBAR:
1231 lexrc >> full_screen_menubar;
1233 case RC_FULL_SCREEN_WIDTH:
1234 lexrc >> full_screen_width;
1236 case RC_OPEN_BUFFERS_IN_TABS:
1237 lexrc >> open_buffers_in_tabs;
1239 case RC_SINGLE_CLOSE_TAB_BUTTON:
1240 lexrc >> single_close_tab_button;
1242 case RC_SINGLE_INSTANCE:
1243 lexrc >> single_instance;
1244 if (run_mode == PREFERRED)
1245 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1247 case RC_FORWARD_SEARCH_DVI:
1248 if (lexrc.next(true))
1249 forward_search_dvi = lexrc.getString();
1251 case RC_FORWARD_SEARCH_PDF:
1252 if (lexrc.next(true))
1253 forward_search_pdf = lexrc.getString();
1255 case RC_EXPORT_OVERWRITE:
1257 string const tmp = lexrc.getString();
1258 if (tmp == "all" || tmp == "true")
1259 export_overwrite = ALL_FILES;
1260 else if (tmp == "main")
1261 export_overwrite = MAIN_FILE;
1263 export_overwrite = NO_FILES;
1264 if (tmp != "ask" && tmp != "false")
1265 LYXERR0("Unrecognized export_overwrite status \""
1270 case RC_SCROLL_WHEEL_ZOOM:
1272 string const tmp = lexrc.getString();
1274 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1275 else if (tmp == "shift")
1276 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1277 else if (tmp == "alt")
1278 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1280 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1281 if (tmp != "off" && tmp != "false")
1282 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1289 break; // this is just a dummy
1292 // This is triggered the first time through the loop unless
1293 // we hit a format tag.
1294 if (check_format && format != LYXRC_FILEFORMAT)
1295 return FormatMismatch;
1298 /// Update converters data-structures
1299 theConverters().update(formats);
1300 theConverters().buildGraph();
1306 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1308 ofstream ofs(filename.toFilesystemEncoding().c_str());
1310 write(ofs, ignore_system_lyxrc);
1314 void LyXRC::print() const
1316 if (lyxerr.debugging())
1317 write(lyxerr, false);
1325 typedef pair<string, SpecialisedMover> Data;
1327 SameMover(Data const & comparison)
1328 : comparison_(comparison) {}
1330 bool operator()(Data const & data) const
1332 return data.first == comparison_.first &&
1333 data.second.command() == comparison_.second.command();
1343 // Escape \ and " so that LyXLex can read the string later
1344 string escapeCommand(string const & str) {
1345 return subst(subst(str , "\\", "\\\\"),
1352 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1354 LyXRCTags tag = RC_LAST;
1356 if (!name.empty()) {
1357 for (int i = 0; i != lyxrcCount; ++i)
1358 if ("\\" + name == lyxrcTags[i].tag)
1359 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1363 os << "# LyX " << lyx_version
1364 << " generated this file. If you want to make your own\n"
1365 << "# modifications you should do them from inside LyX and save.\n\n"
1366 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1368 // Why the switch you might ask. It is a trick to ensure that all
1369 // the elements in the LyXRCTags enum are handled. As you can see
1370 // there are no breaks at all. So it is just a huge fall-through.
1371 // The nice thing is that we will get a warning from the compiler
1372 // if we forget an element.
1376 // input/include files are not done here
1377 case RC_LYXRCFORMAT:
1379 if (ignore_system_lyxrc ||
1380 bind_file != system_lyxrc.bind_file) {
1381 string const path = os::external_path(bind_file);
1382 os << "\\bind_file \"" << path << "\"\n";
1388 if (ignore_system_lyxrc ||
1389 def_file != system_lyxrc.def_file) {
1390 string const path = os::external_path(def_file);
1391 os << "\\def_file \"" << path << "\"\n";
1400 << "# MISC SECTION ######################################\n"
1402 // bind files are not done here.
1404 case RC_PATH_PREFIX:
1405 if (ignore_system_lyxrc ||
1406 path_prefix != system_lyxrc.path_prefix) {
1407 os << "\\path_prefix \"" << path_prefix << "\"\n";
1412 if (ignore_system_lyxrc ||
1413 ui_file != system_lyxrc.ui_file) {
1414 string const path = os::external_path(ui_file);
1415 os << "\\ui_file \"" << path << "\"\n";
1419 case RC_AUTOREGIONDELETE:
1420 if (ignore_system_lyxrc ||
1421 auto_region_delete != system_lyxrc.auto_region_delete) {
1422 os << "# Set to false to inhibit automatic replacement of\n"
1423 << "# the current selection.\n"
1424 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1429 case RC_AUTORESET_OPTIONS:
1430 if (ignore_system_lyxrc ||
1431 auto_reset_options != system_lyxrc.auto_reset_options) {
1432 os << "# Set to false to inhibit automatic reset of\n"
1433 << "# the class options to defaults on class change.\n"
1434 << "\\auto_reset_options "
1435 << convert<string>(auto_reset_options)
1441 if (ignore_system_lyxrc ||
1442 autosave != system_lyxrc.autosave) {
1443 os << "# The time interval between auto-saves in seconds.\n"
1444 << "\\autosave " << autosave << '\n';
1448 case RC_DISPLAY_GRAPHICS:
1449 if (ignore_system_lyxrc ||
1450 display_graphics != system_lyxrc.display_graphics) {
1451 os << "# Display graphics within LyX\n"
1453 << "\\display_graphics "
1454 << (display_graphics ? "true" : "false")
1459 case RC_SORT_LAYOUTS:
1460 if (ignore_system_lyxrc ||
1461 sort_layouts != system_lyxrc.sort_layouts) {
1462 os << "# Sort layouts alphabetically.\n"
1463 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1467 case RC_GROUP_LAYOUTS:
1468 if (ignore_system_lyxrc ||
1469 group_layouts != system_lyxrc.group_layouts) {
1470 os << "# Group layouts by their category.\n"
1471 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1475 case RC_VIEWDVI_PAPEROPTION:
1476 if (ignore_system_lyxrc ||
1477 view_dvi_paper_option
1478 != system_lyxrc.view_dvi_paper_option) {
1479 os << "# Options used to specify paper size to the\n"
1480 << "# view_dvi_command (e.g. -paper)\n"
1481 << "\\view_dvi_paper_option \""
1482 << view_dvi_paper_option << "\"\n";
1486 case RC_CHKTEX_COMMAND:
1487 if (ignore_system_lyxrc ||
1488 chktex_command != system_lyxrc.chktex_command) {
1489 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1493 case RC_BIBTEX_ALTERNATIVES: {
1494 CommandSet::const_iterator it = bibtex_alternatives.begin();
1495 CommandSet::const_iterator end = bibtex_alternatives.end();
1496 for ( ; it != end; ++it) {
1497 if (ignore_system_lyxrc
1498 || !system_lyxrc.bibtex_alternatives.count(*it))
1499 os << "\\bibtex_alternatives \""
1505 case RC_BIBTEX_COMMAND:
1506 if (ignore_system_lyxrc ||
1507 bibtex_command != system_lyxrc.bibtex_command) {
1508 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1512 case RC_JBIBTEX_COMMAND:
1513 if (ignore_system_lyxrc ||
1514 jbibtex_command != system_lyxrc.jbibtex_command) {
1515 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1519 case RC_INDEX_ALTERNATIVES: {
1520 CommandSet::const_iterator it = index_alternatives.begin();
1521 CommandSet::const_iterator end = index_alternatives.end();
1522 for ( ; it != end; ++it) {
1523 if (ignore_system_lyxrc
1524 || !system_lyxrc.index_alternatives.count(*it))
1525 os << "\\index_alternatives \""
1531 case RC_INDEX_COMMAND:
1532 if (ignore_system_lyxrc ||
1533 index_command != system_lyxrc.index_command) {
1534 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1538 case RC_JINDEX_COMMAND:
1539 if (ignore_system_lyxrc ||
1540 jindex_command != system_lyxrc.jindex_command) {
1541 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1545 case RC_SPLITINDEX_COMMAND:
1546 if (ignore_system_lyxrc ||
1547 splitindex_command != system_lyxrc.splitindex_command) {
1548 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1552 case RC_NOMENCL_COMMAND:
1553 if (ignore_system_lyxrc ||
1554 nomencl_command != system_lyxrc.nomencl_command) {
1555 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1559 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1560 // Don't write this setting to the preferences file,
1561 // but allow temporary changes (bug 7557).
1562 if (ignore_system_lyxrc) {
1563 os << "\\tex_expects_windows_paths "
1564 << convert<string>(windows_style_tex_paths) << '\n';
1568 case RC_TEX_ALLOWS_SPACES:
1569 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1570 os << "\\tex_allows_spaces "
1571 << convert<string>(tex_allows_spaces) << '\n';
1576 if (ignore_system_lyxrc ||
1577 use_kbmap != system_lyxrc.use_kbmap) {
1578 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1582 case RC_KBMAP_PRIMARY:
1583 if (ignore_system_lyxrc ||
1584 primary_kbmap != system_lyxrc.primary_kbmap) {
1585 string const path = os::external_path(primary_kbmap);
1586 os << "\\kbmap_primary \"" << path << "\"\n";
1590 case RC_KBMAP_SECONDARY:
1591 if (ignore_system_lyxrc ||
1592 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1593 string const path = os::external_path(secondary_kbmap);
1594 os << "\\kbmap_secondary \"" << path << "\"\n";
1599 if (ignore_system_lyxrc ||
1600 lyxpipes != system_lyxrc.lyxpipes) {
1601 string const path = os::external_path(lyxpipes);
1602 os << "\\serverpipe \"" << path << "\"\n";
1606 case RC_DATE_INSERT_FORMAT:
1607 if (ignore_system_lyxrc ||
1608 date_insert_format != system_lyxrc.date_insert_format) {
1609 os << "\\date_insert_format \"" << date_insert_format
1616 os << "\\user_name \"" << user_name << "\"\n";
1621 os << "\\user_email \"" << user_email << "\"\n";
1625 case RC_SHOW_BANNER:
1626 if (ignore_system_lyxrc ||
1627 show_banner != system_lyxrc.show_banner) {
1628 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1634 if (ignore_system_lyxrc ||
1635 preview != system_lyxrc.preview) {
1641 case PREVIEW_NO_MATH:
1648 os << "\\preview " << status << '\n';
1653 case RC_PREVIEW_HASHED_LABELS:
1654 if (ignore_system_lyxrc ||
1655 preview_hashed_labels !=
1656 system_lyxrc.preview_hashed_labels) {
1657 os << "\\preview_hashed_labels "
1658 << convert<string>(preview_hashed_labels) << '\n';
1663 case RC_PREVIEW_SCALE_FACTOR:
1664 if (ignore_system_lyxrc ||
1665 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1666 os << "\\preview_scale_factor "
1667 << preview_scale_factor << '\n';
1672 case RC_USE_CONVERTER_CACHE:
1673 if (ignore_system_lyxrc ||
1674 use_converter_cache != system_lyxrc.use_converter_cache) {
1675 os << "\\use_converter_cache "
1676 << convert<string>(use_converter_cache) << '\n';
1681 case RC_CONVERTER_CACHE_MAXAGE:
1682 if (ignore_system_lyxrc ||
1683 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1684 os << "\\converter_cache_maxage "
1685 << converter_cache_maxage << '\n';
1691 << "# SCREEN & FONTS SECTION ############################\n"
1695 if (ignore_system_lyxrc ||
1696 icon_set != system_lyxrc.icon_set) {
1697 os << "\\icon_set \"" << icon_set
1704 if (ignore_system_lyxrc ||
1705 dpi != system_lyxrc.dpi) {
1706 os << "\\screen_dpi " << dpi << '\n';
1710 case RC_SCREEN_ZOOM:
1711 if (ignore_system_lyxrc ||
1712 zoom != system_lyxrc.zoom) {
1713 os << "\\screen_zoom " << zoom << '\n';
1717 case RC_GEOMETRY_SESSION:
1718 if (ignore_system_lyxrc ||
1719 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1720 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1725 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1726 if (ignore_system_lyxrc ||
1727 cursor_follows_scrollbar
1728 != system_lyxrc.cursor_follows_scrollbar) {
1729 os << "\\cursor_follows_scrollbar "
1730 << convert<string>(cursor_follows_scrollbar) << '\n';
1734 case RC_CURSOR_WIDTH:
1735 if (ignore_system_lyxrc ||
1737 != system_lyxrc.cursor_width) {
1738 os << "\\cursor_width "
1739 << cursor_width << '\n';
1743 case RC_SCROLL_BELOW_DOCUMENT:
1744 if (ignore_system_lyxrc ||
1745 scroll_below_document
1746 != system_lyxrc.scroll_below_document) {
1747 os << "\\scroll_below_document "
1748 << convert<string>(scroll_below_document) << '\n';
1752 case RC_PARAGRAPH_MARKERS:
1753 if (ignore_system_lyxrc ||
1755 != system_lyxrc.paragraph_markers) {
1756 os << "\\paragraph_markers "
1757 << convert<string>(paragraph_markers) << '\n';
1761 case RC_MAC_DONTSWAP_CTRL_META:
1762 if (ignore_system_lyxrc ||
1763 mac_dontswap_ctrl_meta
1764 != system_lyxrc.mac_dontswap_ctrl_meta) {
1765 os << "\\mac_dontswap_ctrl_meta "
1766 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1770 case RC_MAC_LIKE_WORD_MOVEMENT:
1771 if (ignore_system_lyxrc ||
1772 mac_like_word_movement
1773 != system_lyxrc.mac_like_word_movement) {
1774 os << "\\mac_like_word_movement "
1775 << convert<string>(mac_like_word_movement) << '\n';
1779 case RC_MACRO_EDIT_STYLE:
1780 if (ignore_system_lyxrc ||
1782 != system_lyxrc.macro_edit_style) {
1783 os << "\\macro_edit_style ";
1784 switch (macro_edit_style) {
1785 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1786 case MACRO_EDIT_INLINE: os << "1\n"; break;
1787 case MACRO_EDIT_LIST: os << "2\n"; break;
1792 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1793 if (ignore_system_lyxrc ||
1794 dialogs_iconify_with_main
1795 != system_lyxrc.dialogs_iconify_with_main) {
1796 os << "\\dialogs_iconify_with_main "
1797 << convert<string>(dialogs_iconify_with_main) << '\n';
1801 case RC_SCREEN_FONT_ROMAN:
1802 if (ignore_system_lyxrc ||
1803 roman_font_name != system_lyxrc.roman_font_name) {
1804 os << "\\screen_font_roman \"" << roman_font_name
1809 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1810 if (ignore_system_lyxrc ||
1811 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1812 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1817 case RC_SCREEN_FONT_SANS:
1818 if (ignore_system_lyxrc ||
1819 sans_font_name != system_lyxrc.sans_font_name) {
1820 os << "\\screen_font_sans \"" << sans_font_name
1825 case RC_SCREEN_FONT_SANS_FOUNDRY:
1826 if (ignore_system_lyxrc ||
1827 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1828 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1833 case RC_SCREEN_FONT_TYPEWRITER:
1834 if (ignore_system_lyxrc ||
1835 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1836 os << "\\screen_font_typewriter \""
1837 << typewriter_font_name << "\"\n";
1841 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1842 if (ignore_system_lyxrc ||
1843 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1844 os << "\\screen_font_typewriter_foundry \""
1845 << typewriter_font_foundry << "\"\n";
1850 case RC_SCREEN_FONT_SCALABLE:
1851 if (ignore_system_lyxrc ||
1852 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1853 os << "\\screen_font_scalable "
1854 << convert<string>(use_scalable_fonts)
1859 case RC_SCREEN_FONT_SIZES:
1860 if (ignore_system_lyxrc ||
1861 font_sizes[FONT_SIZE_TINY]
1862 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1863 font_sizes[FONT_SIZE_SCRIPT]
1864 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1865 font_sizes[FONT_SIZE_FOOTNOTE]
1866 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1867 font_sizes[FONT_SIZE_SMALL]
1868 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1869 font_sizes[FONT_SIZE_NORMAL]
1870 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1871 font_sizes[FONT_SIZE_LARGE]
1872 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1873 font_sizes[FONT_SIZE_LARGER]
1874 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1875 font_sizes[FONT_SIZE_LARGEST]
1876 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1877 font_sizes[FONT_SIZE_HUGE]
1878 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1879 font_sizes[FONT_SIZE_HUGER]
1880 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1881 os.setf(ios::fixed);
1883 os << "\\screen_font_sizes"
1884 << ' ' << font_sizes[FONT_SIZE_TINY]
1885 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1886 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1887 << ' ' << font_sizes[FONT_SIZE_SMALL]
1888 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1889 << ' ' << font_sizes[FONT_SIZE_LARGE]
1890 << ' ' << font_sizes[FONT_SIZE_LARGER]
1891 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1892 << ' ' << font_sizes[FONT_SIZE_HUGE]
1893 << ' ' << font_sizes[FONT_SIZE_HUGER]
1898 case RC_FULL_SCREEN_LIMIT:
1899 if (ignore_system_lyxrc ||
1900 full_screen_limit != system_lyxrc.full_screen_limit) {
1901 os << "\\fullscreen_limit "
1902 << convert<string>(full_screen_limit)
1907 case RC_FULL_SCREEN_TOOLBARS:
1908 if (ignore_system_lyxrc ||
1909 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1910 os << "\\fullscreen_toolbars "
1911 << convert<string>(full_screen_toolbars)
1916 case RC_FULL_SCREEN_SCROLLBAR:
1917 if (ignore_system_lyxrc ||
1918 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1919 os << "\\fullscreen_scrollbar "
1920 << convert<string>(full_screen_scrollbar)
1925 case RC_FULL_SCREEN_TABBAR:
1926 if (ignore_system_lyxrc ||
1927 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1928 os << "\\fullscreen_tabbar "
1929 << convert<string>(full_screen_tabbar)
1934 case RC_FULL_SCREEN_MENUBAR:
1935 if (ignore_system_lyxrc ||
1936 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1937 os << "\\fullscreen_menubar "
1938 << convert<string>(full_screen_menubar)
1943 case RC_FULL_SCREEN_WIDTH:
1944 if (ignore_system_lyxrc ||
1945 full_screen_width != system_lyxrc.full_screen_width) {
1946 os << "\\fullscreen_width "
1947 << convert<string>(full_screen_width)
1952 case RC_OPEN_BUFFERS_IN_TABS:
1953 if (ignore_system_lyxrc ||
1954 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1955 os << "\\open_buffers_in_tabs "
1956 << convert<string>(open_buffers_in_tabs)
1961 case RC_SINGLE_CLOSE_TAB_BUTTON:
1962 if (ignore_system_lyxrc ||
1963 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1964 os << "\\single_close_tab_button "
1965 << convert<string>(single_close_tab_button)
1970 case RC_SINGLE_INSTANCE:
1971 if (ignore_system_lyxrc ||
1972 single_instance != system_lyxrc.single_instance) {
1973 os << "\\single_instance "
1974 << convert<string>(single_instance)
1979 case RC_FORWARD_SEARCH_DVI:
1980 if (ignore_system_lyxrc ||
1981 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1982 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1986 case RC_FORWARD_SEARCH_PDF:
1987 if (ignore_system_lyxrc ||
1988 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1989 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1995 << "# COLOR SECTION ###################################\n"
1999 for (int i = 0; i < Color_ignore; ++i) {
2000 ColorCode lc = static_cast<ColorCode>(i);
2001 string const col = lcolor.getX11Name(lc);
2002 if (ignore_system_lyxrc
2003 || col != system_lcolor.getX11Name(lc)) {
2004 os << "\\set_color \""
2005 << lcolor.getLyXName(lc) << "\" \""
2013 << "# PRINTER SECTION ###################################\n"
2017 if (ignore_system_lyxrc ||
2018 printer != system_lyxrc.printer) {
2019 os << "\\printer \"" << printer << "\"\n";
2023 case RC_PRINT_ADAPTOUTPUT:
2024 if (ignore_system_lyxrc ||
2025 print_adapt_output != system_lyxrc.print_adapt_output) {
2026 os << "\\print_adapt_output "
2027 << convert<string>(print_adapt_output)
2032 case RC_PRINT_COMMAND:
2033 if (ignore_system_lyxrc ||
2034 print_command != system_lyxrc.print_command) {
2035 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2039 case RC_PRINTEXSTRAOPTIONS:
2040 if (ignore_system_lyxrc ||
2041 print_extra_options != system_lyxrc.print_extra_options) {
2042 os << "\\print_extra_options \"" << print_extra_options
2047 case RC_PRINTSPOOL_COMMAND:
2048 if (ignore_system_lyxrc ||
2049 print_spool_command != system_lyxrc.print_spool_command) {
2050 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2055 case RC_PRINTSPOOL_PRINTERPREFIX:
2056 if (ignore_system_lyxrc ||
2057 print_spool_printerprefix
2058 != system_lyxrc.print_spool_printerprefix) {
2059 os << "\\print_spool_printerprefix \""
2060 << print_spool_printerprefix << "\"\n";
2064 case RC_PRINTEVENPAGEFLAG:
2065 if (ignore_system_lyxrc ||
2066 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2067 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2072 case RC_PRINTODDPAGEFLAG:
2073 if (ignore_system_lyxrc ||
2074 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2075 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2080 case RC_PRINTREVERSEFLAG:
2081 if (ignore_system_lyxrc ||
2082 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2083 os << "\\print_reverse_flag \"" << print_reverse_flag
2088 case RC_PRINTLANDSCAPEFLAG:
2089 if (ignore_system_lyxrc ||
2090 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2091 os << "\\print_landscape_flag \"" << print_landscape_flag
2096 case RC_PRINTPAGERANGEFLAG:
2097 if (ignore_system_lyxrc ||
2098 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2099 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2104 case RC_PRINTCOPIESFLAG:
2105 if (ignore_system_lyxrc ||
2106 print_copies_flag != system_lyxrc.print_copies_flag) {
2107 os << "\\print_copies_flag \"" << print_copies_flag
2112 case RC_PRINTCOLLCOPIESFLAG:
2113 if (ignore_system_lyxrc ||
2114 print_collcopies_flag
2115 != system_lyxrc.print_collcopies_flag) {
2116 os << "\\print_collcopies_flag \""
2117 << print_collcopies_flag
2122 case RC_PRINTPAPERFLAG:
2123 if (ignore_system_lyxrc ||
2124 print_paper_flag != system_lyxrc.print_paper_flag) {
2125 os << "\\print_paper_flag \"" << print_paper_flag
2130 case RC_PRINTPAPERDIMENSIONFLAG:
2131 if (ignore_system_lyxrc ||
2132 print_paper_dimension_flag
2133 != system_lyxrc.print_paper_dimension_flag) {
2134 os << "\\print_paper_dimension_flag \""
2135 << print_paper_dimension_flag << "\"\n";
2139 case RC_PRINTTOPRINTER:
2140 if (ignore_system_lyxrc ||
2141 print_to_printer != system_lyxrc.print_to_printer) {
2142 os << "\\print_to_printer \"" << print_to_printer
2147 case RC_PRINTTOFILE:
2148 if (ignore_system_lyxrc ||
2149 print_to_file != system_lyxrc.print_to_file) {
2150 string const path = os::external_path(print_to_file);
2151 os << "\\print_to_file \"" << path << "\"\n";
2155 case RC_PRINTFILEEXTENSION:
2156 if (ignore_system_lyxrc ||
2157 print_file_extension != system_lyxrc.print_file_extension) {
2158 os << "\\print_file_extension \""
2159 << print_file_extension
2166 << "# TEX SECTION #######################################\n"
2169 case RC_TEXINPUTS_PREFIX:
2170 if (ignore_system_lyxrc ||
2171 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2172 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2177 case RC_FONT_ENCODING:
2178 if (ignore_system_lyxrc ||
2179 fontenc != system_lyxrc.fontenc) {
2180 os << "\\font_encoding \"" << fontenc << "\"\n";
2185 case RC_FORCE_PAINT_SINGLE_CHAR:
2186 if (ignore_system_lyxrc ||
2187 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2188 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2194 << "# FILE SECTION ######################################\n"
2197 case RC_DOCUMENTPATH:
2198 if (ignore_system_lyxrc ||
2199 document_path != system_lyxrc.document_path) {
2200 string const path = os::external_path(document_path);
2201 os << "\\document_path \"" << path << "\"\n";
2205 case RC_USELASTFILEPOS:
2206 if (ignore_system_lyxrc ||
2207 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2208 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2213 case RC_LOADSESSION:
2214 if (ignore_system_lyxrc ||
2215 load_session != system_lyxrc.load_session) {
2216 os << "\\load_session " << convert<string>(load_session)
2221 case RC_MOUSE_WHEEL_SPEED:
2222 if (ignore_system_lyxrc ||
2223 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2224 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2228 case RC_COMPLETION_INLINE_DELAY:
2229 if (ignore_system_lyxrc ||
2230 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2231 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2235 case RC_COMPLETION_INLINE_MATH:
2236 if (ignore_system_lyxrc ||
2237 completion_inline_math != system_lyxrc.completion_inline_math) {
2238 os << "\\completion_inline_math "
2239 << convert<string>(completion_inline_math) << '\n';
2243 case RC_COMPLETION_INLINE_TEXT:
2244 if (ignore_system_lyxrc ||
2245 completion_inline_text != system_lyxrc.completion_inline_text) {
2246 os << "\\completion_inline_text "
2247 << convert<string>(completion_inline_text) << '\n';
2251 case RC_COMPLETION_INLINE_DOTS:
2252 if (ignore_system_lyxrc ||
2253 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2254 os << "\\completion_inline_dots "
2255 << convert<string>(completion_inline_dots) << '\n';
2259 case RC_AUTOCORRECTION_MATH:
2260 if (ignore_system_lyxrc ||
2261 autocorrection_math != system_lyxrc.autocorrection_math) {
2262 os << "\\autocorrection_math "
2263 << convert<string>(autocorrection_math) << '\n';
2267 case RC_COMPLETION_POPUP_DELAY:
2268 if (ignore_system_lyxrc ||
2269 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2270 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2274 case RC_COMPLETION_POPUP_MATH:
2275 if (ignore_system_lyxrc ||
2276 completion_popup_math != system_lyxrc.completion_popup_math) {
2277 os << "\\completion_popup_math "
2278 << convert<string>(completion_popup_math) << '\n';
2282 case RC_COMPLETION_POPUP_TEXT:
2283 if (ignore_system_lyxrc ||
2284 completion_popup_text != system_lyxrc.completion_popup_text) {
2285 os << "\\completion_popup_text "
2286 << convert<string>(completion_popup_text) << '\n';
2290 case RC_COMPLETION_CURSOR_TEXT:
2291 if (ignore_system_lyxrc ||
2292 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2293 os << "\\completion_cursor_text "
2294 << convert<string>(completion_cursor_text) << '\n';
2298 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2299 if (ignore_system_lyxrc ||
2300 completion_popup_after_complete
2301 != system_lyxrc.completion_popup_after_complete) {
2302 os << "\\completion_popup_after_complete "
2303 << convert<string>(completion_popup_after_complete) << '\n';
2307 case RC_COMPLETION_MINLENGTH:
2308 if (ignore_system_lyxrc ||
2309 completion_minlength != system_lyxrc.completion_minlength) {
2310 os << "\\completion_minlength " << convert<string>(completion_minlength)
2316 case RC_NUMLASTFILES:
2317 if (ignore_system_lyxrc ||
2318 num_lastfiles != system_lyxrc.num_lastfiles) {
2319 os << "\\num_lastfiles " << num_lastfiles << '\n';
2323 case RC_CHECKLASTFILES:
2324 if (ignore_system_lyxrc ||
2325 check_lastfiles != system_lyxrc.check_lastfiles) {
2326 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2331 case RC_EXAMPLEPATH:
2332 if (ignore_system_lyxrc ||
2333 example_path != system_lyxrc.example_path) {
2334 string const path = os::external_path(example_path);
2335 os << "\\example_path \"" << path << "\"\n";
2339 case RC_TEMPLATEPATH:
2340 if (ignore_system_lyxrc ||
2341 template_path != system_lyxrc.template_path) {
2342 string const path = os::external_path(template_path);
2343 os << "\\template_path \"" << path << "\"\n";
2347 case RC_TEMPDIRPATH:
2348 if (ignore_system_lyxrc ||
2349 tempdir_path != system_lyxrc.tempdir_path) {
2350 string const path = os::external_path(tempdir_path);
2351 os << "\\tempdir_path \"" << path << "\"\n";
2355 case RC_THESAURUSDIRPATH:
2356 if (ignore_system_lyxrc ||
2357 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2358 string const path = os::external_path(thesaurusdir_path);
2359 os << "\\thesaurusdir_path \"" << path << "\"\n";
2363 case RC_HUNSPELLDIR_PATH:
2364 if (ignore_system_lyxrc ||
2365 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2366 string const path = os::external_path(hunspelldir_path);
2367 os << "\\hunspelldir_path \"" << path << "\"\n";
2371 case RC_PLAINTEXT_LINELEN:
2372 if (ignore_system_lyxrc ||
2373 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2374 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2378 case RC_MAKE_BACKUP:
2379 if (ignore_system_lyxrc ||
2380 make_backup != system_lyxrc.make_backup) {
2381 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2385 case RC_SAVE_COMPRESSED:
2386 if (ignore_system_lyxrc ||
2387 save_compressed != system_lyxrc.save_compressed) {
2388 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2392 case RC_BACKUPDIR_PATH:
2393 if (ignore_system_lyxrc ||
2394 backupdir_path != system_lyxrc.backupdir_path) {
2395 string const path = os::external_path(backupdir_path);
2396 os << "\\backupdir_path \"" << path << "\"\n";
2402 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2406 << "# SPELLCHECKER SECTION ##############################\n"
2409 case RC_ACCEPT_COMPOUND:
2410 if (ignore_system_lyxrc ||
2411 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2412 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2418 if (ignore_system_lyxrc ||
2419 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2420 os << "\\alternate_language \"" << spellchecker_alt_lang
2426 if (ignore_system_lyxrc ||
2427 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2428 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2432 case RC_USE_SYSTEM_COLORS:
2433 if (ignore_system_lyxrc ||
2434 use_system_colors != system_lyxrc.use_system_colors) {
2435 os << "\\use_system_colors "
2436 << convert<string>(use_system_colors)
2441 case RC_USE_TOOLTIP:
2442 if (ignore_system_lyxrc ||
2443 use_tooltip != system_lyxrc.use_tooltip) {
2444 os << "\\use_tooltip "
2445 << convert<string>(use_tooltip)
2450 case RC_USE_PIXMAP_CACHE:
2451 if (ignore_system_lyxrc ||
2452 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2453 os << "\\use_pixmap_cache "
2454 << convert<string>(use_pixmap_cache)
2460 if (ignore_system_lyxrc ||
2461 use_qimage != system_lyxrc.use_qimage) {
2462 os << "\\use_qimage "
2463 << convert<string>(use_qimage)
2470 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2475 case RC_DEFAULT_DECIMAL_POINT:
2476 if (ignore_system_lyxrc ||
2477 default_decimal_point != system_lyxrc.default_decimal_point) {
2478 os << "\\default_decimal_point " << default_decimal_point << '\n';
2483 case RC_DEFAULT_LENGTH_UNIT:
2484 if (ignore_system_lyxrc ||
2485 default_length_unit != system_lyxrc.default_length_unit) {
2486 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2491 case RC_SPELLCHECKER:
2492 if (ignore_system_lyxrc ||
2493 spellchecker != system_lyxrc.spellchecker) {
2494 os << "\\spellchecker " << spellchecker << '\n';
2499 case RC_SPELLCHECK_CONTINUOUSLY:
2500 if (ignore_system_lyxrc ||
2501 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2502 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2508 case RC_SPELLCHECK_NOTES:
2509 if (ignore_system_lyxrc ||
2510 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2511 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2517 case RC_RTL_SUPPORT:
2518 if (ignore_system_lyxrc ||
2519 rtl_support != system_lyxrc.rtl_support) {
2520 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2524 case RC_VISUAL_CURSOR:
2525 if (ignore_system_lyxrc ||
2526 visual_cursor != system_lyxrc.visual_cursor) {
2527 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2531 case RC_LANGUAGE_CUSTOM_PACKAGE:
2532 if (ignore_system_lyxrc ||
2533 language_custom_package != system_lyxrc.language_custom_package) {
2534 os << "\\language_custom_package \"" << language_custom_package
2539 case RC_LANGUAGE_GLOBAL_OPTIONS:
2540 if (ignore_system_lyxrc ||
2541 language_global_options
2542 != system_lyxrc.language_global_options) {
2543 os << "\\language_global_options \""
2544 << convert<string>(language_global_options)
2549 case RC_LANGUAGE_PACKAGE_SELECTION:
2550 if (ignore_system_lyxrc ||
2551 language_package_selection != system_lyxrc.language_package_selection) {
2552 os << "\\language_package_selection ";
2553 switch (language_package_selection) {
2570 case RC_LANGUAGE_COMMAND_BEGIN:
2571 if (ignore_system_lyxrc ||
2572 language_command_begin
2573 != system_lyxrc.language_command_begin) {
2574 os << "\\language_command_begin \""
2575 << language_command_begin
2580 case RC_LANGUAGE_COMMAND_END:
2581 if (ignore_system_lyxrc ||
2582 language_command_end
2583 != system_lyxrc.language_command_end) {
2584 os << "\\language_command_end \"" << language_command_end
2589 case RC_LANGUAGE_COMMAND_LOCAL:
2590 if (ignore_system_lyxrc ||
2591 language_command_local
2592 != system_lyxrc.language_command_local) {
2593 os << "\\language_command_local \""
2594 << language_command_local
2599 case RC_LANGUAGE_AUTO_BEGIN:
2600 if (ignore_system_lyxrc ||
2601 language_auto_begin != system_lyxrc.language_auto_begin) {
2602 os << "\\language_auto_begin "
2603 << convert<string>(language_auto_begin) << '\n';
2607 case RC_LANGUAGE_AUTO_END:
2608 if (ignore_system_lyxrc ||
2609 language_auto_end != system_lyxrc.language_auto_end) {
2610 os << "\\language_auto_end "
2611 << convert<string>(language_auto_end) << '\n';
2615 case RC_MARK_FOREIGN_LANGUAGE:
2616 if (ignore_system_lyxrc ||
2617 mark_foreign_language
2618 != system_lyxrc.mark_foreign_language) {
2619 os << "\\mark_foreign_language " <<
2620 convert<string>(mark_foreign_language) << '\n';
2626 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2629 case RC_AUTO_NUMBER:
2630 if (ignore_system_lyxrc ||
2631 auto_number != system_lyxrc.auto_number) {
2632 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2636 case RC_GUI_LANGUAGE:
2637 if (ignore_system_lyxrc ||
2638 gui_language != system_lyxrc.gui_language) {
2639 os << "\\gui_language " << gui_language << '\n';
2643 case RC_EXPORT_OVERWRITE:
2644 if (ignore_system_lyxrc ||
2645 export_overwrite != system_lyxrc.export_overwrite) {
2647 switch (export_overwrite) {
2658 os << "\\export_overwrite " << status << '\n';
2663 case RC_SCROLL_WHEEL_ZOOM:
2664 if (ignore_system_lyxrc ||
2665 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2667 switch (scroll_wheel_zoom) {
2668 case SCROLL_WHEEL_ZOOM_OFF:
2671 case SCROLL_WHEEL_ZOOM_CTRL:
2674 case SCROLL_WHEEL_ZOOM_SHIFT:
2677 case SCROLL_WHEEL_ZOOM_ALT:
2681 os << "\\scroll_wheel_zoom " << status << '\n';
2687 << "# FORMATS SECTION ##########################\n"
2691 // New/modified formats
2692 for (Formats::const_iterator cit = formats.begin();
2693 cit != formats.end(); ++cit) {
2694 Format const * format =
2695 system_formats.getFormat(cit->name());
2697 format->extensions() != cit->extensions() ||
2698 format->prettyname() != cit->prettyname() ||
2699 format->shortcut() != cit->shortcut() ||
2700 format->viewer() != cit->viewer() ||
2701 format->editor() != cit->editor() ||
2702 format->documentFormat() != cit->documentFormat() ||
2703 format->vectorFormat() != cit->vectorFormat() ||
2704 format->inExportMenu() != cit->inExportMenu() ||
2705 format->mime() != cit->mime()) {
2706 os << "\\format \"" << cit->name() << "\" \""
2707 << cit->extensions() << "\" \""
2708 << cit->prettyname() << "\" \""
2709 << cit->shortcut() << "\" \""
2710 << escapeCommand(cit->viewer()) << "\" \""
2711 << escapeCommand(cit->editor()) << "\" \"";
2712 vector<string> flags;
2713 if (cit->documentFormat())
2714 flags.push_back("document");
2715 if (cit->vectorFormat())
2716 flags.push_back("vector");
2717 if (cit->zippedNative())
2718 flags.push_back("zipped=native");
2719 if (cit->inExportMenu())
2720 flags.push_back("menu=export");
2722 os << getStringFromVector(flags);
2723 os << "\" \"" << cit->mime() << "\"\n";
2727 // Look for deleted formats
2728 for (Formats::const_iterator cit = system_formats.begin();
2729 cit != system_formats.end(); ++cit)
2730 if (!formats.getFormat(cit->name()))
2731 os << "\\format \"" << cit->name()
2732 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2735 case RC_VIEWER_ALTERNATIVES: {
2736 Alternatives::const_iterator it = viewer_alternatives.begin();
2737 Alternatives::const_iterator const en = viewer_alternatives.end();
2738 Alternatives::const_iterator const sysend =
2739 system_lyxrc.viewer_alternatives.end();
2740 for (; it != en; ++it) {
2741 string const & fmt = it->first;
2742 CommandSet const & cmd = it->second;
2743 CommandSet::const_iterator sit = cmd.begin();
2744 CommandSet::const_iterator const sen = cmd.end();
2745 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2746 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2747 system_lyxrc.viewer_alternatives.find(fmt);
2748 for (; sit != sen; ++sit) {
2749 string const & cmd = *sit;
2750 if (ignore_system_lyxrc
2751 || sysfmt == sysend // format not found
2752 || sysfmt->second.count(cmd) == 0 // this command not found
2754 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2760 case RC_EDITOR_ALTERNATIVES: {
2761 Alternatives::const_iterator it = editor_alternatives.begin();
2762 Alternatives::const_iterator const en = editor_alternatives.end();
2763 Alternatives::const_iterator const sysend =
2764 system_lyxrc.editor_alternatives.end();
2765 for (; it != en; ++it) {
2766 string const & fmt = it->first;
2767 CommandSet const & cmd = it->second;
2768 CommandSet::const_iterator sit = cmd.begin();
2769 CommandSet::const_iterator const sen = cmd.end();
2770 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2771 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2772 system_lyxrc.editor_alternatives.find(fmt);
2773 for (; sit != sen; ++sit) {
2774 string const & cmd = *sit;
2775 if (ignore_system_lyxrc
2776 || sysfmt == sysend // format not found
2777 || sysfmt->second.count(cmd) == 0 // this command not found
2779 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2785 case RC_DEFAULT_VIEW_FORMAT:
2786 if (ignore_system_lyxrc ||
2787 default_view_format != system_lyxrc.default_view_format) {
2788 os << "\\default_view_format " << default_view_format << '\n';
2798 << "# CONVERTERS SECTION ##########################\n"
2802 // Look for new converters
2803 for (Converters::const_iterator cit = theConverters().begin();
2804 cit != theConverters().end(); ++cit) {
2805 Converter const * converter =
2806 theSystemConverters().getConverter(cit->from,
2809 converter->command != cit->command ||
2810 converter->flags != cit->flags)
2811 os << "\\converter \"" << cit->from << "\" \""
2812 << cit->to << "\" \""
2813 << escapeCommand(cit->command) << "\" \""
2814 << cit->flags << "\"\n";
2817 // New/modifed converters
2818 for (Converters::const_iterator cit = theSystemConverters().begin();
2819 cit != theSystemConverters().end(); ++cit)
2820 if (!theConverters().getConverter(cit->from, cit->to))
2821 os << "\\converter \"" << cit->from
2822 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2829 << "# COPIERS SECTION ##########################\n"
2832 // Look for new movers
2833 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2834 Movers::const_iterator const sysend = theSystemMovers().end();
2835 Movers::const_iterator it = theMovers().begin();
2836 Movers::const_iterator end = theMovers().end();
2838 for (; it != end; ++it) {
2839 Movers::const_iterator const sysit =
2840 find_if(sysbegin, sysend, SameMover(*it));
2841 if (sysit == sysend) {
2842 string const & fmt = it->first;
2843 string const & command =
2844 it->second.command();
2846 os << "\\copier " << fmt
2847 << " \"" << escapeCommand(command) << "\"\n";
2853 // We don't actually delete SpecialisedMover(s) from the
2854 // map, just clear their 'command', so there's no need
2855 // to test for anything else.
2862 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2864 // Why the switch you might ask. It is a trick to ensure that all
2865 // the elements in the LyXRCTags enum is handled. As you can see
2866 // there are no breaks at all. So it is just a huge fall-through.
2867 // The nice thing is that we will get a warning from the compiler
2868 // if we forget an element.
2869 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2871 case LyXRC::RC_LAST:
2872 case LyXRC::RC_ACCEPT_COMPOUND:
2873 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2874 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2875 case LyXRC::RC_ALT_LANG:
2876 case LyXRC::RC_PLAINTEXT_LINELEN:
2877 case LyXRC::RC_AUTOCORRECTION_MATH:
2878 case LyXRC::RC_AUTOREGIONDELETE:
2879 case LyXRC::RC_AUTORESET_OPTIONS:
2880 case LyXRC::RC_AUTOSAVE:
2881 case LyXRC::RC_AUTO_NUMBER:
2882 case LyXRC::RC_BACKUPDIR_PATH:
2883 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2884 case LyXRC::RC_BIBTEX_COMMAND:
2885 case LyXRC::RC_BINDFILE:
2886 case LyXRC::RC_CHECKLASTFILES:
2887 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2888 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2889 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2890 case LyXRC::RC_COMPLETION_INLINE_MATH:
2891 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2892 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2893 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2894 case LyXRC::RC_COMPLETION_POPUP_MATH:
2895 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2896 case LyXRC::RC_COMPLETION_MINLENGTH:
2897 case LyXRC::RC_USELASTFILEPOS:
2898 case LyXRC::RC_LOADSESSION:
2899 case LyXRC::RC_CHKTEX_COMMAND:
2900 case LyXRC::RC_CONVERTER:
2901 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2902 case LyXRC::RC_COPIER:
2903 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2904 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2905 case LyXRC::RC_DATE_INSERT_FORMAT:
2906 case LyXRC::RC_GUI_LANGUAGE:
2907 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2908 case LyXRC::RC_DEFFILE:
2909 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2910 case LyXRC::RC_DISPLAY_GRAPHICS:
2911 case LyXRC::RC_DOCUMENTPATH:
2912 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2913 FileName path(lyxrc_new.document_path);
2914 if (path.exists() && path.isDirectory())
2915 package().document_dir() = FileName(lyxrc.document_path);
2917 case LyXRC::RC_EDITOR_ALTERNATIVES:
2918 case LyXRC::RC_ESC_CHARS:
2919 case LyXRC::RC_EXAMPLEPATH:
2920 case LyXRC::RC_FONT_ENCODING:
2921 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2922 case LyXRC::RC_FILEFORMAT:
2923 case LyXRC::RC_GROUP_LAYOUTS:
2924 case LyXRC::RC_HUNSPELLDIR_PATH:
2925 case LyXRC::RC_ICON_SET:
2926 case LyXRC::RC_INDEX_ALTERNATIVES:
2927 case LyXRC::RC_INDEX_COMMAND:
2928 case LyXRC::RC_JBIBTEX_COMMAND:
2929 case LyXRC::RC_JINDEX_COMMAND:
2930 case LyXRC::RC_NOMENCL_COMMAND:
2931 case LyXRC::RC_INPUT:
2932 case LyXRC::RC_KBMAP:
2933 case LyXRC::RC_KBMAP_PRIMARY:
2934 case LyXRC::RC_KBMAP_SECONDARY:
2935 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2936 case LyXRC::RC_LANGUAGE_AUTO_END:
2937 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2938 case LyXRC::RC_LANGUAGE_COMMAND_END:
2939 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2940 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2941 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2942 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2943 case LyXRC::RC_LYXRCFORMAT:
2944 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2945 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2946 case LyXRC::RC_MACRO_EDIT_STYLE:
2947 case LyXRC::RC_MAKE_BACKUP:
2948 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2949 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2950 case LyXRC::RC_NUMLASTFILES:
2951 case LyXRC::RC_PARAGRAPH_MARKERS:
2952 case LyXRC::RC_PATH_PREFIX:
2953 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2954 prependEnvPath("PATH", lyxrc_new.path_prefix);
2956 case LyXRC::RC_PREVIEW:
2957 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2958 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2959 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2960 case LyXRC::RC_PRINTCOPIESFLAG:
2961 case LyXRC::RC_PRINTER:
2962 case LyXRC::RC_PRINTEVENPAGEFLAG:
2963 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2964 case LyXRC::RC_PRINTFILEEXTENSION:
2965 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2966 case LyXRC::RC_PRINTODDPAGEFLAG:
2967 case LyXRC::RC_PRINTPAGERANGEFLAG:
2968 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2969 case LyXRC::RC_PRINTPAPERFLAG:
2970 case LyXRC::RC_PRINTREVERSEFLAG:
2971 case LyXRC::RC_PRINTSPOOL_COMMAND:
2972 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2973 case LyXRC::RC_PRINTTOFILE:
2974 case LyXRC::RC_PRINTTOPRINTER:
2975 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2976 case LyXRC::RC_PRINT_COMMAND:
2977 case LyXRC::RC_RTL_SUPPORT:
2978 case LyXRC::RC_SAVE_COMPRESSED:
2979 case LyXRC::RC_SCREEN_DPI:
2980 case LyXRC::RC_SCREEN_FONT_ROMAN:
2981 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2982 case LyXRC::RC_SCREEN_FONT_SANS:
2983 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2984 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2985 case LyXRC::RC_SCREEN_FONT_SIZES:
2986 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2987 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2988 case LyXRC::RC_GEOMETRY_SESSION:
2989 case LyXRC::RC_SCREEN_ZOOM:
2990 case LyXRC::RC_SERVERPIPE:
2991 case LyXRC::RC_SET_COLOR:
2992 case LyXRC::RC_SHOW_BANNER:
2993 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2994 case LyXRC::RC_SPELLCHECKER:
2995 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2997 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2998 case LyXRC::RC_SPELLCHECK_NOTES:
2999 case LyXRC::RC_SPLITINDEX_COMMAND:
3000 case LyXRC::RC_TEMPDIRPATH:
3001 case LyXRC::RC_TEMPLATEPATH:
3002 case LyXRC::RC_TEX_ALLOWS_SPACES:
3003 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3004 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3005 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3007 case LyXRC::RC_TEXINPUTS_PREFIX:
3008 case LyXRC::RC_THESAURUSDIRPATH:
3009 case LyXRC::RC_UIFILE:
3010 case LyXRC::RC_USER_EMAIL:
3011 case LyXRC::RC_USER_NAME:
3012 case LyXRC::RC_USE_CONVERTER_CACHE:
3013 case LyXRC::RC_USE_SYSTEM_COLORS:
3014 case LyXRC::RC_USE_TOOLTIP:
3015 case LyXRC::RC_USE_PIXMAP_CACHE:
3016 case LyXRC::RC_USE_QIMAGE:
3017 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3018 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3019 case LyXRC::RC_SINGLE_INSTANCE:
3020 case LyXRC::RC_SORT_LAYOUTS:
3021 case LyXRC::RC_FULL_SCREEN_LIMIT:
3022 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3023 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3024 case LyXRC::RC_FULL_SCREEN_TABBAR:
3025 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3026 case LyXRC::RC_FULL_SCREEN_WIDTH:
3027 case LyXRC::RC_VISUAL_CURSOR:
3028 case LyXRC::RC_VIEWER:
3029 case LyXRC::RC_VIEWER_ALTERNATIVES:
3030 case LyXRC::RC_FORWARD_SEARCH_DVI:
3031 case LyXRC::RC_FORWARD_SEARCH_PDF:
3032 case LyXRC::RC_EXPORT_OVERWRITE:
3033 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3034 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3035 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3036 case LyXRC::RC_CURSOR_WIDTH:
3043 string const LyXRC::getDescription(LyXRCTags tag)
3048 case RC_ACCEPT_COMPOUND:
3049 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3053 str = _("Specify an alternate language. The default is to use the language of the document.");
3056 case RC_PLAINTEXT_LINELEN:
3057 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.");
3060 case RC_AUTOREGIONDELETE:
3061 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3064 case RC_AUTORESET_OPTIONS:
3065 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3069 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3072 case RC_AUTO_NUMBER:
3075 case RC_BACKUPDIR_PATH:
3076 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.");
3079 case RC_BIBTEX_COMMAND:
3080 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3083 case RC_JBIBTEX_COMMAND:
3084 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3088 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3091 case RC_CHECKLASTFILES:
3092 str = _("Select to check whether the lastfiles still exist.");
3095 case RC_CHKTEX_COMMAND:
3096 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3105 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3106 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.");
3109 case RC_CURSOR_WIDTH:
3110 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3113 case RC_SCROLL_BELOW_DOCUMENT:
3114 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");
3117 case RC_MAC_DONTSWAP_CTRL_META:
3118 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3121 case RC_MAC_LIKE_WORD_MOVEMENT:
3122 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3125 case RC_SHOW_MACRO_LABEL:
3126 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3129 case RC_DATE_INSERT_FORMAT:
3130 //xgettext:no-c-format
3131 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3135 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3138 case RC_DEFAULT_VIEW_FORMAT:
3139 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3142 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3143 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3146 case RC_DISPLAY_GRAPHICS:
3147 str = _("Select how LyX will display any graphics.");
3150 case RC_DOCUMENTPATH:
3151 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3155 str = _("Specify additional chars that can be part of a word.");
3158 case RC_EXAMPLEPATH:
3159 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3162 case RC_FONT_ENCODING:
3163 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3166 case RC_FORCE_PAINT_SINGLE_CHAR:
3167 str = _("Disable any kerning and ligatures for text drawing on screen.");
3173 case RC_INDEX_COMMAND:
3174 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\".");
3177 case RC_JINDEX_COMMAND:
3178 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3181 case RC_NOMENCL_COMMAND:
3182 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3189 case RC_KBMAP_PRIMARY:
3190 case RC_KBMAP_SECONDARY:
3191 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.");
3194 case RC_LANGUAGE_AUTO_BEGIN:
3195 str = _("Select if a language switching command is needed at the beginning of the document.");
3198 case RC_LANGUAGE_AUTO_END:
3199 str = _("Select if a language switching command is needed at the end of the document.");
3202 case RC_LANGUAGE_COMMAND_BEGIN:
3203 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.");
3206 case RC_LANGUAGE_COMMAND_END:
3207 str = _("The LaTeX command for changing back to the language of the document.");
3210 case RC_LANGUAGE_COMMAND_LOCAL:
3211 str = _("The LaTeX command for local changing of the language.");
3214 case RC_LANGUAGE_GLOBAL_OPTIONS:
3215 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3218 case RC_LANGUAGE_CUSTOM_PACKAGE:
3219 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3222 case RC_LANGUAGE_PACKAGE_SELECTION:
3223 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3226 case RC_USELASTFILEPOS:
3227 str = _("De-select if you do not want LyX to scroll to saved position.");
3230 case RC_LOADSESSION:
3231 str = _("De-select to prevent loading files opened from the last LyX session.");
3234 case RC_MAKE_BACKUP:
3235 str = _("De-select if you don't want LyX to create backup files.");
3238 case RC_MARK_FOREIGN_LANGUAGE:
3239 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3242 case RC_MOUSE_WHEEL_SPEED:
3243 str = bformat(_("The scrolling speed of the mouse wheel."),
3247 case RC_COMPLETION_POPUP_DELAY:
3248 str = _("The completion popup delay.");
3251 case RC_COMPLETION_POPUP_MATH:
3252 str = _("Select to display the completion popup in math mode.");
3255 case RC_COMPLETION_POPUP_TEXT:
3256 str = _("Select to display the completion popup in text mode.");
3259 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3260 str = _("Show the completion popup without delay after non-unique completion attempt.");
3263 case RC_COMPLETION_POPUP_TEXT:
3264 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3267 case RC_COMPLETION_POPUP_DELAY:
3268 str = _("The inline completion delay.");
3271 case RC_COMPLETION_INLINE_MATH:
3272 str = _("Select to display the inline completion in math mode.");
3275 case RC_COMPLETION_INLINE_TEXT:
3276 str = _("Select to display the inline completion in text mode.");
3279 case RC_COMPLETION_INLINE_DOTS:
3280 str = _("Use \"...\" to shorten long completions.");
3283 case RC_AUTOCORRECTION_MATH:
3284 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3287 case RC_NUMLASTFILES:
3288 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3292 case RC_PATH_PREFIX:
3293 str = _("Specify those directories which should be "
3294 "prepended to the PATH environment variable.\n"
3295 "Use the OS native format.");
3299 str = _("Shows a typeset preview of things such as math");
3302 case RC_PREVIEW_HASHED_LABELS:
3303 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3306 case RC_PREVIEW_SCALE_FACTOR:
3307 str = _("Scale the preview size to suit.");
3310 case RC_PRINTCOLLCOPIESFLAG:
3311 str = _("The option for specifying whether the copies should be collated.");
3314 case RC_PRINTCOPIESFLAG:
3315 str = _("The option for specifying the number of copies to print.");
3319 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3322 case RC_PRINTEVENPAGEFLAG:
3323 str = _("The option to print only even pages.");
3326 case RC_PRINTEXSTRAOPTIONS:
3327 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3330 case RC_PRINTFILEEXTENSION:
3331 str = _("Extension of printer program output file. Usually \".ps\".");
3334 case RC_PRINTLANDSCAPEFLAG:
3335 str = _("The option to print out in landscape.");
3338 case RC_PRINTODDPAGEFLAG:
3339 str = _("The option to print only odd pages.");
3342 case RC_PRINTPAGERANGEFLAG:
3343 str = _("The option for specifying a comma-separated list of pages to print.");
3346 case RC_PRINTPAPERDIMENSIONFLAG:
3347 str = _("Option to specify the dimensions of the print paper.");
3350 case RC_PRINTPAPERFLAG:
3351 str = _("The option to specify paper type.");
3354 case RC_PRINTREVERSEFLAG:
3355 str = _("The option to reverse the order of the pages printed.");
3358 case RC_PRINTSPOOL_COMMAND:
3359 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.");
3362 case RC_PRINTSPOOL_PRINTERPREFIX:
3363 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.");
3366 case RC_PRINTTOFILE:
3367 str = _("Option to pass to the print program to print to a file.");
3370 case RC_PRINTTOPRINTER:
3371 str = _("Option to pass to the print program to print on a specific printer.");
3374 case RC_PRINT_ADAPTOUTPUT:
3375 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3378 case RC_PRINT_COMMAND:
3379 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3382 case RC_RTL_SUPPORT:
3383 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3386 case RC_VISUAL_CURSOR:
3387 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3391 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3394 case RC_SCREEN_FONT_ROMAN:
3395 case RC_SCREEN_FONT_SANS:
3396 case RC_SCREEN_FONT_TYPEWRITER:
3397 str = _("The screen fonts used to display the text while editing.");
3400 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3401 case RC_SCREEN_FONT_SANS_FOUNDRY:
3402 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3405 case RC_SCREEN_FONT_SCALABLE:
3406 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.");
3409 case RC_SCREEN_FONT_SIZES:
3410 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3413 case RC_SCREEN_ZOOM:
3414 //xgettext:no-c-format
3415 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3418 case RC_GEOMETRY_SESSION:
3419 str = _("Allow session manager to save and restore windows geometry.");
3423 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3429 case RC_SHOW_BANNER:
3430 str = _("De-select if you don't want the startup banner.");
3433 case RC_TEMPDIRPATH:
3434 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3437 case RC_THESAURUSDIRPATH:
3438 str = _("This is the place where the files of the thesaurus library reside.");
3441 case RC_TEMPLATEPATH:
3442 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3445 case RC_TEX_ALLOWS_SPACES:
3448 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3451 case RC_TEXINPUTS_PREFIX:
3452 str = _("Specify those directories which should be "
3453 "prepended to the TEXINPUTS environment variable.\n"
3454 "A '.' represents the current document directory. "
3455 "Use the OS native format.");
3459 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3468 case RC_USE_USE_SYSTEM_COLORS:
3469 str = _("Enable use the system colors for some things like main window background and selection.");
3472 case RC_USE_TOOLTIP:
3473 str = _("Enable the automatic appearance of tool tips in the work area.");
3476 case RC_USE_PIXMAP_CACHE:
3477 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3480 case RC_VIEWDVI_PAPEROPTION:
3481 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3496 // The global instance
3499 // The global copy of the system lyxrc entries (everything except preferences)