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 = 14; // spitz: default_otf_view_format
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 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
77 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
78 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
79 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
80 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
81 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
82 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
83 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
84 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
85 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
86 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
87 { "\\converter", LyXRC::RC_CONVERTER },
88 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
89 { "\\copier", LyXRC::RC_COPIER },
90 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
91 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
92 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
93 { "\\def_file", LyXRC::RC_DEFFILE },
94 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
95 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
96 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
97 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
98 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
99 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
100 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
101 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
102 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
103 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
104 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
105 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
106 { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
107 { "\\format", LyXRC::RC_FILEFORMAT },
108 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
109 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
110 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
111 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
112 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
113 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
114 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
115 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
116 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
117 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
118 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
119 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
120 { "\\icon_set", LyXRC::RC_ICON_SET },
121 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
122 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
123 { "\\input", LyXRC::RC_INPUT },
124 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
125 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
126 { "\\kbmap", LyXRC::RC_KBMAP },
127 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
128 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
129 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
130 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
131 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
132 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
133 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
134 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
135 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
136 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
137 { "\\load_session", LyXRC::RC_LOADSESSION },
138 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
139 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
140 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
141 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
142 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
143 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
144 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
145 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
146 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
147 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
148 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
149 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
150 { "\\preview", LyXRC::RC_PREVIEW },
151 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
152 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
153 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
154 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
155 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
156 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
157 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
158 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
159 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
160 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
161 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
162 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
163 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
164 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
165 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
166 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
167 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
168 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
169 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
170 { "\\printer", LyXRC::RC_PRINTER },
171 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
172 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
173 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
174 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
175 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
176 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
177 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
178 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
179 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
180 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
181 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
182 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
183 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
184 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
185 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
186 { "\\set_color", LyXRC::RC_SET_COLOR },
187 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
188 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
189 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
190 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
191 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
192 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
193 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
194 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
195 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
196 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
197 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
198 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
199 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
200 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
201 { "\\ui_file", LyXRC::RC_UIFILE },
202 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
203 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
204 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
205 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
206 // compatibility with versions older than 1.4.0 only
207 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
208 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
209 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
210 { "\\user_email", LyXRC::RC_USER_EMAIL },
211 { "\\user_name", LyXRC::RC_USER_NAME },
212 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
213 // compatibility with versions older than 1.4.0 only
214 { "\\viewer", LyXRC::RC_VIEWER},
215 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
216 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
217 { "format", LyXRC::RC_LYXRCFORMAT }
220 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
231 void LyXRC::setDefaults()
234 use_system_theme_icons = false;
236 def_file = "default";
238 // The current document directory
239 texinputs_prefix = ".";
240 // Get printer from the environment. If fail, use default "",
241 // assuming that everything is set up correctly.
242 printer = getEnv("PRINTER");
243 print_adapt_output = false;
244 print_command = "dvips";
245 print_evenpage_flag = "-B";
246 print_oddpage_flag = "-A";
247 print_pagerange_flag = "-pp";
248 print_copies_flag = "-c";
249 print_collcopies_flag = "-C";
250 print_reverse_flag = "-r";
251 print_landscape_flag = "-t landscape";
252 print_to_printer = "-P";
253 print_to_file = "-o ";
254 print_file_extension = ".ps";
255 print_paper_flag = "-t";
256 print_paper_dimension_flag = "-T";
257 document_path.erase();
258 view_dvi_paper_option.erase();
259 default_view_format = "pdf2";
260 default_otf_view_format = "pdf4";
261 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
262 bibtex_command = "bibtex";
264 index_command = "makeindex -c -q";
265 nomencl_command = "makeindex -s nomencl.ist";
267 // Because a screen is typically wider than a piece of paper:
269 allow_geometry_session = true;
270 // Default LaTeX font size:
271 font_sizes[FONT_SIZE_TINY] = "5.0";
272 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
273 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
274 font_sizes[FONT_SIZE_SMALL] = "9.0";
275 font_sizes[FONT_SIZE_NORMAL] = "10.0";
276 font_sizes[FONT_SIZE_LARGE] = "12.0";
277 font_sizes[FONT_SIZE_LARGER] = "14.4";
278 font_sizes[FONT_SIZE_LARGEST] = "17.26";
279 font_sizes[FONT_SIZE_HUGE] = "20.74";
280 font_sizes[FONT_SIZE_HUGER] = "24.88";
281 use_scalable_fonts = true;
282 roman_font_name = "";
284 typewriter_font_name = "";
286 auto_region_delete = true;
287 auto_reset_options = false;
288 plaintext_linelen = 65;
289 mouse_wheel_speed = 1.0;
290 num_lastfiles = maxlastfiles;
291 check_lastfiles = true;
292 use_lastfilepos = true;
293 load_session = false;
295 save_compressed = false;
296 backupdir_path.erase();
297 display_graphics = true;
298 // Spellchecker settings:
299 // FIXME: this check should test the target platform (darwin)
300 #if defined(USE_MACOSX_PACKAGING)
301 spellchecker = "native";
302 #elif defined(USE_ASPELL)
303 spellchecker = "aspell";
304 #elif defined(USE_HUNSPELL)
305 spellchecker = "hunspell";
307 spellchecker = "aspell";
309 spellchecker_accept_compound = false;
310 spellcheck_continuously = false;
311 completion_minlength = 6;
312 spellcheck_notes = true;
315 visual_cursor = false;
317 mark_foreign_language = true;
318 language_auto_begin = true;
319 language_auto_end = true;
320 language_global_options = true;
321 language_package_selection = LP_AUTO;
322 language_custom_package = "\\usepackage{babel}";
323 language_command_begin = "\\selectlanguage{$$lang}";
324 language_command_local = "\\foreignlanguage{$$lang}{";
325 sort_layouts = false;
326 group_layouts = true;
327 gui_language = "auto";
329 windows_style_tex_paths = false;
330 tex_allows_spaces = false;
331 date_insert_format = "%x";
332 cursor_follows_scrollbar = false;
333 scroll_below_document = false;
334 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
335 paragraph_markers = false;
336 mac_dontswap_ctrl_meta = false;
337 mac_like_cursor_movement = false;
338 macro_edit_style = MACRO_EDIT_INLINE_BOX;
339 dialogs_iconify_with_main = false;
340 preview = PREVIEW_OFF;
341 preview_hashed_labels = false;
342 preview_scale_factor = 1.0;
343 use_converter_cache = true;
344 use_system_colors = false;
346 use_pixmap_cache = false;
348 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
349 user_name = to_utf8(support::user_name());
350 user_email = to_utf8(support::user_email());
351 open_buffers_in_tabs = true;
352 single_close_tab_button = false;
353 single_instance = true;
354 forward_search_dvi = string();
355 forward_search_pdf = string();
356 export_overwrite = NO_FILES;
358 // Fullscreen settings
359 full_screen_limit = false;
360 full_screen_toolbars = true;
361 full_screen_tabbar = true;
362 full_screen_menubar = true;
363 full_screen_scrollbar = true;
364 full_screen_width = 700;
366 completion_cursor_text = true;
367 completion_popup_math = true;
368 completion_popup_text = false;
369 completion_popup_delay = 2.0;
370 completion_popup_after_complete = true;
371 autocorrection_math = false;
372 completion_inline_math = true;
373 completion_inline_text = false;
374 completion_inline_dots = -1;
375 completion_inline_delay = 0.2;
376 default_decimal_point = ".";
377 default_length_unit = Length::CM;
379 close_buffer_with_last_view = "yes";
385 void oldFontFormat(string & family, string & foundry)
387 if (family.empty() || family[0] != '-')
389 foundry = token(family, '-', 1);
390 family = token(family, '-', 2);
398 bool LyXRC::read(FileName const & filename, bool check_format)
400 Lexer lexrc(lyxrcTags);
401 lexrc.setFile(filename);
402 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
403 ReturnValues retval = read(lexrc, check_format);
404 if (!check_format || retval != FormatMismatch)
405 return retval == ReadOK;
407 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
408 FileName const tempfile = FileName::tempName("convert_lyxrc");
409 bool const success = prefs2prefs(filename, tempfile, false);
411 LYXERR0 ("Unable to convert " << filename.absFileName() <<
412 " to format " << LYXRC_FILEFORMAT);
415 // Keep this in the else branch, such that lexrc2 goes out
416 // of scope and releases the lock on tempfile before we
417 // attempt to remove it. This matters on Windows.
418 Lexer lexrc2(lyxrcTags);
419 lexrc2.setFile(tempfile);
420 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
421 retval = read(lexrc2, check_format);
423 tempfile.removeFile();
424 return retval == ReadOK;
428 // don't need to worry about conversion, because this is always
429 // from an internal source
430 bool LyXRC::read(istream & is)
432 Lexer lexrc(lyxrcTags);
434 LYXERR(Debug::LYXRC, "Reading istream...");
435 return read(lexrc, false) == ReadOK;
439 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
441 if (lyxerr.debugging(Debug::PARSER))
442 lexrc.printTable(lyxerr);
447 // default for current rowpainter capabilities
448 force_paint_single_char = true;
450 // format prior to 2.0 and introduction of format tag
451 unsigned int format = 0;
453 while (lexrc.isOK()) {
454 // By using two switches we take advantage of the compiler
455 // telling us if we have missed a LyXRCTags element in
456 // the second switch.
457 // Note that this also shows a problem with Lexer since it
458 // helps us avoid taking advantage of the strictness of the
461 int le = lexrc.lex();
463 case Lexer::LEX_UNDEF:
464 lexrc.printError("Unknown tag `$$Token'");
466 case Lexer::LEX_FEOF:
471 switch (static_cast<LyXRCTags>(le)) {
474 format = lexrc.getInteger();
476 case RC_INPUT: // Include file
479 libFileSearch(string(),
481 if (read(tmp, check_format)) {
483 "Error reading included file: " + tmp.absFileName());
489 bind_file = os::internal_path(lexrc.getString());
494 def_file = os::internal_path(lexrc.getString());
499 ui_file = os::internal_path(lexrc.getString());
502 case RC_AUTORESET_OPTIONS:
503 lexrc >> auto_reset_options;
506 case RC_DISPLAY_GRAPHICS:
508 display_graphics = lexrc.getString() == "true";
511 case RC_TEX_EXPECTS_WINDOWS_PATHS:
512 lexrc >> windows_style_tex_paths;
515 case RC_TEX_ALLOWS_SPACES:
516 lexrc >> tex_allows_spaces;
519 case RC_TEXINPUTS_PREFIX:
520 lexrc >> texinputs_prefix;
527 case RC_KBMAP_PRIMARY:
529 string const kmap(os::internal_path(lexrc.getString()));
530 if (!libFileSearch("kbd", kmap, "kmap").empty()
532 primary_kbmap = kmap;
534 lexrc.printError("LyX: Keymap `$$Token' not found");
539 case RC_KBMAP_SECONDARY:
541 string const kmap(os::internal_path(lexrc.getString()));
542 if (!libFileSearch("kbd", kmap, "kmap").empty()
544 secondary_kbmap = kmap;
546 lexrc.printError("LyX: Keymap `$$Token' not found");
551 case RC_FONT_ENCODING:
555 case RC_FORCE_PAINT_SINGLE_CHAR:
556 lexrc >> force_paint_single_char;
563 case RC_PRINT_COMMAND:
564 if (lexrc.next(true)) {
565 print_command = lexrc.getString();
569 case RC_PRINTEVENPAGEFLAG:
570 lexrc >> print_evenpage_flag;
573 case RC_PRINTODDPAGEFLAG:
574 lexrc >> print_oddpage_flag;
577 case RC_PRINTPAGERANGEFLAG:
578 lexrc >> print_pagerange_flag;
581 case RC_PRINTCOPIESFLAG:
582 lexrc >> print_copies_flag;
585 case RC_PRINTCOLLCOPIESFLAG:
586 lexrc >> print_collcopies_flag;
589 case RC_PRINTREVERSEFLAG:
590 lexrc >> print_reverse_flag;
593 case RC_PRINTLANDSCAPEFLAG:
594 lexrc >> print_landscape_flag;
597 case RC_PRINTTOPRINTER:
598 lexrc >> print_to_printer;
601 case RC_PRINT_ADAPTOUTPUT:
602 lexrc >> print_adapt_output;
607 print_to_file = os::internal_path(lexrc.getString());
611 case RC_PRINTFILEEXTENSION:
612 lexrc >> print_file_extension;
615 case RC_PRINTEXSTRAOPTIONS:
616 lexrc >> print_extra_options;
619 case RC_PRINTSPOOL_COMMAND:
620 if (lexrc.next(true)) {
621 print_spool_command = lexrc.getString();
625 case RC_PRINTSPOOL_PRINTERPREFIX:
626 lexrc >> print_spool_printerprefix;
629 case RC_PRINTPAPERDIMENSIONFLAG:
630 lexrc >> print_paper_dimension_flag;
633 case RC_PRINTPAPERFLAG:
634 lexrc >> print_paper_flag;
637 case RC_VIEWDVI_PAPEROPTION:
639 view_dvi_paper_option = lexrc.getString();
641 view_dvi_paper_option.erase();
644 case RC_CHKTEX_COMMAND:
645 if (lexrc.next(true)) {
646 chktex_command = lexrc.getString();
650 case RC_BIBTEX_ALTERNATIVES:
651 if (lexrc.next(true)) {
652 bibtex_alternatives.insert(lexrc.getString());
656 case RC_BIBTEX_COMMAND:
657 if (lexrc.next(true)) {
658 bibtex_command = lexrc.getString();
662 case RC_JBIBTEX_COMMAND:
663 if (lexrc.next(true)) {
664 jbibtex_command = lexrc.getString();
668 case RC_INDEX_ALTERNATIVES:
669 if (lexrc.next(true)) {
670 index_alternatives.insert(lexrc.getString());
674 case RC_INDEX_COMMAND:
675 if (lexrc.next(true)) {
676 index_command = lexrc.getString();
680 case RC_JINDEX_COMMAND:
681 if (lexrc.next(true)) {
682 jindex_command = lexrc.getString();
686 case RC_SPLITINDEX_COMMAND:
687 if (lexrc.next(true)) {
688 splitindex_command = lexrc.getString();
692 case RC_NOMENCL_COMMAND:
693 if (lexrc.next(true)) {
694 nomencl_command = lexrc.getString();
706 case RC_GEOMETRY_SESSION:
707 lexrc >> allow_geometry_session;
710 case RC_SCREEN_FONT_SIZES:
711 lexrc >> font_sizes[FONT_SIZE_TINY];
712 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
713 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
714 lexrc >> font_sizes[FONT_SIZE_SMALL];
715 lexrc >> font_sizes[FONT_SIZE_NORMAL];
716 lexrc >> font_sizes[FONT_SIZE_LARGE];
717 lexrc >> font_sizes[FONT_SIZE_LARGER];
718 lexrc >> font_sizes[FONT_SIZE_LARGEST];
719 lexrc >> font_sizes[FONT_SIZE_HUGE];
720 lexrc >> font_sizes[FONT_SIZE_HUGER];
723 case RC_SCREEN_FONT_SCALABLE:
724 lexrc >> use_scalable_fonts;
731 case RC_DOCUMENTPATH:
733 document_path = os::internal_path(lexrc.getString());
734 document_path = expandPath(document_path);
740 example_path = os::internal_path(lexrc.getString());
741 example_path = expandPath(example_path);
745 case RC_TEMPLATEPATH:
747 template_path = os::internal_path(lexrc.getString());
748 template_path = expandPath(template_path);
754 tempdir_path = os::internal_path(lexrc.getString());
755 tempdir_path = expandPath(tempdir_path);
759 case RC_THESAURUSDIRPATH:
761 thesaurusdir_path = os::internal_path(lexrc.getString());
762 thesaurusdir_path = expandPath(thesaurusdir_path);
766 case RC_HUNSPELLDIR_PATH:
768 hunspelldir_path = os::internal_path(lexrc.getString());
769 hunspelldir_path = expandPath(hunspelldir_path);
773 case RC_USELASTFILEPOS:
774 lexrc >> use_lastfilepos;
778 lexrc >> load_session;
781 case RC_MOUSE_WHEEL_SPEED:
782 lexrc >> mouse_wheel_speed;
785 case RC_COMPLETION_INLINE_DELAY:
786 lexrc >> completion_inline_delay;
789 case RC_COMPLETION_INLINE_MATH:
790 lexrc >> completion_inline_math;
793 case RC_COMPLETION_INLINE_TEXT:
794 lexrc >> completion_inline_text;
797 case RC_COMPLETION_INLINE_DOTS:
798 lexrc >> completion_inline_dots;
801 case RC_AUTOCORRECTION_MATH:
802 lexrc >> autocorrection_math;
805 case RC_COMPLETION_POPUP_DELAY:
806 lexrc >> completion_popup_delay;
809 case RC_COMPLETION_POPUP_MATH:
810 lexrc >> completion_popup_math;
813 case RC_COMPLETION_POPUP_TEXT:
814 lexrc >> completion_popup_text;
817 case RC_COMPLETION_CURSOR_TEXT:
818 lexrc >> completion_cursor_text;
821 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
822 lexrc >> completion_popup_after_complete;
825 case RC_COMPLETION_MINLENGTH:
826 lexrc >> completion_minlength;
829 case RC_NUMLASTFILES:
830 lexrc >> num_lastfiles;
833 case RC_CHECKLASTFILES:
834 lexrc >> check_lastfiles;
841 case RC_USE_SYSTEM_THEME_ICONS:
842 lexrc >> use_system_theme_icons;
845 case RC_SCREEN_FONT_ROMAN:
847 roman_font_name = lexrc.getString();
848 oldFontFormat(roman_font_name,
853 case RC_SCREEN_FONT_SANS:
855 sans_font_name = lexrc.getString();
856 oldFontFormat(sans_font_name, sans_font_foundry);
860 case RC_SCREEN_FONT_TYPEWRITER:
862 typewriter_font_name = lexrc.getString();
863 oldFontFormat(typewriter_font_name,
864 typewriter_font_foundry);
868 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
869 lexrc >> roman_font_foundry;
872 case RC_SCREEN_FONT_SANS_FOUNDRY:
873 lexrc >> sans_font_foundry;
876 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
877 lexrc >> typewriter_font_foundry;
882 lexrc.printError("Missing color tag.");
885 string lyx_name = lexrc.getString();
888 lexrc.printError("Missing color name for color: `$$Token'");
891 string x11_name = lexrc.getString();
893 ColorCode const col =
894 lcolor.getFromLyXName(lyx_name);
895 if (col == Color_none ||
896 col == Color_inherit ||
900 if (!lcolor.setColor(col, x11_name))
901 LYXERR0("Bad lyxrc set_color for " << lyx_name);
905 case RC_AUTOREGIONDELETE:
906 // Auto region delete defaults to true
907 lexrc >> auto_region_delete;
912 lyxpipes = os::internal_path(lexrc.getString());
913 lyxpipes = expandPath(lyxpipes);
917 case RC_CURSOR_FOLLOWS_SCROLLBAR:
918 lexrc >> cursor_follows_scrollbar;
921 case RC_CURSOR_WIDTH:
922 lexrc >> cursor_width;
925 case RC_SCROLL_BELOW_DOCUMENT:
926 lexrc >> scroll_below_document;
929 case RC_PARAGRAPH_MARKERS:
930 lexrc >> paragraph_markers;
933 case RC_MAC_DONTSWAP_CTRL_META:
934 lexrc >> mac_dontswap_ctrl_meta;
937 case RC_MAC_LIKE_CURSOR_MOVEMENT:
938 lexrc >> mac_like_cursor_movement;
941 case RC_MACRO_EDIT_STYLE:
943 switch (lexrc.getInteger()) {
944 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
945 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
946 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
951 case RC_DIALOGS_ICONIFY_WITH_MAIN:
952 lexrc >> dialogs_iconify_with_main;
955 case RC_PLAINTEXT_LINELEN:
956 lexrc >> plaintext_linelen;
958 // Spellchecker settings:
959 case RC_ACCEPT_COMPOUND:
960 lexrc >> spellchecker_accept_compound;
962 case RC_USE_SYSTEM_COLORS:
963 lexrc >> use_system_colors;
966 lexrc >> use_tooltip;
968 case RC_USE_PIXMAP_CACHE:
969 lexrc >> use_pixmap_cache;
974 case RC_SPELLCHECKER:
975 lexrc >> spellchecker;
978 lexrc >> spellchecker_alt_lang;
981 lexrc >> spellchecker_esc_chars;
983 case RC_SPELLCHECK_CONTINUOUSLY:
984 lexrc >> spellcheck_continuously;
986 case RC_SPELLCHECK_NOTES:
987 lexrc >> spellcheck_notes;
990 lexrc >> make_backup;
992 case RC_SAVE_COMPRESSED:
993 lexrc >> save_compressed;
995 case RC_BACKUPDIR_PATH:
997 backupdir_path = os::internal_path(lexrc.getString());
998 backupdir_path = expandPath(backupdir_path);
1001 case RC_DEFAULT_DECIMAL_POINT:
1002 lexrc >> default_decimal_point;
1004 case RC_DEFAULT_LENGTH_UNIT:
1006 default_length_unit = (Length::UNIT) lexrc.getInteger();
1008 case RC_DATE_INSERT_FORMAT:
1009 lexrc >> date_insert_format;
1011 case RC_LANGUAGE_CUSTOM_PACKAGE:
1012 lexrc >> language_custom_package;
1014 case RC_LANGUAGE_AUTO_BEGIN:
1015 lexrc >> language_auto_begin;
1017 case RC_LANGUAGE_AUTO_END:
1018 lexrc >> language_auto_end;
1020 case RC_LANGUAGE_GLOBAL_OPTIONS:
1021 lexrc >> language_global_options;
1023 case RC_LANGUAGE_PACKAGE_SELECTION:
1025 switch (lexrc.getInteger()) {
1027 language_package_selection = LP_AUTO;
1030 language_package_selection = LP_BABEL;
1033 language_package_selection = LP_CUSTOM;
1036 language_package_selection = LP_NONE;
1041 case RC_LANGUAGE_COMMAND_BEGIN:
1042 lexrc >> language_command_begin;
1044 case RC_LANGUAGE_COMMAND_END:
1045 lexrc >> language_command_end;
1047 case RC_LANGUAGE_COMMAND_LOCAL:
1048 lexrc >> language_command_local;
1050 case RC_RTL_SUPPORT:
1051 lexrc >> rtl_support;
1053 case RC_VISUAL_CURSOR:
1054 lexrc >> visual_cursor;
1056 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
1057 lexrc >> close_buffer_with_last_view;
1059 case RC_AUTO_NUMBER:
1060 lexrc >> auto_number;
1062 case RC_MARK_FOREIGN_LANGUAGE:
1063 lexrc >> mark_foreign_language;
1067 string fmt, command;
1069 fmt = lexrc.getString();
1070 if (lexrc.next(true))
1071 command = lexrc.getString();
1072 setMover(fmt, command);
1076 case RC_CONVERTER: {
1077 string from, to, command, flags;
1079 from = lexrc.getString();
1081 to = lexrc.getString();
1082 if (lexrc.next(true))
1083 command = lexrc.getString();
1085 flags = lexrc.getString();
1086 if (command.empty())
1087 theConverters().erase(from, to);
1089 theConverters().add(from, to, command, flags);
1092 // compatibility with versions older than 1.4.0 only
1094 string format, command;
1095 lexrc >> format >> command;
1096 formats.setViewer(format, command);
1099 case RC_FILEFORMAT: {
1101 string format, extensions, prettyname, shortcut;
1102 if (!(lexrc >> format >> extensions))
1104 if (ok && lexrc.next(true))
1105 prettyname = lexrc.getString();
1109 if(!(lexrc >> shortcut))
1111 string viewer, editor;
1112 if (ok && lexrc.next(true))
1113 viewer = lexrc.getString();
1116 if (ok && lexrc.next(true))
1117 editor = lexrc.getString();
1121 if (!(lexrc >> flags >> mime))
1123 int flgs = Format::none;
1124 while (!flags.empty()) {
1126 flags = split(flags, flag, ',');
1127 if (flag == "document")
1128 flgs |= Format::document;
1129 else if (flag == "vector")
1130 flgs |= Format::vector;
1131 else if (flag == "zipped=native")
1132 flgs |= Format::zipped_native;
1133 else if (flag == "menu=export")
1134 flgs |= Format::export_menu;
1136 LYXERR0("Ignoring unknown flag `"
1137 << flag << "' for format `"
1141 LYXERR0("Syntax error in format " << format);
1142 else if (prettyname.empty()) {
1143 if (theConverters().formatIsUsed(format))
1144 LYXERR0("Can't delete format " << format);
1146 formats.erase(format);
1148 formats.add(format, extensions, prettyname,
1149 shortcut, viewer, editor, mime, flgs);
1153 case RC_VIEWER_ALTERNATIVES: {
1154 string format, command;
1157 viewer_alternatives[format].insert(command);
1160 case RC_EDITOR_ALTERNATIVES: {
1161 string format, command;
1164 editor_alternatives[format].insert(command);
1168 case RC_DEFAULT_OTF_VIEW_FORMAT:
1169 lexrc >> default_otf_view_format;
1172 case RC_DEFAULT_VIEW_FORMAT:
1173 lexrc >> default_view_format;
1176 case RC_GUI_LANGUAGE:
1177 lexrc >> gui_language;
1180 case RC_SHOW_BANNER:
1181 lexrc >> show_banner;
1186 string const tmp = lexrc.getString();
1187 if (tmp == "true" || tmp == "on")
1188 preview = PREVIEW_ON;
1189 else if (tmp == "no_math")
1190 preview = PREVIEW_NO_MATH;
1192 preview = PREVIEW_OFF;
1193 if (tmp != "false" && tmp != "off")
1194 LYXERR0("Unrecognized preview status \""
1200 case RC_PREVIEW_HASHED_LABELS:
1201 lexrc >> preview_hashed_labels;
1204 case RC_PREVIEW_SCALE_FACTOR:
1205 lexrc >> preview_scale_factor;
1212 lexrc >> user_email;
1215 case RC_PATH_PREFIX:
1216 lexrc >> path_prefix;
1219 case RC_USE_CONVERTER_CACHE:
1220 lexrc >> use_converter_cache;
1222 case RC_CONVERTER_CACHE_MAXAGE:
1223 lexrc >> converter_cache_maxage;
1226 case RC_SORT_LAYOUTS:
1227 lexrc >> sort_layouts;
1229 case RC_GROUP_LAYOUTS:
1230 lexrc >> group_layouts;
1232 case RC_FULL_SCREEN_LIMIT:
1233 lexrc >> full_screen_limit;
1235 case RC_FULL_SCREEN_TOOLBARS:
1236 lexrc >> full_screen_toolbars;
1238 case RC_FULL_SCREEN_SCROLLBAR:
1239 lexrc >> full_screen_scrollbar;
1241 case RC_FULL_SCREEN_STATUSBAR:
1242 lexrc >> full_screen_statusbar;
1244 case RC_FULL_SCREEN_TABBAR:
1245 lexrc >> full_screen_tabbar;
1247 case RC_FULL_SCREEN_MENUBAR:
1248 lexrc >> full_screen_menubar;
1250 case RC_FULL_SCREEN_WIDTH:
1251 lexrc >> full_screen_width;
1253 case RC_OPEN_BUFFERS_IN_TABS:
1254 lexrc >> open_buffers_in_tabs;
1256 case RC_SINGLE_CLOSE_TAB_BUTTON:
1257 lexrc >> single_close_tab_button;
1259 case RC_SINGLE_INSTANCE:
1260 lexrc >> single_instance;
1261 if (run_mode == PREFERRED)
1262 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1264 case RC_FORWARD_SEARCH_DVI:
1265 if (lexrc.next(true))
1266 forward_search_dvi = lexrc.getString();
1268 case RC_FORWARD_SEARCH_PDF:
1269 if (lexrc.next(true))
1270 forward_search_pdf = lexrc.getString();
1272 case RC_EXPORT_OVERWRITE:
1274 string const tmp = lexrc.getString();
1275 if (tmp == "all" || tmp == "true")
1276 export_overwrite = ALL_FILES;
1277 else if (tmp == "main")
1278 export_overwrite = MAIN_FILE;
1280 export_overwrite = NO_FILES;
1281 if (tmp != "ask" && tmp != "false")
1282 LYXERR0("Unrecognized export_overwrite status \""
1287 case RC_SCROLL_WHEEL_ZOOM:
1289 string const tmp = lexrc.getString();
1291 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1292 else if (tmp == "shift")
1293 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1294 else if (tmp == "alt")
1295 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1297 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1298 if (tmp != "off" && tmp != "false")
1299 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1306 break; // this is just a dummy
1309 // This is triggered the first time through the loop unless
1310 // we hit a format tag.
1311 if (check_format && format != LYXRC_FILEFORMAT)
1312 return FormatMismatch;
1315 /// Update converters data-structures
1316 theConverters().update(formats);
1317 theConverters().buildGraph();
1323 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1325 ofstream ofs(filename.toFilesystemEncoding().c_str());
1327 write(ofs, ignore_system_lyxrc);
1331 void LyXRC::print() const
1333 if (lyxerr.debugging())
1334 write(lyxerr, false);
1342 typedef pair<string, SpecialisedMover> Data;
1344 SameMover(Data const & comparison)
1345 : comparison_(comparison) {}
1347 bool operator()(Data const & data) const
1349 return data.first == comparison_.first &&
1350 data.second.command() == comparison_.second.command();
1360 // Escape \ and " so that LyXLex can read the string later
1361 string escapeCommand(string const & str) {
1362 return subst(subst(str , "\\", "\\\\"),
1369 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1371 LyXRCTags tag = RC_LAST;
1373 if (!name.empty()) {
1374 for (int i = 0; i != lyxrcCount; ++i)
1375 if ("\\" + name == lyxrcTags[i].tag)
1376 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1380 os << "# LyX " << lyx_version
1381 << " generated this file. If you want to make your own\n"
1382 << "# modifications you should do them from inside LyX and save.\n\n"
1383 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1385 // Why the switch you might ask. It is a trick to ensure that all
1386 // the elements in the LyXRCTags enum are handled. As you can see
1387 // there are no breaks at all. So it is just a huge fall-through.
1388 // The nice thing is that we will get a warning from the compiler
1389 // if we forget an element.
1393 // input/include files are not done here
1394 case RC_LYXRCFORMAT:
1396 if (ignore_system_lyxrc ||
1397 bind_file != system_lyxrc.bind_file) {
1398 string const path = os::external_path(bind_file);
1399 os << "\\bind_file \"" << path << "\"\n";
1405 if (ignore_system_lyxrc ||
1406 def_file != system_lyxrc.def_file) {
1407 string const path = os::external_path(def_file);
1408 os << "\\def_file \"" << path << "\"\n";
1417 << "# MISC SECTION ######################################\n"
1419 // bind files are not done here.
1421 case RC_PATH_PREFIX:
1422 if (ignore_system_lyxrc ||
1423 path_prefix != system_lyxrc.path_prefix) {
1424 os << "\\path_prefix \"" << path_prefix << "\"\n";
1429 if (ignore_system_lyxrc ||
1430 ui_file != system_lyxrc.ui_file) {
1431 string const path = os::external_path(ui_file);
1432 os << "\\ui_file \"" << path << "\"\n";
1436 case RC_AUTOREGIONDELETE:
1437 if (ignore_system_lyxrc ||
1438 auto_region_delete != system_lyxrc.auto_region_delete) {
1439 os << "# Set to false to inhibit automatic replacement of\n"
1440 << "# the current selection.\n"
1441 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1446 case RC_AUTORESET_OPTIONS:
1447 if (ignore_system_lyxrc ||
1448 auto_reset_options != system_lyxrc.auto_reset_options) {
1449 os << "# Set to false to inhibit automatic reset of\n"
1450 << "# the class options to defaults on class change.\n"
1451 << "\\auto_reset_options "
1452 << convert<string>(auto_reset_options)
1458 if (ignore_system_lyxrc ||
1459 autosave != system_lyxrc.autosave) {
1460 os << "# The time interval between auto-saves in seconds.\n"
1461 << "\\autosave " << autosave << '\n';
1465 case RC_DISPLAY_GRAPHICS:
1466 if (ignore_system_lyxrc ||
1467 display_graphics != system_lyxrc.display_graphics) {
1468 os << "# Display graphics within LyX\n"
1470 << "\\display_graphics "
1471 << (display_graphics ? "true" : "false")
1476 case RC_SORT_LAYOUTS:
1477 if (ignore_system_lyxrc ||
1478 sort_layouts != system_lyxrc.sort_layouts) {
1479 os << "# Sort layouts alphabetically.\n"
1480 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1484 case RC_GROUP_LAYOUTS:
1485 if (ignore_system_lyxrc ||
1486 group_layouts != system_lyxrc.group_layouts) {
1487 os << "# Group layouts by their category.\n"
1488 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1492 case RC_VIEWDVI_PAPEROPTION:
1493 if (ignore_system_lyxrc ||
1494 view_dvi_paper_option
1495 != system_lyxrc.view_dvi_paper_option) {
1496 os << "# Options used to specify paper size to the\n"
1497 << "# view_dvi_command (e.g. -paper)\n"
1498 << "\\view_dvi_paper_option \""
1499 << view_dvi_paper_option << "\"\n";
1503 case RC_CHKTEX_COMMAND:
1504 if (ignore_system_lyxrc ||
1505 chktex_command != system_lyxrc.chktex_command) {
1506 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1510 case RC_BIBTEX_ALTERNATIVES: {
1511 CommandSet::const_iterator it = bibtex_alternatives.begin();
1512 CommandSet::const_iterator end = bibtex_alternatives.end();
1513 for ( ; it != end; ++it) {
1514 if (ignore_system_lyxrc
1515 || !system_lyxrc.bibtex_alternatives.count(*it))
1516 os << "\\bibtex_alternatives \""
1522 case RC_BIBTEX_COMMAND:
1523 if (ignore_system_lyxrc ||
1524 bibtex_command != system_lyxrc.bibtex_command) {
1525 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1529 case RC_JBIBTEX_COMMAND:
1530 if (ignore_system_lyxrc ||
1531 jbibtex_command != system_lyxrc.jbibtex_command) {
1532 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1536 case RC_INDEX_ALTERNATIVES: {
1537 CommandSet::const_iterator it = index_alternatives.begin();
1538 CommandSet::const_iterator end = index_alternatives.end();
1539 for ( ; it != end; ++it) {
1540 if (ignore_system_lyxrc
1541 || !system_lyxrc.index_alternatives.count(*it))
1542 os << "\\index_alternatives \""
1548 case RC_INDEX_COMMAND:
1549 if (ignore_system_lyxrc ||
1550 index_command != system_lyxrc.index_command) {
1551 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1555 case RC_JINDEX_COMMAND:
1556 if (ignore_system_lyxrc ||
1557 jindex_command != system_lyxrc.jindex_command) {
1558 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1562 case RC_SPLITINDEX_COMMAND:
1563 if (ignore_system_lyxrc ||
1564 splitindex_command != system_lyxrc.splitindex_command) {
1565 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1569 case RC_NOMENCL_COMMAND:
1570 if (ignore_system_lyxrc ||
1571 nomencl_command != system_lyxrc.nomencl_command) {
1572 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1576 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1577 // Don't write this setting to the preferences file,
1578 // but allow temporary changes (bug 7557).
1579 if (ignore_system_lyxrc) {
1580 os << "\\tex_expects_windows_paths "
1581 << convert<string>(windows_style_tex_paths) << '\n';
1585 case RC_TEX_ALLOWS_SPACES:
1586 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1587 os << "\\tex_allows_spaces "
1588 << convert<string>(tex_allows_spaces) << '\n';
1593 if (ignore_system_lyxrc ||
1594 use_kbmap != system_lyxrc.use_kbmap) {
1595 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1599 case RC_KBMAP_PRIMARY:
1600 if (ignore_system_lyxrc ||
1601 primary_kbmap != system_lyxrc.primary_kbmap) {
1602 string const path = os::external_path(primary_kbmap);
1603 os << "\\kbmap_primary \"" << path << "\"\n";
1607 case RC_KBMAP_SECONDARY:
1608 if (ignore_system_lyxrc ||
1609 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1610 string const path = os::external_path(secondary_kbmap);
1611 os << "\\kbmap_secondary \"" << path << "\"\n";
1616 if (ignore_system_lyxrc ||
1617 lyxpipes != system_lyxrc.lyxpipes) {
1618 string const path = os::external_path(lyxpipes);
1619 os << "\\serverpipe \"" << path << "\"\n";
1623 case RC_DATE_INSERT_FORMAT:
1624 if (ignore_system_lyxrc ||
1625 date_insert_format != system_lyxrc.date_insert_format) {
1626 os << "\\date_insert_format \"" << date_insert_format
1633 os << "\\user_name \"" << user_name << "\"\n";
1638 os << "\\user_email \"" << user_email << "\"\n";
1642 case RC_SHOW_BANNER:
1643 if (ignore_system_lyxrc ||
1644 show_banner != system_lyxrc.show_banner) {
1645 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1651 if (ignore_system_lyxrc ||
1652 preview != system_lyxrc.preview) {
1658 case PREVIEW_NO_MATH:
1665 os << "\\preview " << status << '\n';
1670 case RC_PREVIEW_HASHED_LABELS:
1671 if (ignore_system_lyxrc ||
1672 preview_hashed_labels !=
1673 system_lyxrc.preview_hashed_labels) {
1674 os << "\\preview_hashed_labels "
1675 << convert<string>(preview_hashed_labels) << '\n';
1680 case RC_PREVIEW_SCALE_FACTOR:
1681 if (ignore_system_lyxrc ||
1682 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1683 os << "\\preview_scale_factor "
1684 << preview_scale_factor << '\n';
1689 case RC_USE_CONVERTER_CACHE:
1690 if (ignore_system_lyxrc ||
1691 use_converter_cache != system_lyxrc.use_converter_cache) {
1692 os << "\\use_converter_cache "
1693 << convert<string>(use_converter_cache) << '\n';
1698 case RC_CONVERTER_CACHE_MAXAGE:
1699 if (ignore_system_lyxrc ||
1700 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1701 os << "\\converter_cache_maxage "
1702 << converter_cache_maxage << '\n';
1708 << "# SCREEN & FONTS SECTION ############################\n"
1712 if (ignore_system_lyxrc ||
1713 icon_set != system_lyxrc.icon_set) {
1714 os << "\\icon_set \"" << icon_set
1720 case RC_USE_SYSTEM_THEME_ICONS:
1721 if (ignore_system_lyxrc ||
1722 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1723 os << "\\use_system_theme_icons "
1724 << convert<string>(use_system_theme_icons)
1731 if (ignore_system_lyxrc ||
1732 dpi != system_lyxrc.dpi) {
1733 os << "\\screen_dpi " << dpi << '\n';
1737 case RC_SCREEN_ZOOM:
1738 if (ignore_system_lyxrc ||
1739 zoom != system_lyxrc.zoom) {
1740 os << "\\screen_zoom " << zoom << '\n';
1744 case RC_GEOMETRY_SESSION:
1745 if (ignore_system_lyxrc ||
1746 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1747 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1752 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1753 if (ignore_system_lyxrc ||
1754 cursor_follows_scrollbar
1755 != system_lyxrc.cursor_follows_scrollbar) {
1756 os << "\\cursor_follows_scrollbar "
1757 << convert<string>(cursor_follows_scrollbar) << '\n';
1761 case RC_CURSOR_WIDTH:
1762 if (ignore_system_lyxrc ||
1764 != system_lyxrc.cursor_width) {
1765 os << "\\cursor_width "
1766 << cursor_width << '\n';
1770 case RC_SCROLL_BELOW_DOCUMENT:
1771 if (ignore_system_lyxrc ||
1772 scroll_below_document
1773 != system_lyxrc.scroll_below_document) {
1774 os << "\\scroll_below_document "
1775 << convert<string>(scroll_below_document) << '\n';
1779 case RC_PARAGRAPH_MARKERS:
1780 if (ignore_system_lyxrc ||
1782 != system_lyxrc.paragraph_markers) {
1783 os << "\\paragraph_markers "
1784 << convert<string>(paragraph_markers) << '\n';
1788 case RC_MAC_DONTSWAP_CTRL_META:
1789 if (ignore_system_lyxrc ||
1790 mac_dontswap_ctrl_meta
1791 != system_lyxrc.mac_dontswap_ctrl_meta) {
1792 os << "\\mac_dontswap_ctrl_meta "
1793 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1797 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1798 if (ignore_system_lyxrc ||
1799 mac_like_cursor_movement
1800 != system_lyxrc.mac_like_cursor_movement) {
1801 os << "\\mac_like_cursor_movement "
1802 << convert<string>(mac_like_cursor_movement) << '\n';
1806 case RC_MACRO_EDIT_STYLE:
1807 if (ignore_system_lyxrc ||
1809 != system_lyxrc.macro_edit_style) {
1810 os << "\\macro_edit_style ";
1811 switch (macro_edit_style) {
1812 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1813 case MACRO_EDIT_INLINE: os << "1\n"; break;
1814 case MACRO_EDIT_LIST: os << "2\n"; break;
1819 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1820 if (ignore_system_lyxrc ||
1821 dialogs_iconify_with_main
1822 != system_lyxrc.dialogs_iconify_with_main) {
1823 os << "\\dialogs_iconify_with_main "
1824 << convert<string>(dialogs_iconify_with_main) << '\n';
1828 case RC_SCREEN_FONT_ROMAN:
1829 if (ignore_system_lyxrc ||
1830 roman_font_name != system_lyxrc.roman_font_name) {
1831 os << "\\screen_font_roman \"" << roman_font_name
1836 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1837 if (ignore_system_lyxrc ||
1838 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1839 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1844 case RC_SCREEN_FONT_SANS:
1845 if (ignore_system_lyxrc ||
1846 sans_font_name != system_lyxrc.sans_font_name) {
1847 os << "\\screen_font_sans \"" << sans_font_name
1852 case RC_SCREEN_FONT_SANS_FOUNDRY:
1853 if (ignore_system_lyxrc ||
1854 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1855 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1860 case RC_SCREEN_FONT_TYPEWRITER:
1861 if (ignore_system_lyxrc ||
1862 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1863 os << "\\screen_font_typewriter \""
1864 << typewriter_font_name << "\"\n";
1868 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1869 if (ignore_system_lyxrc ||
1870 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1871 os << "\\screen_font_typewriter_foundry \""
1872 << typewriter_font_foundry << "\"\n";
1877 case RC_SCREEN_FONT_SCALABLE:
1878 if (ignore_system_lyxrc ||
1879 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1880 os << "\\screen_font_scalable "
1881 << convert<string>(use_scalable_fonts)
1886 case RC_SCREEN_FONT_SIZES:
1887 if (ignore_system_lyxrc ||
1888 font_sizes[FONT_SIZE_TINY]
1889 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1890 font_sizes[FONT_SIZE_SCRIPT]
1891 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1892 font_sizes[FONT_SIZE_FOOTNOTE]
1893 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1894 font_sizes[FONT_SIZE_SMALL]
1895 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1896 font_sizes[FONT_SIZE_NORMAL]
1897 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1898 font_sizes[FONT_SIZE_LARGE]
1899 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1900 font_sizes[FONT_SIZE_LARGER]
1901 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1902 font_sizes[FONT_SIZE_LARGEST]
1903 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1904 font_sizes[FONT_SIZE_HUGE]
1905 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1906 font_sizes[FONT_SIZE_HUGER]
1907 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1908 os.setf(ios::fixed);
1910 os << "\\screen_font_sizes"
1911 << ' ' << font_sizes[FONT_SIZE_TINY]
1912 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1913 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1914 << ' ' << font_sizes[FONT_SIZE_SMALL]
1915 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1916 << ' ' << font_sizes[FONT_SIZE_LARGE]
1917 << ' ' << font_sizes[FONT_SIZE_LARGER]
1918 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1919 << ' ' << font_sizes[FONT_SIZE_HUGE]
1920 << ' ' << font_sizes[FONT_SIZE_HUGER]
1925 case RC_FULL_SCREEN_LIMIT:
1926 if (ignore_system_lyxrc ||
1927 full_screen_limit != system_lyxrc.full_screen_limit) {
1928 os << "\\fullscreen_limit "
1929 << convert<string>(full_screen_limit)
1934 case RC_FULL_SCREEN_TOOLBARS:
1935 if (ignore_system_lyxrc ||
1936 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1937 os << "\\fullscreen_toolbars "
1938 << convert<string>(full_screen_toolbars)
1943 case RC_FULL_SCREEN_SCROLLBAR:
1944 if (ignore_system_lyxrc ||
1945 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1946 os << "\\fullscreen_scrollbar "
1947 << convert<string>(full_screen_scrollbar)
1952 case RC_FULL_SCREEN_STATUSBAR:
1953 if (ignore_system_lyxrc ||
1954 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1955 os << "\\fullscreen_statusbar "
1956 << convert<string>(full_screen_statusbar)
1961 case RC_FULL_SCREEN_TABBAR:
1962 if (ignore_system_lyxrc ||
1963 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1964 os << "\\fullscreen_tabbar "
1965 << convert<string>(full_screen_tabbar)
1970 case RC_FULL_SCREEN_MENUBAR:
1971 if (ignore_system_lyxrc ||
1972 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1973 os << "\\fullscreen_menubar "
1974 << convert<string>(full_screen_menubar)
1979 case RC_FULL_SCREEN_WIDTH:
1980 if (ignore_system_lyxrc ||
1981 full_screen_width != system_lyxrc.full_screen_width) {
1982 os << "\\fullscreen_width "
1983 << convert<string>(full_screen_width)
1988 case RC_OPEN_BUFFERS_IN_TABS:
1989 if (ignore_system_lyxrc ||
1990 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1991 os << "\\open_buffers_in_tabs "
1992 << convert<string>(open_buffers_in_tabs)
1997 case RC_SINGLE_CLOSE_TAB_BUTTON:
1998 if (ignore_system_lyxrc ||
1999 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2000 os << "\\single_close_tab_button "
2001 << convert<string>(single_close_tab_button)
2006 case RC_SINGLE_INSTANCE:
2007 if (ignore_system_lyxrc ||
2008 single_instance != system_lyxrc.single_instance) {
2009 os << "\\single_instance "
2010 << convert<string>(single_instance)
2015 case RC_FORWARD_SEARCH_DVI:
2016 if (ignore_system_lyxrc ||
2017 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2018 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2022 case RC_FORWARD_SEARCH_PDF:
2023 if (ignore_system_lyxrc ||
2024 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2025 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2031 << "# COLOR SECTION ###################################\n"
2035 for (int i = 0; i < Color_ignore; ++i) {
2036 ColorCode lc = static_cast<ColorCode>(i);
2037 string const col = lcolor.getX11Name(lc);
2038 if (ignore_system_lyxrc
2039 || col != system_lcolor.getX11Name(lc)) {
2040 os << "\\set_color \""
2041 << lcolor.getLyXName(lc) << "\" \""
2049 << "# PRINTER SECTION ###################################\n"
2053 if (ignore_system_lyxrc ||
2054 printer != system_lyxrc.printer) {
2055 os << "\\printer \"" << printer << "\"\n";
2059 case RC_PRINT_ADAPTOUTPUT:
2060 if (ignore_system_lyxrc ||
2061 print_adapt_output != system_lyxrc.print_adapt_output) {
2062 os << "\\print_adapt_output "
2063 << convert<string>(print_adapt_output)
2068 case RC_PRINT_COMMAND:
2069 if (ignore_system_lyxrc ||
2070 print_command != system_lyxrc.print_command) {
2071 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2075 case RC_PRINTEXSTRAOPTIONS:
2076 if (ignore_system_lyxrc ||
2077 print_extra_options != system_lyxrc.print_extra_options) {
2078 os << "\\print_extra_options \"" << print_extra_options
2083 case RC_PRINTSPOOL_COMMAND:
2084 if (ignore_system_lyxrc ||
2085 print_spool_command != system_lyxrc.print_spool_command) {
2086 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2091 case RC_PRINTSPOOL_PRINTERPREFIX:
2092 if (ignore_system_lyxrc ||
2093 print_spool_printerprefix
2094 != system_lyxrc.print_spool_printerprefix) {
2095 os << "\\print_spool_printerprefix \""
2096 << print_spool_printerprefix << "\"\n";
2100 case RC_PRINTEVENPAGEFLAG:
2101 if (ignore_system_lyxrc ||
2102 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2103 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2108 case RC_PRINTODDPAGEFLAG:
2109 if (ignore_system_lyxrc ||
2110 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2111 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2116 case RC_PRINTREVERSEFLAG:
2117 if (ignore_system_lyxrc ||
2118 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2119 os << "\\print_reverse_flag \"" << print_reverse_flag
2124 case RC_PRINTLANDSCAPEFLAG:
2125 if (ignore_system_lyxrc ||
2126 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2127 os << "\\print_landscape_flag \"" << print_landscape_flag
2132 case RC_PRINTPAGERANGEFLAG:
2133 if (ignore_system_lyxrc ||
2134 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2135 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2140 case RC_PRINTCOPIESFLAG:
2141 if (ignore_system_lyxrc ||
2142 print_copies_flag != system_lyxrc.print_copies_flag) {
2143 os << "\\print_copies_flag \"" << print_copies_flag
2148 case RC_PRINTCOLLCOPIESFLAG:
2149 if (ignore_system_lyxrc ||
2150 print_collcopies_flag
2151 != system_lyxrc.print_collcopies_flag) {
2152 os << "\\print_collcopies_flag \""
2153 << print_collcopies_flag
2158 case RC_PRINTPAPERFLAG:
2159 if (ignore_system_lyxrc ||
2160 print_paper_flag != system_lyxrc.print_paper_flag) {
2161 os << "\\print_paper_flag \"" << print_paper_flag
2166 case RC_PRINTPAPERDIMENSIONFLAG:
2167 if (ignore_system_lyxrc ||
2168 print_paper_dimension_flag
2169 != system_lyxrc.print_paper_dimension_flag) {
2170 os << "\\print_paper_dimension_flag \""
2171 << print_paper_dimension_flag << "\"\n";
2175 case RC_PRINTTOPRINTER:
2176 if (ignore_system_lyxrc ||
2177 print_to_printer != system_lyxrc.print_to_printer) {
2178 os << "\\print_to_printer \"" << print_to_printer
2183 case RC_PRINTTOFILE:
2184 if (ignore_system_lyxrc ||
2185 print_to_file != system_lyxrc.print_to_file) {
2186 string const path = os::external_path(print_to_file);
2187 os << "\\print_to_file \"" << path << "\"\n";
2191 case RC_PRINTFILEEXTENSION:
2192 if (ignore_system_lyxrc ||
2193 print_file_extension != system_lyxrc.print_file_extension) {
2194 os << "\\print_file_extension \""
2195 << print_file_extension
2202 << "# TEX SECTION #######################################\n"
2205 case RC_TEXINPUTS_PREFIX:
2206 if (ignore_system_lyxrc ||
2207 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2208 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2213 case RC_FONT_ENCODING:
2214 if (ignore_system_lyxrc ||
2215 fontenc != system_lyxrc.fontenc) {
2216 os << "\\font_encoding \"" << fontenc << "\"\n";
2221 case RC_FORCE_PAINT_SINGLE_CHAR:
2222 if (ignore_system_lyxrc ||
2223 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2224 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2230 << "# FILE SECTION ######################################\n"
2233 case RC_DOCUMENTPATH:
2234 if (ignore_system_lyxrc ||
2235 document_path != system_lyxrc.document_path) {
2236 string const path = os::external_path(document_path);
2237 os << "\\document_path \"" << path << "\"\n";
2241 case RC_USELASTFILEPOS:
2242 if (ignore_system_lyxrc ||
2243 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2244 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2249 case RC_LOADSESSION:
2250 if (ignore_system_lyxrc ||
2251 load_session != system_lyxrc.load_session) {
2252 os << "\\load_session " << convert<string>(load_session)
2257 case RC_MOUSE_WHEEL_SPEED:
2258 if (ignore_system_lyxrc ||
2259 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2260 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2264 case RC_COMPLETION_INLINE_DELAY:
2265 if (ignore_system_lyxrc ||
2266 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2267 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2271 case RC_COMPLETION_INLINE_MATH:
2272 if (ignore_system_lyxrc ||
2273 completion_inline_math != system_lyxrc.completion_inline_math) {
2274 os << "\\completion_inline_math "
2275 << convert<string>(completion_inline_math) << '\n';
2279 case RC_COMPLETION_INLINE_TEXT:
2280 if (ignore_system_lyxrc ||
2281 completion_inline_text != system_lyxrc.completion_inline_text) {
2282 os << "\\completion_inline_text "
2283 << convert<string>(completion_inline_text) << '\n';
2287 case RC_COMPLETION_INLINE_DOTS:
2288 if (ignore_system_lyxrc ||
2289 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2290 os << "\\completion_inline_dots "
2291 << convert<string>(completion_inline_dots) << '\n';
2295 case RC_AUTOCORRECTION_MATH:
2296 if (ignore_system_lyxrc ||
2297 autocorrection_math != system_lyxrc.autocorrection_math) {
2298 os << "\\autocorrection_math "
2299 << convert<string>(autocorrection_math) << '\n';
2303 case RC_COMPLETION_POPUP_DELAY:
2304 if (ignore_system_lyxrc ||
2305 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2306 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2310 case RC_COMPLETION_POPUP_MATH:
2311 if (ignore_system_lyxrc ||
2312 completion_popup_math != system_lyxrc.completion_popup_math) {
2313 os << "\\completion_popup_math "
2314 << convert<string>(completion_popup_math) << '\n';
2318 case RC_COMPLETION_POPUP_TEXT:
2319 if (ignore_system_lyxrc ||
2320 completion_popup_text != system_lyxrc.completion_popup_text) {
2321 os << "\\completion_popup_text "
2322 << convert<string>(completion_popup_text) << '\n';
2326 case RC_COMPLETION_CURSOR_TEXT:
2327 if (ignore_system_lyxrc ||
2328 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2329 os << "\\completion_cursor_text "
2330 << convert<string>(completion_cursor_text) << '\n';
2334 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2335 if (ignore_system_lyxrc ||
2336 completion_popup_after_complete
2337 != system_lyxrc.completion_popup_after_complete) {
2338 os << "\\completion_popup_after_complete "
2339 << convert<string>(completion_popup_after_complete) << '\n';
2343 case RC_COMPLETION_MINLENGTH:
2344 if (ignore_system_lyxrc ||
2345 completion_minlength != system_lyxrc.completion_minlength) {
2346 os << "\\completion_minlength " << convert<string>(completion_minlength)
2352 case RC_NUMLASTFILES:
2353 if (ignore_system_lyxrc ||
2354 num_lastfiles != system_lyxrc.num_lastfiles) {
2355 os << "\\num_lastfiles " << num_lastfiles << '\n';
2359 case RC_CHECKLASTFILES:
2360 if (ignore_system_lyxrc ||
2361 check_lastfiles != system_lyxrc.check_lastfiles) {
2362 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2367 case RC_EXAMPLEPATH:
2368 if (ignore_system_lyxrc ||
2369 example_path != system_lyxrc.example_path) {
2370 string const path = os::external_path(example_path);
2371 os << "\\example_path \"" << path << "\"\n";
2375 case RC_TEMPLATEPATH:
2376 if (ignore_system_lyxrc ||
2377 template_path != system_lyxrc.template_path) {
2378 string const path = os::external_path(template_path);
2379 os << "\\template_path \"" << path << "\"\n";
2383 case RC_TEMPDIRPATH:
2384 if (ignore_system_lyxrc ||
2385 tempdir_path != system_lyxrc.tempdir_path) {
2386 string const path = os::external_path(tempdir_path);
2387 os << "\\tempdir_path \"" << path << "\"\n";
2391 case RC_THESAURUSDIRPATH:
2392 if (ignore_system_lyxrc ||
2393 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2394 string const path = os::external_path(thesaurusdir_path);
2395 os << "\\thesaurusdir_path \"" << path << "\"\n";
2399 case RC_HUNSPELLDIR_PATH:
2400 if (ignore_system_lyxrc ||
2401 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2402 string const path = os::external_path(hunspelldir_path);
2403 os << "\\hunspelldir_path \"" << path << "\"\n";
2407 case RC_PLAINTEXT_LINELEN:
2408 if (ignore_system_lyxrc ||
2409 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2410 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2414 case RC_MAKE_BACKUP:
2415 if (ignore_system_lyxrc ||
2416 make_backup != system_lyxrc.make_backup) {
2417 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2421 case RC_SAVE_COMPRESSED:
2422 if (ignore_system_lyxrc ||
2423 save_compressed != system_lyxrc.save_compressed) {
2424 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2428 case RC_BACKUPDIR_PATH:
2429 if (ignore_system_lyxrc ||
2430 backupdir_path != system_lyxrc.backupdir_path) {
2431 string const path = os::external_path(backupdir_path);
2432 os << "\\backupdir_path \"" << path << "\"\n";
2438 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2442 << "# SPELLCHECKER SECTION ##############################\n"
2445 case RC_ACCEPT_COMPOUND:
2446 if (ignore_system_lyxrc ||
2447 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2448 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2454 if (ignore_system_lyxrc ||
2455 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2456 os << "\\alternate_language \"" << spellchecker_alt_lang
2462 if (ignore_system_lyxrc ||
2463 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2464 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2468 case RC_USE_SYSTEM_COLORS:
2469 if (ignore_system_lyxrc ||
2470 use_system_colors != system_lyxrc.use_system_colors) {
2471 os << "\\use_system_colors "
2472 << convert<string>(use_system_colors)
2477 case RC_USE_TOOLTIP:
2478 if (ignore_system_lyxrc ||
2479 use_tooltip != system_lyxrc.use_tooltip) {
2480 os << "\\use_tooltip "
2481 << convert<string>(use_tooltip)
2486 case RC_USE_PIXMAP_CACHE:
2487 if (ignore_system_lyxrc ||
2488 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2489 os << "\\use_pixmap_cache "
2490 << convert<string>(use_pixmap_cache)
2496 if (ignore_system_lyxrc ||
2497 use_qimage != system_lyxrc.use_qimage) {
2498 os << "\\use_qimage "
2499 << convert<string>(use_qimage)
2506 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2511 case RC_DEFAULT_DECIMAL_POINT:
2512 if (ignore_system_lyxrc ||
2513 default_decimal_point != system_lyxrc.default_decimal_point) {
2514 os << "\\default_decimal_point " << default_decimal_point << '\n';
2519 case RC_DEFAULT_LENGTH_UNIT:
2520 if (ignore_system_lyxrc ||
2521 default_length_unit != system_lyxrc.default_length_unit) {
2522 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2527 case RC_SPELLCHECKER:
2528 if (ignore_system_lyxrc ||
2529 spellchecker != system_lyxrc.spellchecker) {
2530 os << "\\spellchecker " << spellchecker << '\n';
2535 case RC_SPELLCHECK_CONTINUOUSLY:
2536 if (ignore_system_lyxrc ||
2537 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2538 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2544 case RC_SPELLCHECK_NOTES:
2545 if (ignore_system_lyxrc ||
2546 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2547 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2553 case RC_RTL_SUPPORT:
2554 if (ignore_system_lyxrc ||
2555 rtl_support != system_lyxrc.rtl_support) {
2556 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2560 case RC_VISUAL_CURSOR:
2561 if (ignore_system_lyxrc ||
2562 visual_cursor != system_lyxrc.visual_cursor) {
2563 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2567 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2568 if (ignore_system_lyxrc ||
2569 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2570 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2571 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2575 case RC_LANGUAGE_CUSTOM_PACKAGE:
2576 if (ignore_system_lyxrc ||
2577 language_custom_package != system_lyxrc.language_custom_package) {
2578 os << "\\language_custom_package \"" << language_custom_package
2583 case RC_LANGUAGE_GLOBAL_OPTIONS:
2584 if (ignore_system_lyxrc ||
2585 language_global_options
2586 != system_lyxrc.language_global_options) {
2587 os << "\\language_global_options \""
2588 << convert<string>(language_global_options)
2593 case RC_LANGUAGE_PACKAGE_SELECTION:
2594 if (ignore_system_lyxrc ||
2595 language_package_selection != system_lyxrc.language_package_selection) {
2596 os << "\\language_package_selection ";
2597 switch (language_package_selection) {
2614 case RC_LANGUAGE_COMMAND_BEGIN:
2615 if (ignore_system_lyxrc ||
2616 language_command_begin
2617 != system_lyxrc.language_command_begin) {
2618 os << "\\language_command_begin \""
2619 << language_command_begin
2624 case RC_LANGUAGE_COMMAND_END:
2625 if (ignore_system_lyxrc ||
2626 language_command_end
2627 != system_lyxrc.language_command_end) {
2628 os << "\\language_command_end \"" << language_command_end
2633 case RC_LANGUAGE_COMMAND_LOCAL:
2634 if (ignore_system_lyxrc ||
2635 language_command_local
2636 != system_lyxrc.language_command_local) {
2637 os << "\\language_command_local \""
2638 << language_command_local
2643 case RC_LANGUAGE_AUTO_BEGIN:
2644 if (ignore_system_lyxrc ||
2645 language_auto_begin != system_lyxrc.language_auto_begin) {
2646 os << "\\language_auto_begin "
2647 << convert<string>(language_auto_begin) << '\n';
2651 case RC_LANGUAGE_AUTO_END:
2652 if (ignore_system_lyxrc ||
2653 language_auto_end != system_lyxrc.language_auto_end) {
2654 os << "\\language_auto_end "
2655 << convert<string>(language_auto_end) << '\n';
2659 case RC_MARK_FOREIGN_LANGUAGE:
2660 if (ignore_system_lyxrc ||
2661 mark_foreign_language
2662 != system_lyxrc.mark_foreign_language) {
2663 os << "\\mark_foreign_language " <<
2664 convert<string>(mark_foreign_language) << '\n';
2670 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2673 case RC_AUTO_NUMBER:
2674 if (ignore_system_lyxrc ||
2675 auto_number != system_lyxrc.auto_number) {
2676 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2680 case RC_GUI_LANGUAGE:
2681 if (ignore_system_lyxrc ||
2682 gui_language != system_lyxrc.gui_language) {
2683 os << "\\gui_language " << gui_language << '\n';
2687 case RC_EXPORT_OVERWRITE:
2688 if (ignore_system_lyxrc ||
2689 export_overwrite != system_lyxrc.export_overwrite) {
2691 switch (export_overwrite) {
2702 os << "\\export_overwrite " << status << '\n';
2707 case RC_SCROLL_WHEEL_ZOOM:
2708 if (ignore_system_lyxrc ||
2709 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2711 switch (scroll_wheel_zoom) {
2712 case SCROLL_WHEEL_ZOOM_OFF:
2715 case SCROLL_WHEEL_ZOOM_CTRL:
2718 case SCROLL_WHEEL_ZOOM_SHIFT:
2721 case SCROLL_WHEEL_ZOOM_ALT:
2725 os << "\\scroll_wheel_zoom " << status << '\n';
2731 << "# FORMATS SECTION ##########################\n"
2735 // New/modified formats
2736 for (Formats::const_iterator cit = formats.begin();
2737 cit != formats.end(); ++cit) {
2738 Format const * format =
2739 system_formats.getFormat(cit->name());
2741 format->extensions() != cit->extensions() ||
2742 format->prettyname() != cit->prettyname() ||
2743 format->shortcut() != cit->shortcut() ||
2744 format->viewer() != cit->viewer() ||
2745 format->editor() != cit->editor() ||
2746 format->documentFormat() != cit->documentFormat() ||
2747 format->vectorFormat() != cit->vectorFormat() ||
2748 format->inExportMenu() != cit->inExportMenu() ||
2749 format->mime() != cit->mime()) {
2750 os << "\\format \"" << cit->name() << "\" \""
2751 << cit->extensions() << "\" \""
2752 << cit->prettyname() << "\" \""
2753 << cit->shortcut() << "\" \""
2754 << escapeCommand(cit->viewer()) << "\" \""
2755 << escapeCommand(cit->editor()) << "\" \"";
2756 vector<string> flags;
2757 if (cit->documentFormat())
2758 flags.push_back("document");
2759 if (cit->vectorFormat())
2760 flags.push_back("vector");
2761 if (cit->zippedNative())
2762 flags.push_back("zipped=native");
2763 if (cit->inExportMenu())
2764 flags.push_back("menu=export");
2766 os << getStringFromVector(flags);
2767 os << "\" \"" << cit->mime() << "\"\n";
2771 // Look for deleted formats
2772 for (Formats::const_iterator cit = system_formats.begin();
2773 cit != system_formats.end(); ++cit)
2774 if (!formats.getFormat(cit->name()))
2775 os << "\\format \"" << cit->name()
2776 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2779 case RC_VIEWER_ALTERNATIVES: {
2780 Alternatives::const_iterator it = viewer_alternatives.begin();
2781 Alternatives::const_iterator const en = viewer_alternatives.end();
2782 Alternatives::const_iterator const sysend =
2783 system_lyxrc.viewer_alternatives.end();
2784 for (; it != en; ++it) {
2785 string const & fmt = it->first;
2786 CommandSet const & cmd = it->second;
2787 CommandSet::const_iterator sit = cmd.begin();
2788 CommandSet::const_iterator const sen = cmd.end();
2789 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2790 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2791 system_lyxrc.viewer_alternatives.find(fmt);
2792 for (; sit != sen; ++sit) {
2793 string const & cmd = *sit;
2794 if (ignore_system_lyxrc
2795 || sysfmt == sysend // format not found
2796 || sysfmt->second.count(cmd) == 0 // this command not found
2798 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2804 case RC_EDITOR_ALTERNATIVES: {
2805 Alternatives::const_iterator it = editor_alternatives.begin();
2806 Alternatives::const_iterator const en = editor_alternatives.end();
2807 Alternatives::const_iterator const sysend =
2808 system_lyxrc.editor_alternatives.end();
2809 for (; it != en; ++it) {
2810 string const & fmt = it->first;
2811 CommandSet const & cmd = it->second;
2812 CommandSet::const_iterator sit = cmd.begin();
2813 CommandSet::const_iterator const sen = cmd.end();
2814 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2815 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2816 system_lyxrc.editor_alternatives.find(fmt);
2817 for (; sit != sen; ++sit) {
2818 string const & cmd = *sit;
2819 if (ignore_system_lyxrc
2820 || sysfmt == sysend // format not found
2821 || sysfmt->second.count(cmd) == 0 // this command not found
2823 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2829 case RC_DEFAULT_OTF_VIEW_FORMAT:
2830 if (ignore_system_lyxrc ||
2831 default_otf_view_format != system_lyxrc.default_otf_view_format) {
2832 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2836 case RC_DEFAULT_VIEW_FORMAT:
2837 if (ignore_system_lyxrc ||
2838 default_view_format != system_lyxrc.default_view_format) {
2839 os << "\\default_view_format " << default_view_format << '\n';
2849 << "# CONVERTERS SECTION ##########################\n"
2853 // Look for new converters
2854 for (Converters::const_iterator cit = theConverters().begin();
2855 cit != theConverters().end(); ++cit) {
2856 Converter const * converter =
2857 theSystemConverters().getConverter(cit->from,
2860 converter->command != cit->command ||
2861 converter->flags != cit->flags)
2862 os << "\\converter \"" << cit->from << "\" \""
2863 << cit->to << "\" \""
2864 << escapeCommand(cit->command) << "\" \""
2865 << cit->flags << "\"\n";
2868 // New/modifed converters
2869 for (Converters::const_iterator cit = theSystemConverters().begin();
2870 cit != theSystemConverters().end(); ++cit)
2871 if (!theConverters().getConverter(cit->from, cit->to))
2872 os << "\\converter \"" << cit->from
2873 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2880 << "# COPIERS SECTION ##########################\n"
2883 // Look for new movers
2884 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2885 Movers::const_iterator const sysend = theSystemMovers().end();
2886 Movers::const_iterator it = theMovers().begin();
2887 Movers::const_iterator end = theMovers().end();
2889 for (; it != end; ++it) {
2890 Movers::const_iterator const sysit =
2891 find_if(sysbegin, sysend, SameMover(*it));
2892 if (sysit == sysend) {
2893 string const & fmt = it->first;
2894 string const & command =
2895 it->second.command();
2897 os << "\\copier " << fmt
2898 << " \"" << escapeCommand(command) << "\"\n";
2904 // We don't actually delete SpecialisedMover(s) from the
2905 // map, just clear their 'command', so there's no need
2906 // to test for anything else.
2913 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2915 // Why the switch you might ask. It is a trick to ensure that all
2916 // the elements in the LyXRCTags enum is handled. As you can see
2917 // there are no breaks at all. So it is just a huge fall-through.
2918 // The nice thing is that we will get a warning from the compiler
2919 // if we forget an element.
2920 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2922 case LyXRC::RC_LAST:
2923 case LyXRC::RC_ACCEPT_COMPOUND:
2924 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2925 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2926 case LyXRC::RC_ALT_LANG:
2927 case LyXRC::RC_PLAINTEXT_LINELEN:
2928 case LyXRC::RC_AUTOCORRECTION_MATH:
2929 case LyXRC::RC_AUTOREGIONDELETE:
2930 case LyXRC::RC_AUTORESET_OPTIONS:
2931 case LyXRC::RC_AUTOSAVE:
2932 case LyXRC::RC_AUTO_NUMBER:
2933 case LyXRC::RC_BACKUPDIR_PATH:
2934 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2935 case LyXRC::RC_BIBTEX_COMMAND:
2936 case LyXRC::RC_BINDFILE:
2937 case LyXRC::RC_CHECKLASTFILES:
2938 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2939 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2940 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2941 case LyXRC::RC_COMPLETION_INLINE_MATH:
2942 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2943 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2944 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2945 case LyXRC::RC_COMPLETION_POPUP_MATH:
2946 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2947 case LyXRC::RC_COMPLETION_MINLENGTH:
2948 case LyXRC::RC_USELASTFILEPOS:
2949 case LyXRC::RC_LOADSESSION:
2950 case LyXRC::RC_CHKTEX_COMMAND:
2951 case LyXRC::RC_CONVERTER:
2952 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2953 case LyXRC::RC_COPIER:
2954 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2955 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2956 case LyXRC::RC_DATE_INSERT_FORMAT:
2957 case LyXRC::RC_GUI_LANGUAGE:
2958 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2959 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2960 case LyXRC::RC_DEFFILE:
2961 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2962 case LyXRC::RC_DISPLAY_GRAPHICS:
2963 case LyXRC::RC_DOCUMENTPATH:
2964 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2965 FileName path(lyxrc_new.document_path);
2966 if (path.exists() && path.isDirectory())
2967 package().document_dir() = FileName(lyxrc.document_path);
2969 case LyXRC::RC_EDITOR_ALTERNATIVES:
2970 case LyXRC::RC_ESC_CHARS:
2971 case LyXRC::RC_EXAMPLEPATH:
2972 case LyXRC::RC_FONT_ENCODING:
2973 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2974 case LyXRC::RC_FILEFORMAT:
2975 case LyXRC::RC_GROUP_LAYOUTS:
2976 case LyXRC::RC_HUNSPELLDIR_PATH:
2977 case LyXRC::RC_ICON_SET:
2978 case LyXRC::RC_INDEX_ALTERNATIVES:
2979 case LyXRC::RC_INDEX_COMMAND:
2980 case LyXRC::RC_JBIBTEX_COMMAND:
2981 case LyXRC::RC_JINDEX_COMMAND:
2982 case LyXRC::RC_NOMENCL_COMMAND:
2983 case LyXRC::RC_INPUT:
2984 case LyXRC::RC_KBMAP:
2985 case LyXRC::RC_KBMAP_PRIMARY:
2986 case LyXRC::RC_KBMAP_SECONDARY:
2987 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2988 case LyXRC::RC_LANGUAGE_AUTO_END:
2989 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2990 case LyXRC::RC_LANGUAGE_COMMAND_END:
2991 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2992 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2993 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2994 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2995 case LyXRC::RC_LYXRCFORMAT:
2996 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2997 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2998 case LyXRC::RC_MACRO_EDIT_STYLE:
2999 case LyXRC::RC_MAKE_BACKUP:
3000 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
3001 case LyXRC::RC_MOUSE_WHEEL_SPEED:
3002 case LyXRC::RC_NUMLASTFILES:
3003 case LyXRC::RC_PARAGRAPH_MARKERS:
3004 case LyXRC::RC_PATH_PREFIX:
3005 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
3006 prependEnvPath("PATH", lyxrc_new.path_prefix);
3008 case LyXRC::RC_PREVIEW:
3009 case LyXRC::RC_PREVIEW_HASHED_LABELS:
3010 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
3011 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
3012 case LyXRC::RC_PRINTCOPIESFLAG:
3013 case LyXRC::RC_PRINTER:
3014 case LyXRC::RC_PRINTEVENPAGEFLAG:
3015 case LyXRC::RC_PRINTEXSTRAOPTIONS:
3016 case LyXRC::RC_PRINTFILEEXTENSION:
3017 case LyXRC::RC_PRINTLANDSCAPEFLAG:
3018 case LyXRC::RC_PRINTODDPAGEFLAG:
3019 case LyXRC::RC_PRINTPAGERANGEFLAG:
3020 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
3021 case LyXRC::RC_PRINTPAPERFLAG:
3022 case LyXRC::RC_PRINTREVERSEFLAG:
3023 case LyXRC::RC_PRINTSPOOL_COMMAND:
3024 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
3025 case LyXRC::RC_PRINTTOFILE:
3026 case LyXRC::RC_PRINTTOPRINTER:
3027 case LyXRC::RC_PRINT_ADAPTOUTPUT:
3028 case LyXRC::RC_PRINT_COMMAND:
3029 case LyXRC::RC_RTL_SUPPORT:
3030 case LyXRC::RC_SAVE_COMPRESSED:
3031 case LyXRC::RC_SCREEN_DPI:
3032 case LyXRC::RC_SCREEN_FONT_ROMAN:
3033 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3034 case LyXRC::RC_SCREEN_FONT_SANS:
3035 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3036 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3037 case LyXRC::RC_SCREEN_FONT_SIZES:
3038 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3039 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3040 case LyXRC::RC_GEOMETRY_SESSION:
3041 case LyXRC::RC_SCREEN_ZOOM:
3042 case LyXRC::RC_SERVERPIPE:
3043 case LyXRC::RC_SET_COLOR:
3044 case LyXRC::RC_SHOW_BANNER:
3045 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3046 case LyXRC::RC_SPELLCHECKER:
3047 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3049 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3050 case LyXRC::RC_SPELLCHECK_NOTES:
3051 case LyXRC::RC_SPLITINDEX_COMMAND:
3052 case LyXRC::RC_TEMPDIRPATH:
3053 case LyXRC::RC_TEMPLATEPATH:
3054 case LyXRC::RC_TEX_ALLOWS_SPACES:
3055 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3056 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3057 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3059 case LyXRC::RC_TEXINPUTS_PREFIX:
3060 case LyXRC::RC_THESAURUSDIRPATH:
3061 case LyXRC::RC_UIFILE:
3062 case LyXRC::RC_USER_EMAIL:
3063 case LyXRC::RC_USER_NAME:
3064 case LyXRC::RC_USE_CONVERTER_CACHE:
3065 case LyXRC::RC_USE_SYSTEM_COLORS:
3066 case LyXRC::RC_USE_TOOLTIP:
3067 case LyXRC::RC_USE_PIXMAP_CACHE:
3068 case LyXRC::RC_USE_QIMAGE:
3069 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3070 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3071 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3072 case LyXRC::RC_SINGLE_INSTANCE:
3073 case LyXRC::RC_SORT_LAYOUTS:
3074 case LyXRC::RC_FULL_SCREEN_LIMIT:
3075 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3076 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3077 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3078 case LyXRC::RC_FULL_SCREEN_TABBAR:
3079 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3080 case LyXRC::RC_FULL_SCREEN_WIDTH:
3081 case LyXRC::RC_VISUAL_CURSOR:
3082 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3083 case LyXRC::RC_VIEWER:
3084 case LyXRC::RC_VIEWER_ALTERNATIVES:
3085 case LyXRC::RC_FORWARD_SEARCH_DVI:
3086 case LyXRC::RC_FORWARD_SEARCH_PDF:
3087 case LyXRC::RC_EXPORT_OVERWRITE:
3088 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3089 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3090 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3091 case LyXRC::RC_CURSOR_WIDTH:
3098 string const LyXRC::getDescription(LyXRCTags tag)
3103 case RC_ACCEPT_COMPOUND:
3104 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3108 str = _("Specify an alternate language. The default is to use the language of the document.");
3111 case RC_PLAINTEXT_LINELEN:
3112 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.");
3115 case RC_AUTOREGIONDELETE:
3116 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3119 case RC_AUTORESET_OPTIONS:
3120 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3124 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3127 case RC_AUTO_NUMBER:
3130 case RC_BACKUPDIR_PATH:
3131 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.");
3134 case RC_BIBTEX_COMMAND:
3135 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3138 case RC_JBIBTEX_COMMAND:
3139 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3143 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3146 case RC_CHECKLASTFILES:
3147 str = _("Select to check whether the lastfiles still exist.");
3150 case RC_CHKTEX_COMMAND:
3151 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3160 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3161 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.");
3164 case RC_CURSOR_WIDTH:
3165 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3168 case RC_SCROLL_BELOW_DOCUMENT:
3169 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");
3172 case RC_MAC_DONTSWAP_CTRL_META:
3173 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3176 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3177 str = _("Use the Mac OS X conventions for cursor movement");
3180 case RC_SHOW_MACRO_LABEL:
3181 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3184 case RC_DATE_INSERT_FORMAT:
3185 //xgettext:no-c-format
3186 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3190 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3193 case RC_DEFAULT_OTF_VIEW_FORMAT:
3194 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3197 case RC_DEFAULT_VIEW_FORMAT:
3198 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3201 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3202 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3205 case RC_DISPLAY_GRAPHICS:
3206 str = _("Select how LyX will display any graphics.");
3209 case RC_DOCUMENTPATH:
3210 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3214 str = _("Specify additional chars that can be part of a word.");
3217 case RC_EXAMPLEPATH:
3218 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3221 case RC_FONT_ENCODING:
3222 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3225 case RC_FORCE_PAINT_SINGLE_CHAR:
3226 str = _("Disable any kerning and ligatures for text drawing on screen.");
3232 case RC_INDEX_COMMAND:
3233 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\".");
3236 case RC_JINDEX_COMMAND:
3237 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3240 case RC_NOMENCL_COMMAND:
3241 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3248 case RC_KBMAP_PRIMARY:
3249 case RC_KBMAP_SECONDARY:
3250 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.");
3253 case RC_LANGUAGE_AUTO_BEGIN:
3254 str = _("Select if a language switching command is needed at the beginning of the document.");
3257 case RC_LANGUAGE_AUTO_END:
3258 str = _("Select if a language switching command is needed at the end of the document.");
3261 case RC_LANGUAGE_COMMAND_BEGIN:
3262 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.");
3265 case RC_LANGUAGE_COMMAND_END:
3266 str = _("The LaTeX command for changing back to the language of the document.");
3269 case RC_LANGUAGE_COMMAND_LOCAL:
3270 str = _("The LaTeX command for local changing of the language.");
3273 case RC_LANGUAGE_GLOBAL_OPTIONS:
3274 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3277 case RC_LANGUAGE_CUSTOM_PACKAGE:
3278 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3281 case RC_LANGUAGE_PACKAGE_SELECTION:
3282 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3285 case RC_USELASTFILEPOS:
3286 str = _("De-select if you do not want LyX to scroll to saved position.");
3289 case RC_LOADSESSION:
3290 str = _("De-select to prevent loading files opened from the last LyX session.");
3293 case RC_MAKE_BACKUP:
3294 str = _("De-select if you don't want LyX to create backup files.");
3297 case RC_MARK_FOREIGN_LANGUAGE:
3298 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3301 case RC_MOUSE_WHEEL_SPEED:
3302 str = bformat(_("The scrolling speed of the mouse wheel."),
3306 case RC_COMPLETION_POPUP_DELAY:
3307 str = _("The completion popup delay.");
3310 case RC_COMPLETION_POPUP_MATH:
3311 str = _("Select to display the completion popup in math mode.");
3314 case RC_COMPLETION_POPUP_TEXT:
3315 str = _("Select to display the completion popup in text mode.");
3318 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3319 str = _("Show the completion popup without delay after non-unique completion attempt.");
3322 case RC_COMPLETION_POPUP_TEXT:
3323 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3326 case RC_COMPLETION_POPUP_DELAY:
3327 str = _("The inline completion delay.");
3330 case RC_COMPLETION_INLINE_MATH:
3331 str = _("Select to display the inline completion in math mode.");
3334 case RC_COMPLETION_INLINE_TEXT:
3335 str = _("Select to display the inline completion in text mode.");
3338 case RC_COMPLETION_INLINE_DOTS:
3339 str = _("Use \"...\" to shorten long completions.");
3342 case RC_AUTOCORRECTION_MATH:
3343 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3346 case RC_NUMLASTFILES:
3347 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3351 case RC_PATH_PREFIX:
3352 str = _("Specify those directories which should be "
3353 "prepended to the PATH environment variable.\n"
3354 "Use the OS native format.");
3358 str = _("Shows a typeset preview of things such as math");
3361 case RC_PREVIEW_HASHED_LABELS:
3362 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3365 case RC_PREVIEW_SCALE_FACTOR:
3366 str = _("Scale the preview size to suit.");
3369 case RC_PRINTCOLLCOPIESFLAG:
3370 str = _("The option for specifying whether the copies should be collated.");
3373 case RC_PRINTCOPIESFLAG:
3374 str = _("The option for specifying the number of copies to print.");
3378 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3381 case RC_PRINTEVENPAGEFLAG:
3382 str = _("The option to print only even pages.");
3385 case RC_PRINTEXSTRAOPTIONS:
3386 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3389 case RC_PRINTFILEEXTENSION:
3390 str = _("Extension of printer program output file. Usually \".ps\".");
3393 case RC_PRINTLANDSCAPEFLAG:
3394 str = _("The option to print out in landscape.");
3397 case RC_PRINTODDPAGEFLAG:
3398 str = _("The option to print only odd pages.");
3401 case RC_PRINTPAGERANGEFLAG:
3402 str = _("The option for specifying a comma-separated list of pages to print.");
3405 case RC_PRINTPAPERDIMENSIONFLAG:
3406 str = _("Option to specify the dimensions of the print paper.");
3409 case RC_PRINTPAPERFLAG:
3410 str = _("The option to specify paper type.");
3413 case RC_PRINTREVERSEFLAG:
3414 str = _("The option to reverse the order of the pages printed.");
3417 case RC_PRINTSPOOL_COMMAND:
3418 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.");
3421 case RC_PRINTSPOOL_PRINTERPREFIX:
3422 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.");
3425 case RC_PRINTTOFILE:
3426 str = _("Option to pass to the print program to print to a file.");
3429 case RC_PRINTTOPRINTER:
3430 str = _("Option to pass to the print program to print on a specific printer.");
3433 case RC_PRINT_ADAPTOUTPUT:
3434 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3437 case RC_PRINT_COMMAND:
3438 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3441 case RC_RTL_SUPPORT:
3442 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3445 case RC_VISUAL_CURSOR:
3446 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3449 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3450 str = _("Specify whether, closing the last view of an open document, LyX should close the document (yes), hide it (no), or ask the user (ask).");
3454 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3457 case RC_SCREEN_FONT_ROMAN:
3458 case RC_SCREEN_FONT_SANS:
3459 case RC_SCREEN_FONT_TYPEWRITER:
3460 str = _("The screen fonts used to display the text while editing.");
3463 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3464 case RC_SCREEN_FONT_SANS_FOUNDRY:
3465 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3468 case RC_SCREEN_FONT_SCALABLE:
3469 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.");
3472 case RC_SCREEN_FONT_SIZES:
3473 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3476 case RC_SCREEN_ZOOM:
3477 //xgettext:no-c-format
3478 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3481 case RC_GEOMETRY_SESSION:
3482 str = _("Allow session manager to save and restore windows geometry.");
3486 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3492 case RC_SHOW_BANNER:
3493 str = _("De-select if you don't want the startup banner.");
3496 case RC_TEMPDIRPATH:
3497 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3500 case RC_THESAURUSDIRPATH:
3501 str = _("This is the place where the files of the thesaurus library reside.");
3504 case RC_TEMPLATEPATH:
3505 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3508 case RC_TEX_ALLOWS_SPACES:
3511 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3514 case RC_TEXINPUTS_PREFIX:
3515 str = _("Specify those directories which should be "
3516 "prepended to the TEXINPUTS environment variable.\n"
3517 "A '.' represents the current document directory. "
3518 "Use the OS native format.");
3522 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3531 case RC_USE_USE_SYSTEM_COLORS:
3532 str = _("Enable use the system colors for some things like main window background and selection.");
3535 case RC_USE_TOOLTIP:
3536 str = _("Enable the automatic appearance of tool tips in the work area.");
3539 case RC_USE_PIXMAP_CACHE:
3540 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3543 case RC_VIEWDVI_PAPEROPTION:
3544 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3559 // The global instance
3562 // The global copy of the system lyxrc entries (everything except preferences)