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.
21 #include "BufferList.h"
23 #include "Converter.h"
24 #include "FontEnums.h"
30 #include "SpellChecker.h"
33 #include "graphics/GraphicsTypes.h"
35 #include "support/convert.h"
36 #include "support/debug.h"
37 #include "support/environment.h"
38 #include "support/FileName.h"
39 #include "support/filetools.h"
40 #include "support/gettext.h"
41 #include "support/lstrings.h"
42 #include "support/os.h"
43 #include "support/Package.h"
44 #include "support/TempFile.h"
45 #include "support/userinfo.h"
52 using namespace lyx::support;
56 namespace os = support::os;
60 // The format should also be updated in configure.py, and conversion code
61 // should be added to prefs2prefs_prefs.py.
62 static unsigned int const LYXRC_FILEFORMAT = 24; // spitz: rename collapsible
64 // when adding something to this array keep it sorted!
65 LexerKeyword lyxrcTags[] = {
66 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
67 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
68 { "\\alternate_language", LyXRC::RC_ALT_LANG },
69 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
70 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
71 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
72 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
73 { "\\autosave", LyXRC::RC_AUTOSAVE },
74 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
75 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
76 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
77 { "\\bind_file", LyXRC::RC_BINDFILE },
78 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
79 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
80 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
81 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
82 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
83 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
84 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
85 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
86 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
87 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
88 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
89 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
90 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
91 { "\\converter", LyXRC::RC_CONVERTER },
92 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
93 { "\\copier", LyXRC::RC_COPIER },
94 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
95 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
96 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
97 { "\\def_file", LyXRC::RC_DEFFILE },
98 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
99 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
100 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
101 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
102 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
103 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
104 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
105 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
106 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
107 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
108 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
109 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
110 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
111 { "\\format", LyXRC::RC_FILEFORMAT },
112 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
113 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
114 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
115 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
116 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
117 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
118 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
119 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
120 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
121 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
122 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
123 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
124 { "\\icon_set", LyXRC::RC_ICON_SET },
125 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
126 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
127 { "\\input", LyXRC::RC_INPUT },
128 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
129 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
130 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
131 { "\\kbmap", LyXRC::RC_KBMAP },
132 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
133 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
134 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
135 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
136 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
137 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
138 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
139 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
140 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
141 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
142 { "\\load_session", LyXRC::RC_LOADSESSION },
143 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
144 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
145 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
146 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
147 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
148 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
149 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
150 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
151 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
152 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
153 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
154 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
155 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
156 { "\\preview", LyXRC::RC_PREVIEW },
157 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
158 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
159 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
160 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
161 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
162 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
163 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
164 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
165 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
166 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
167 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
168 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
169 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
170 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
171 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
172 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
173 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
174 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
175 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
176 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
177 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
178 { "\\set_color", LyXRC::RC_SET_COLOR },
179 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
180 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
181 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
182 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
183 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
184 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
185 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
186 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
187 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
188 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
189 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
190 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
191 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
192 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
193 { "\\ui_file", LyXRC::RC_UIFILE },
194 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
195 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
196 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
197 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
198 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
199 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
200 // compatibility with versions older than 1.4.0 only
201 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
202 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
203 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
204 { "\\user_email", LyXRC::RC_USER_EMAIL },
205 { "\\user_name", LyXRC::RC_USER_NAME },
206 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
207 // compatibility with versions older than 1.4.0 only
208 { "\\viewer", LyXRC::RC_VIEWER},
209 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
210 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
211 { "format", LyXRC::RC_LYXRCFORMAT }
214 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
225 void LyXRC::setDefaults()
228 use_system_theme_icons = false;
230 def_file = "default";
232 // The current document directory
233 texinputs_prefix = ".";
234 print_landscape_flag = "-t landscape";
235 print_paper_flag = "-t";
236 print_paper_dimension_flag = "-T";
237 document_path.erase();
238 view_dvi_paper_option.erase();
239 default_view_format = "pdf2";
240 default_otf_view_format = "pdf4";
241 default_platex_view_format = "pdf3";
242 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
243 bibtex_command = "automatic";
245 index_command = "makeindex -c -q";
246 nomencl_command = "makeindex -s nomencl.ist";
247 pygmentize_command = string();
249 // Because a screen is typically wider than a piece of paper:
251 currentZoom = defaultZoom;
252 allow_geometry_session = true;
253 // Default LaTeX font size:
254 font_sizes[FONT_SIZE_TINY] = "5.0";
255 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
256 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
257 font_sizes[FONT_SIZE_SMALL] = "9.0";
258 font_sizes[FONT_SIZE_NORMAL] = "10.0";
259 font_sizes[FONT_SIZE_LARGE] = "12.0";
260 font_sizes[FONT_SIZE_LARGER] = "14.4";
261 font_sizes[FONT_SIZE_LARGEST] = "17.26";
262 font_sizes[FONT_SIZE_HUGE] = "20.74";
263 font_sizes[FONT_SIZE_HUGER] = "24.88";
264 use_scalable_fonts = true;
265 roman_font_name = "";
267 typewriter_font_name = "";
269 auto_region_delete = true;
270 auto_reset_options = false;
271 plaintext_linelen = 65;
272 mouse_wheel_speed = 1.0;
274 check_lastfiles = true;
275 use_lastfilepos = true;
276 load_session = false;
278 save_compressed = false;
280 backupdir_path.erase();
281 display_graphics = true;
282 // Spellchecker settings:
283 // FIXME: this check should test the target platform (darwin)
284 #if defined(USE_MACOSX_PACKAGING)
285 spellchecker = "native";
286 #elif defined(USE_ASPELL)
287 spellchecker = "aspell";
288 #elif defined(USE_HUNSPELL)
289 spellchecker = "hunspell";
291 spellchecker = "aspell";
293 spellchecker_accept_compound = false;
294 spellcheck_continuously = false;
295 completion_minlength = 6;
296 spellcheck_notes = true;
298 visual_cursor = false;
300 mark_foreign_language = true;
301 language_auto_begin = true;
302 language_auto_end = true;
303 language_global_options = true;
304 language_package_selection = LP_AUTO;
305 language_custom_package = "\\usepackage{babel}";
306 language_command_begin = "\\selectlanguage{$$lang}";
307 language_command_local = "\\foreignlanguage{$$lang}{";
308 sort_layouts = false;
309 group_layouts = true;
310 gui_language = "auto";
312 windows_style_tex_paths = false;
313 tex_allows_spaces = false;
314 date_insert_format = "%x";
315 cursor_follows_scrollbar = false;
316 scroll_below_document = false;
317 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
318 paragraph_markers = false;
319 mac_dontswap_ctrl_meta = false;
320 mac_like_cursor_movement = false;
321 macro_edit_style = MACRO_EDIT_INLINE_BOX;
322 dialogs_iconify_with_main = false;
323 preview = PREVIEW_OFF;
324 preview_hashed_labels = false;
325 preview_scale_factor = 1.0;
326 use_converter_cache = true;
327 use_converter_needauth_forbidden = true;
328 use_converter_needauth = true;
329 use_system_colors = false;
331 use_pixmap_cache = false;
333 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
334 user_name = to_utf8(support::user_name());
335 user_email = to_utf8(support::user_email());
336 open_buffers_in_tabs = true;
337 single_close_tab_button = false;
338 single_instance = true;
339 forward_search_dvi = string();
340 forward_search_pdf = string();
341 export_overwrite = NO_FILES;
343 // Fullscreen settings
344 full_screen_limit = false;
345 full_screen_toolbars = true;
346 full_screen_tabbar = true;
347 full_screen_menubar = true;
348 full_screen_statusbar = true;
349 full_screen_scrollbar = true;
350 full_screen_width = 700;
352 completion_cursor_text = true;
353 completion_popup_math = true;
354 completion_popup_text = false;
355 completion_popup_delay = 2.0;
356 completion_popup_after_complete = true;
357 autocorrection_math = false;
358 completion_inline_math = true;
359 completion_inline_text = false;
360 completion_inline_dots = -1;
361 completion_inline_delay = 0.2;
362 default_decimal_point = ".";
363 default_length_unit = Length::CM;
365 close_buffer_with_last_view = "yes";
366 mouse_middlebutton_paste = true;
372 void oldFontFormat(string & family, string & foundry)
374 if (family.empty() || family[0] != '-')
376 foundry = token(family, '-', 1);
377 family = token(family, '-', 2);
385 bool LyXRC::read(FileName const & filename, bool check_format)
387 Lexer lexrc(lyxrcTags);
388 lexrc.setFile(filename);
389 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
390 ReturnValues retval = read(lexrc, check_format);
391 if (!check_format || retval != FormatMismatch)
392 return retval == ReadOK;
394 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
395 TempFile tmp("convert_lyxrc");
396 FileName const tempfile = tmp.name();
397 bool const success = prefs2prefs(filename, tempfile, false);
399 LYXERR0 ("Unable to convert " << filename.absFileName() <<
400 " to format " << LYXRC_FILEFORMAT);
403 // Keep this in the else branch, such that lexrc2 goes out
404 // of scope and releases the lock on tempfile before we
405 // attempt to remove it. This matters on Windows.
406 Lexer lexrc2(lyxrcTags);
407 lexrc2.setFile(tempfile);
408 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
409 retval = read(lexrc2, check_format);
411 return retval == ReadOK;
415 // don't need to worry about conversion, because this is always
416 // from an internal source
417 bool LyXRC::read(istream & is)
419 Lexer lexrc(lyxrcTags);
421 LYXERR(Debug::LYXRC, "Reading istream...");
422 return read(lexrc, false) == ReadOK;
426 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
428 if (lyxerr.debugging(Debug::PARSER))
429 lexrc.printTable(lyxerr);
434 // format prior to 2.0 and introduction of format tag
435 unsigned int format = 0;
437 while (lexrc.isOK()) {
438 // By using two switches we take advantage of the compiler
439 // telling us if we have missed a LyXRCTags element in
440 // the second switch.
441 // Note that this also shows a problem with Lexer since it
442 // helps us avoid taking advantage of the strictness of the
445 int le = lexrc.lex();
447 case Lexer::LEX_UNDEF:
448 lexrc.printError("Unknown tag `$$Token'");
450 case Lexer::LEX_FEOF:
455 switch (static_cast<LyXRCTags>(le)) {
458 format = lexrc.getInteger();
460 case RC_INPUT: // Include file
463 libFileSearch(string(),
465 if (!read(tmp, check_format)) {
467 "Error reading included file: " + tmp.absFileName());
473 bind_file = os::internal_path(lexrc.getString());
478 def_file = os::internal_path(lexrc.getString());
483 ui_file = os::internal_path(lexrc.getString());
486 case RC_AUTORESET_OPTIONS:
487 lexrc >> auto_reset_options;
490 case RC_DISPLAY_GRAPHICS:
492 display_graphics = lexrc.getString() == "true";
495 case RC_TEX_EXPECTS_WINDOWS_PATHS:
496 lexrc >> windows_style_tex_paths;
499 case RC_TEX_ALLOWS_SPACES:
500 lexrc >> tex_allows_spaces;
503 case RC_TEXINPUTS_PREFIX:
504 lexrc >> texinputs_prefix;
511 case RC_KBMAP_PRIMARY:
513 string const kmap(os::internal_path(lexrc.getString()));
514 if (!libFileSearch("kbd", kmap, "kmap").empty()
516 primary_kbmap = kmap;
518 lexrc.printError("LyX: Keymap `$$Token' not found");
523 case RC_KBMAP_SECONDARY:
525 string const kmap(os::internal_path(lexrc.getString()));
526 if (!libFileSearch("kbd", kmap, "kmap").empty()
528 secondary_kbmap = kmap;
530 lexrc.printError("LyX: Keymap `$$Token' not found");
535 case RC_FONT_ENCODING:
539 case RC_PRINTLANDSCAPEFLAG:
540 lexrc >> print_landscape_flag;
543 case RC_PRINTPAPERDIMENSIONFLAG:
544 lexrc >> print_paper_dimension_flag;
547 case RC_PRINTPAPERFLAG:
548 lexrc >> print_paper_flag;
551 case RC_PYGMENTIZE_COMMAND:
552 if (lexrc.next(true)) {
553 pygmentize_command = lexrc.getString();
557 case RC_VIEWDVI_PAPEROPTION:
559 view_dvi_paper_option = lexrc.getString();
561 view_dvi_paper_option.erase();
564 case RC_CHKTEX_COMMAND:
565 if (lexrc.next(true)) {
566 chktex_command = lexrc.getString();
570 case RC_BIBTEX_ALTERNATIVES:
571 if (lexrc.next(true)) {
572 bibtex_alternatives.insert(lexrc.getString());
576 case RC_BIBTEX_COMMAND:
577 if (lexrc.next(true)) {
578 bibtex_command = lexrc.getString();
582 case RC_JBIBTEX_COMMAND:
583 if (lexrc.next(true)) {
584 jbibtex_command = lexrc.getString();
588 case RC_JBIBTEX_ALTERNATIVES:
589 if (lexrc.next(true)) {
590 jbibtex_alternatives.insert(lexrc.getString());
594 case RC_INDEX_ALTERNATIVES:
595 if (lexrc.next(true)) {
596 index_alternatives.insert(lexrc.getString());
600 case RC_INDEX_COMMAND:
601 if (lexrc.next(true)) {
602 index_command = lexrc.getString();
606 case RC_JINDEX_COMMAND:
607 if (lexrc.next(true)) {
608 jindex_command = lexrc.getString();
612 case RC_SPLITINDEX_COMMAND:
613 if (lexrc.next(true)) {
614 splitindex_command = lexrc.getString();
618 case RC_NOMENCL_COMMAND:
619 if (lexrc.next(true)) {
620 nomencl_command = lexrc.getString();
629 lexrc >> defaultZoom;
630 if (defaultZoom < 10)
634 case RC_GEOMETRY_SESSION:
635 lexrc >> allow_geometry_session;
638 case RC_SCREEN_FONT_SIZES:
639 lexrc >> font_sizes[FONT_SIZE_TINY];
640 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
641 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
642 lexrc >> font_sizes[FONT_SIZE_SMALL];
643 lexrc >> font_sizes[FONT_SIZE_NORMAL];
644 lexrc >> font_sizes[FONT_SIZE_LARGE];
645 lexrc >> font_sizes[FONT_SIZE_LARGER];
646 lexrc >> font_sizes[FONT_SIZE_LARGEST];
647 lexrc >> font_sizes[FONT_SIZE_HUGE];
648 lexrc >> font_sizes[FONT_SIZE_HUGER];
651 case RC_SCREEN_FONT_SCALABLE:
652 lexrc >> use_scalable_fonts;
659 case RC_DOCUMENTPATH:
661 document_path = os::internal_path(lexrc.getString());
666 example_path = os::internal_path(lexrc.getString());
669 case RC_TEMPLATEPATH:
671 template_path = os::internal_path(lexrc.getString());
676 tempdir_path = os::internal_path(lexrc.getString());
679 case RC_THESAURUSDIRPATH:
681 thesaurusdir_path = os::internal_path(lexrc.getString());
684 case RC_HUNSPELLDIR_PATH:
686 hunspelldir_path = os::internal_path(lexrc.getString());
689 case RC_USELASTFILEPOS:
690 lexrc >> use_lastfilepos;
694 lexrc >> load_session;
697 case RC_MOUSE_WHEEL_SPEED:
698 lexrc >> mouse_wheel_speed;
701 case RC_COMPLETION_INLINE_DELAY:
702 lexrc >> completion_inline_delay;
705 case RC_COMPLETION_INLINE_MATH:
706 lexrc >> completion_inline_math;
709 case RC_COMPLETION_INLINE_TEXT:
710 lexrc >> completion_inline_text;
713 case RC_COMPLETION_INLINE_DOTS:
714 lexrc >> completion_inline_dots;
717 case RC_AUTOCORRECTION_MATH:
718 lexrc >> autocorrection_math;
721 case RC_COMPLETION_POPUP_DELAY:
722 lexrc >> completion_popup_delay;
725 case RC_COMPLETION_POPUP_MATH:
726 lexrc >> completion_popup_math;
729 case RC_COMPLETION_POPUP_TEXT:
730 lexrc >> completion_popup_text;
733 case RC_COMPLETION_CURSOR_TEXT:
734 lexrc >> completion_cursor_text;
737 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
738 lexrc >> completion_popup_after_complete;
741 case RC_COMPLETION_MINLENGTH:
742 lexrc >> completion_minlength;
745 case RC_NUMLASTFILES:
746 lexrc >> num_lastfiles;
749 case RC_CHECKLASTFILES:
750 lexrc >> check_lastfiles;
757 case RC_USE_SYSTEM_THEME_ICONS:
758 lexrc >> use_system_theme_icons;
761 case RC_SCREEN_FONT_ROMAN:
763 roman_font_name = lexrc.getString();
764 oldFontFormat(roman_font_name,
769 case RC_SCREEN_FONT_SANS:
771 sans_font_name = lexrc.getString();
772 oldFontFormat(sans_font_name, sans_font_foundry);
776 case RC_SCREEN_FONT_TYPEWRITER:
778 typewriter_font_name = lexrc.getString();
779 oldFontFormat(typewriter_font_name,
780 typewriter_font_foundry);
784 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
785 lexrc >> roman_font_foundry;
788 case RC_SCREEN_FONT_SANS_FOUNDRY:
789 lexrc >> sans_font_foundry;
792 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
793 lexrc >> typewriter_font_foundry;
798 lexrc.printError("Missing color tag.");
801 string lyx_name = lexrc.getString();
804 lexrc.printError("Missing color name for color: `$$Token'");
807 string x11_name = lexrc.getString();
809 ColorCode const col =
810 lcolor.getFromLyXName(lyx_name);
811 if (col == Color_none ||
812 col == Color_inherit ||
816 if (!lcolor.setColor(col, x11_name))
817 LYXERR0("Bad lyxrc set_color for " << lyx_name);
821 case RC_AUTOREGIONDELETE:
822 // Auto region delete defaults to true
823 lexrc >> auto_region_delete;
828 lyxpipes = os::internal_path(lexrc.getString());
831 case RC_CURSOR_FOLLOWS_SCROLLBAR:
832 lexrc >> cursor_follows_scrollbar;
835 case RC_CURSOR_WIDTH:
836 lexrc >> cursor_width;
839 case RC_SCROLL_BELOW_DOCUMENT:
840 lexrc >> scroll_below_document;
843 case RC_PARAGRAPH_MARKERS:
844 lexrc >> paragraph_markers;
847 case RC_MAC_DONTSWAP_CTRL_META:
848 lexrc >> mac_dontswap_ctrl_meta;
851 case RC_MAC_LIKE_CURSOR_MOVEMENT:
852 lexrc >> mac_like_cursor_movement;
855 case RC_MACRO_EDIT_STYLE:
857 switch (lexrc.getInteger()) {
858 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
859 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
860 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
865 case RC_DIALOGS_ICONIFY_WITH_MAIN:
866 lexrc >> dialogs_iconify_with_main;
869 case RC_PLAINTEXT_LINELEN:
870 lexrc >> plaintext_linelen;
872 // Spellchecker settings:
873 case RC_ACCEPT_COMPOUND:
874 lexrc >> spellchecker_accept_compound;
876 case RC_USE_SYSTEM_COLORS:
877 lexrc >> use_system_colors;
880 lexrc >> use_tooltip;
882 case RC_USE_PIXMAP_CACHE:
883 lexrc >> use_pixmap_cache;
888 case RC_SPELLCHECKER:
889 lexrc >> spellchecker;
892 lexrc >> spellchecker_alt_lang;
895 lexrc >> spellchecker_esc_chars;
897 case RC_SPELLCHECK_CONTINUOUSLY:
898 lexrc >> spellcheck_continuously;
900 case RC_SPELLCHECK_NOTES:
901 lexrc >> spellcheck_notes;
904 lexrc >> make_backup;
906 case RC_SAVE_COMPRESSED:
907 lexrc >> save_compressed;
910 lexrc >> save_origin;
912 case RC_BACKUPDIR_PATH:
914 backupdir_path = os::internal_path(lexrc.getString());
916 case RC_DEFAULT_DECIMAL_POINT:
917 lexrc >> default_decimal_point;
919 case RC_DEFAULT_LENGTH_UNIT:
921 default_length_unit = (Length::UNIT) lexrc.getInteger();
923 case RC_DATE_INSERT_FORMAT:
924 lexrc >> date_insert_format;
926 case RC_LANGUAGE_CUSTOM_PACKAGE:
927 lexrc >> language_custom_package;
929 case RC_LANGUAGE_AUTO_BEGIN:
930 lexrc >> language_auto_begin;
932 case RC_LANGUAGE_AUTO_END:
933 lexrc >> language_auto_end;
935 case RC_LANGUAGE_GLOBAL_OPTIONS:
936 lexrc >> language_global_options;
938 case RC_LANGUAGE_PACKAGE_SELECTION:
940 switch (lexrc.getInteger()) {
942 language_package_selection = LP_AUTO;
945 language_package_selection = LP_BABEL;
948 language_package_selection = LP_CUSTOM;
951 language_package_selection = LP_NONE;
956 case RC_LANGUAGE_COMMAND_BEGIN:
957 lexrc >> language_command_begin;
959 case RC_LANGUAGE_COMMAND_END:
960 lexrc >> language_command_end;
962 case RC_LANGUAGE_COMMAND_LOCAL:
963 lexrc >> language_command_local;
965 case RC_VISUAL_CURSOR:
966 lexrc >> visual_cursor;
968 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
969 lexrc >> close_buffer_with_last_view;
972 lexrc >> auto_number;
974 case RC_MARK_FOREIGN_LANGUAGE:
975 lexrc >> mark_foreign_language;
981 fmt = lexrc.getString();
982 if (lexrc.next(true))
983 command = lexrc.getString();
984 setMover(fmt, command);
989 string from, to, command, flags;
991 from = lexrc.getString();
993 to = lexrc.getString();
994 if (lexrc.next(true))
995 command = lexrc.getString();
997 flags = lexrc.getString();
999 theConverters().erase(from, to);
1001 theConverters().add(from, to, command, flags);
1004 // compatibility with versions older than 1.4.0 only
1006 string format, command;
1007 lexrc >> format >> command;
1008 theFormats().setViewer(format, command);
1011 case RC_FILEFORMAT: {
1013 string format, extensions, shortcut;
1014 docstring prettyname;
1015 if (!(lexrc >> format >> extensions))
1017 if (ok && lexrc.next(true))
1018 prettyname = lexrc.getDocString();
1022 if(!(lexrc >> shortcut))
1024 string viewer, editor;
1025 if (ok && lexrc.next(true))
1026 viewer = lexrc.getString();
1029 if (ok && lexrc.next(true))
1030 editor = lexrc.getString();
1034 if (!(lexrc >> flags >> mime))
1036 int flgs = Format::none;
1037 while (!flags.empty()) {
1039 flags = split(flags, flag, ',');
1040 if (flag == "document")
1041 flgs |= Format::document;
1042 else if (flag == "vector")
1043 flgs |= Format::vector;
1044 else if (flag == "zipped=native")
1045 flgs |= Format::zipped_native;
1046 else if (flag == "menu=export")
1047 flgs |= Format::export_menu;
1049 LYXERR0("Ignoring unknown flag `"
1050 << flag << "' for format `"
1054 LYXERR0("Syntax error in format " << format);
1055 else if (prettyname.empty()) {
1056 if (theConverters().formatIsUsed(format))
1057 LYXERR0("Can't delete format " << format);
1059 theFormats().erase(format);
1061 theFormats().add(format, extensions, prettyname,
1062 shortcut, viewer, editor, mime, flgs);
1066 case RC_VIEWER_ALTERNATIVES: {
1067 string format, command;
1068 if ((lexrc >> format) && lexrc.next(true)) {
1069 command = lexrc.getString();
1070 viewer_alternatives[format].insert(command);
1074 case RC_EDITOR_ALTERNATIVES: {
1075 string format, command;
1076 if ((lexrc >> format) && lexrc.next(true)) {
1077 command = lexrc.getString();
1078 editor_alternatives[format].insert(command);
1083 case RC_DEFAULT_OTF_VIEW_FORMAT:
1084 lexrc >> default_otf_view_format;
1087 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
1088 lexrc >> default_platex_view_format;
1091 case RC_DEFAULT_VIEW_FORMAT:
1092 lexrc >> default_view_format;
1095 case RC_GUI_LANGUAGE:
1096 lexrc >> gui_language;
1099 case RC_SHOW_BANNER:
1100 lexrc >> show_banner;
1105 string const tmp = lexrc.getString();
1106 if (tmp == "true" || tmp == "on")
1107 preview = PREVIEW_ON;
1108 else if (tmp == "no_math")
1109 preview = PREVIEW_NO_MATH;
1111 preview = PREVIEW_OFF;
1112 if (tmp != "false" && tmp != "off")
1113 LYXERR0("Unrecognized preview status \""
1119 case RC_PREVIEW_HASHED_LABELS:
1120 lexrc >> preview_hashed_labels;
1123 case RC_PREVIEW_SCALE_FACTOR:
1124 lexrc >> preview_scale_factor;
1131 lexrc >> user_email;
1134 case RC_PATH_PREFIX:
1135 lexrc >> path_prefix;
1138 case RC_USE_CONVERTER_CACHE:
1139 lexrc >> use_converter_cache;
1141 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1142 lexrc >> use_converter_needauth_forbidden;
1144 case RC_USE_CONVERTER_NEEDAUTH:
1145 lexrc >> use_converter_needauth;
1147 case RC_CONVERTER_CACHE_MAXAGE:
1148 lexrc >> converter_cache_maxage;
1151 case RC_SORT_LAYOUTS:
1152 lexrc >> sort_layouts;
1154 case RC_GROUP_LAYOUTS:
1155 lexrc >> group_layouts;
1157 case RC_FULL_SCREEN_LIMIT:
1158 lexrc >> full_screen_limit;
1160 case RC_FULL_SCREEN_TOOLBARS:
1161 lexrc >> full_screen_toolbars;
1163 case RC_FULL_SCREEN_SCROLLBAR:
1164 lexrc >> full_screen_scrollbar;
1166 case RC_FULL_SCREEN_STATUSBAR:
1167 lexrc >> full_screen_statusbar;
1169 case RC_FULL_SCREEN_TABBAR:
1170 lexrc >> full_screen_tabbar;
1172 case RC_FULL_SCREEN_MENUBAR:
1173 lexrc >> full_screen_menubar;
1175 case RC_FULL_SCREEN_WIDTH:
1176 lexrc >> full_screen_width;
1178 case RC_OPEN_BUFFERS_IN_TABS:
1179 lexrc >> open_buffers_in_tabs;
1181 case RC_SINGLE_CLOSE_TAB_BUTTON:
1182 lexrc >> single_close_tab_button;
1184 case RC_SINGLE_INSTANCE:
1185 lexrc >> single_instance;
1186 if (run_mode == PREFERRED)
1187 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1189 case RC_FORWARD_SEARCH_DVI:
1190 if (lexrc.next(true))
1191 forward_search_dvi = lexrc.getString();
1193 case RC_FORWARD_SEARCH_PDF:
1194 if (lexrc.next(true))
1195 forward_search_pdf = lexrc.getString();
1197 case RC_EXPORT_OVERWRITE:
1199 string const tmp = lexrc.getString();
1200 if (tmp == "all" || tmp == "true")
1201 export_overwrite = ALL_FILES;
1202 else if (tmp == "main")
1203 export_overwrite = MAIN_FILE;
1205 export_overwrite = NO_FILES;
1206 if (tmp != "ask" && tmp != "false")
1207 LYXERR0("Unrecognized export_overwrite status \""
1212 case RC_SCROLL_WHEEL_ZOOM:
1214 string const tmp = lexrc.getString();
1216 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1217 else if (tmp == "shift")
1218 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1219 else if (tmp == "alt")
1220 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1222 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1223 if (tmp != "off" && tmp != "false")
1224 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1230 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1231 lexrc >> mouse_middlebutton_paste;
1235 break; // this is just a dummy
1238 // This is triggered the first time through the loop unless
1239 // we hit a format tag.
1240 if (check_format && format != LYXRC_FILEFORMAT)
1241 return FormatMismatch;
1244 /// Update converters data-structures
1245 theConverters().update(theFormats());
1246 theConverters().buildGraph();
1247 theBufferList().invalidateConverterCache();
1253 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1255 ofstream ofs(filename.toFilesystemEncoding().c_str());
1257 write(ofs, ignore_system_lyxrc);
1261 void LyXRC::print() const
1263 if (lyxerr.debugging())
1264 write(lyxerr, false);
1272 typedef pair<string, SpecialisedMover> Data;
1274 SameMover(Data const & comparison)
1275 : comparison_(comparison) {}
1277 bool operator()(Data const & data) const
1279 return data.first == comparison_.first &&
1280 data.second.command() == comparison_.second.command();
1290 // Escape \ and " so that LyXLex can read the string later
1291 string escapeCommand(string const & str) {
1292 return subst(subst(str , "\\", "\\\\"),
1299 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1301 LyXRCTags tag = RC_LAST;
1303 if (!name.empty()) {
1304 for (int i = 0; i != lyxrcCount; ++i)
1305 if ("\\" + name == lyxrcTags[i].tag)
1306 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1310 os << "# LyX " << lyx_version
1311 << " generated this file. If you want to make your own\n"
1312 << "# modifications you should do them from inside LyX and save.\n\n"
1313 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1315 // Why the switch you might ask. It is a trick to ensure that all
1316 // the elements in the LyXRCTags enum are handled. As you can see
1317 // there are no breaks at all. So it is just a huge fall-through.
1318 // The nice thing is that we will get a warning from the compiler
1319 // if we forget an element.
1323 // input/include files are not done here
1324 case RC_LYXRCFORMAT:
1326 if (ignore_system_lyxrc ||
1327 bind_file != system_lyxrc.bind_file) {
1328 string const path = os::external_path(bind_file);
1329 os << "\\bind_file \"" << path << "\"\n";
1335 if (ignore_system_lyxrc ||
1336 def_file != system_lyxrc.def_file) {
1337 string const path = os::external_path(def_file);
1338 os << "\\def_file \"" << path << "\"\n";
1347 << "# MISC SECTION ######################################\n"
1349 // bind files are not done here.
1351 case RC_PATH_PREFIX:
1352 if (ignore_system_lyxrc ||
1353 path_prefix != system_lyxrc.path_prefix) {
1354 os << "\\path_prefix \"" << path_prefix << "\"\n";
1360 if (ignore_system_lyxrc ||
1361 ui_file != system_lyxrc.ui_file) {
1362 string const path = os::external_path(ui_file);
1363 os << "\\ui_file \"" << path << "\"\n";
1368 case RC_AUTOREGIONDELETE:
1369 if (ignore_system_lyxrc ||
1370 auto_region_delete != system_lyxrc.auto_region_delete) {
1371 os << "# Set to false to inhibit automatic replacement of\n"
1372 << "# the current selection.\n"
1373 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1379 case RC_AUTORESET_OPTIONS:
1380 if (ignore_system_lyxrc ||
1381 auto_reset_options != system_lyxrc.auto_reset_options) {
1382 os << "# Set to false to inhibit automatic reset of\n"
1383 << "# the class options to defaults on class change.\n"
1384 << "\\auto_reset_options "
1385 << convert<string>(auto_reset_options)
1392 if (ignore_system_lyxrc ||
1393 autosave != system_lyxrc.autosave) {
1394 os << "# The time interval between auto-saves in seconds.\n"
1395 << "\\autosave " << autosave << '\n';
1400 case RC_DISPLAY_GRAPHICS:
1401 if (ignore_system_lyxrc ||
1402 display_graphics != system_lyxrc.display_graphics) {
1403 os << "# Display graphics within LyX\n"
1405 << "\\display_graphics "
1406 << (display_graphics ? "true" : "false")
1412 case RC_SORT_LAYOUTS:
1413 if (ignore_system_lyxrc ||
1414 sort_layouts != system_lyxrc.sort_layouts) {
1415 os << "# Sort layouts alphabetically.\n"
1416 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1421 case RC_GROUP_LAYOUTS:
1422 if (ignore_system_lyxrc ||
1423 group_layouts != system_lyxrc.group_layouts) {
1424 os << "# Group layouts by their category.\n"
1425 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1430 case RC_VIEWDVI_PAPEROPTION:
1431 if (ignore_system_lyxrc ||
1432 view_dvi_paper_option
1433 != system_lyxrc.view_dvi_paper_option) {
1434 os << "# Options used to specify paper size to the\n"
1435 << "# view_dvi_command (e.g. -paper)\n"
1436 << "\\view_dvi_paper_option \""
1437 << view_dvi_paper_option << "\"\n";
1442 case RC_CHKTEX_COMMAND:
1443 if (ignore_system_lyxrc ||
1444 chktex_command != system_lyxrc.chktex_command) {
1445 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1450 case RC_BIBTEX_ALTERNATIVES: {
1451 CommandSet::const_iterator it = bibtex_alternatives.begin();
1452 CommandSet::const_iterator end = bibtex_alternatives.end();
1453 for ( ; it != end; ++it) {
1454 if (ignore_system_lyxrc
1455 || !system_lyxrc.bibtex_alternatives.count(*it))
1456 os << "\\bibtex_alternatives \""
1463 case RC_BIBTEX_COMMAND:
1464 if (ignore_system_lyxrc ||
1465 bibtex_command != system_lyxrc.bibtex_command) {
1466 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1471 case RC_JBIBTEX_COMMAND:
1472 if (ignore_system_lyxrc ||
1473 jbibtex_command != system_lyxrc.jbibtex_command) {
1474 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1479 case RC_JBIBTEX_ALTERNATIVES: {
1480 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1481 CommandSet::const_iterator end = jbibtex_alternatives.end();
1482 for ( ; it != end; ++it) {
1483 if (ignore_system_lyxrc
1484 || !system_lyxrc.jbibtex_alternatives.count(*it))
1485 os << "\\jbibtex_alternatives \""
1492 case RC_INDEX_ALTERNATIVES: {
1493 CommandSet::const_iterator it = index_alternatives.begin();
1494 CommandSet::const_iterator end = index_alternatives.end();
1495 for ( ; it != end; ++it) {
1496 if (ignore_system_lyxrc
1497 || !system_lyxrc.index_alternatives.count(*it))
1498 os << "\\index_alternatives \""
1505 case RC_INDEX_COMMAND:
1506 if (ignore_system_lyxrc ||
1507 index_command != system_lyxrc.index_command) {
1508 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1513 case RC_JINDEX_COMMAND:
1514 if (ignore_system_lyxrc ||
1515 jindex_command != system_lyxrc.jindex_command) {
1516 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1521 case RC_SPLITINDEX_COMMAND:
1522 if (ignore_system_lyxrc ||
1523 splitindex_command != system_lyxrc.splitindex_command) {
1524 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1529 case RC_NOMENCL_COMMAND:
1530 if (ignore_system_lyxrc ||
1531 nomencl_command != system_lyxrc.nomencl_command) {
1532 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1537 case RC_PYGMENTIZE_COMMAND:
1538 if (ignore_system_lyxrc ||
1539 pygmentize_command != system_lyxrc.pygmentize_command) {
1540 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1545 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1546 // Don't write this setting to the preferences file,
1547 // but allow temporary changes (bug 7557).
1548 if (ignore_system_lyxrc) {
1549 os << "\\tex_expects_windows_paths "
1550 << convert<string>(windows_style_tex_paths) << '\n';
1555 case RC_TEX_ALLOWS_SPACES:
1556 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1557 os << "\\tex_allows_spaces "
1558 << convert<string>(tex_allows_spaces) << '\n';
1564 if (ignore_system_lyxrc ||
1565 use_kbmap != system_lyxrc.use_kbmap) {
1566 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1571 case RC_KBMAP_PRIMARY:
1572 if (ignore_system_lyxrc ||
1573 primary_kbmap != system_lyxrc.primary_kbmap) {
1574 string const path = os::external_path(primary_kbmap);
1575 os << "\\kbmap_primary \"" << path << "\"\n";
1580 case RC_KBMAP_SECONDARY:
1581 if (ignore_system_lyxrc ||
1582 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1583 string const path = os::external_path(secondary_kbmap);
1584 os << "\\kbmap_secondary \"" << path << "\"\n";
1590 if (ignore_system_lyxrc ||
1591 lyxpipes != system_lyxrc.lyxpipes) {
1592 string const path = os::external_path(lyxpipes);
1593 os << "\\serverpipe \"" << path << "\"\n";
1598 case RC_DATE_INSERT_FORMAT:
1599 if (ignore_system_lyxrc ||
1600 date_insert_format != system_lyxrc.date_insert_format) {
1601 os << "\\date_insert_format \"" << date_insert_format
1608 os << "\\user_name \"" << user_name << "\"\n";
1613 os << "\\user_email \"" << user_email << "\"\n";
1617 case RC_SHOW_BANNER:
1618 if (ignore_system_lyxrc ||
1619 show_banner != system_lyxrc.show_banner) {
1620 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1626 if (ignore_system_lyxrc ||
1627 preview != system_lyxrc.preview) {
1633 case PREVIEW_NO_MATH:
1640 os << "\\preview " << status << '\n';
1645 case RC_PREVIEW_HASHED_LABELS:
1646 if (ignore_system_lyxrc ||
1647 preview_hashed_labels !=
1648 system_lyxrc.preview_hashed_labels) {
1649 os << "\\preview_hashed_labels "
1650 << convert<string>(preview_hashed_labels) << '\n';
1655 case RC_PREVIEW_SCALE_FACTOR:
1656 if (ignore_system_lyxrc ||
1657 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1658 os << "\\preview_scale_factor "
1659 << preview_scale_factor << '\n';
1664 case RC_USE_CONVERTER_CACHE:
1665 if (ignore_system_lyxrc ||
1666 use_converter_cache != system_lyxrc.use_converter_cache) {
1667 os << "\\use_converter_cache "
1668 << convert<string>(use_converter_cache) << '\n';
1673 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1674 if (ignore_system_lyxrc ||
1675 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1676 os << "\\use_converter_needauth_forbidden "
1677 << convert<string>(use_converter_needauth_forbidden) << '\n';
1682 case RC_USE_CONVERTER_NEEDAUTH:
1683 if (ignore_system_lyxrc ||
1684 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1685 os << "\\use_converter_needauth "
1686 << convert<string>(use_converter_needauth) << '\n';
1691 case RC_CONVERTER_CACHE_MAXAGE:
1692 if (ignore_system_lyxrc ||
1693 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1694 os << "\\converter_cache_maxage "
1695 << converter_cache_maxage << '\n';
1701 << "# SCREEN & FONTS SECTION ############################\n"
1705 if (ignore_system_lyxrc ||
1706 icon_set != system_lyxrc.icon_set) {
1707 os << "\\icon_set \"" << icon_set
1713 case RC_USE_SYSTEM_THEME_ICONS:
1714 if (ignore_system_lyxrc ||
1715 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1716 os << "\\use_system_theme_icons "
1717 << convert<string>(use_system_theme_icons)
1724 if (ignore_system_lyxrc ||
1725 dpi != system_lyxrc.dpi) {
1726 os << "\\screen_dpi " << dpi << '\n';
1731 case RC_SCREEN_ZOOM:
1732 if (ignore_system_lyxrc ||
1733 defaultZoom != system_lyxrc.defaultZoom) {
1734 os << "\\screen_zoom " << defaultZoom << '\n';
1739 case RC_GEOMETRY_SESSION:
1740 if (ignore_system_lyxrc ||
1741 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1742 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1748 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1749 if (ignore_system_lyxrc ||
1750 cursor_follows_scrollbar
1751 != system_lyxrc.cursor_follows_scrollbar) {
1752 os << "\\cursor_follows_scrollbar "
1753 << convert<string>(cursor_follows_scrollbar) << '\n';
1758 case RC_CURSOR_WIDTH:
1759 if (ignore_system_lyxrc ||
1761 != system_lyxrc.cursor_width) {
1762 os << "\\cursor_width "
1763 << cursor_width << '\n';
1768 case RC_SCROLL_BELOW_DOCUMENT:
1769 if (ignore_system_lyxrc ||
1770 scroll_below_document
1771 != system_lyxrc.scroll_below_document) {
1772 os << "\\scroll_below_document "
1773 << convert<string>(scroll_below_document) << '\n';
1778 case RC_PARAGRAPH_MARKERS:
1779 if (ignore_system_lyxrc ||
1781 != system_lyxrc.paragraph_markers) {
1782 os << "\\paragraph_markers "
1783 << 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';
1798 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1799 if (ignore_system_lyxrc ||
1800 mac_like_cursor_movement
1801 != system_lyxrc.mac_like_cursor_movement) {
1802 os << "\\mac_like_cursor_movement "
1803 << convert<string>(mac_like_cursor_movement) << '\n';
1808 case RC_MACRO_EDIT_STYLE:
1809 if (ignore_system_lyxrc ||
1811 != system_lyxrc.macro_edit_style) {
1812 os << "\\macro_edit_style ";
1813 switch (macro_edit_style) {
1814 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1815 case MACRO_EDIT_INLINE: os << "1\n"; break;
1816 case MACRO_EDIT_LIST: os << "2\n"; break;
1822 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1823 if (ignore_system_lyxrc ||
1824 dialogs_iconify_with_main
1825 != system_lyxrc.dialogs_iconify_with_main) {
1826 os << "\\dialogs_iconify_with_main "
1827 << convert<string>(dialogs_iconify_with_main) << '\n';
1832 case RC_SCREEN_FONT_ROMAN:
1833 if (ignore_system_lyxrc ||
1834 roman_font_name != system_lyxrc.roman_font_name) {
1835 os << "\\screen_font_roman \"" << roman_font_name
1841 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1842 if (ignore_system_lyxrc ||
1843 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1844 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1850 case RC_SCREEN_FONT_SANS:
1851 if (ignore_system_lyxrc ||
1852 sans_font_name != system_lyxrc.sans_font_name) {
1853 os << "\\screen_font_sans \"" << sans_font_name
1859 case RC_SCREEN_FONT_SANS_FOUNDRY:
1860 if (ignore_system_lyxrc ||
1861 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1862 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1868 case RC_SCREEN_FONT_TYPEWRITER:
1869 if (ignore_system_lyxrc ||
1870 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1871 os << "\\screen_font_typewriter \""
1872 << typewriter_font_name << "\"\n";
1877 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1878 if (ignore_system_lyxrc ||
1879 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1880 os << "\\screen_font_typewriter_foundry \""
1881 << typewriter_font_foundry << "\"\n";
1886 case RC_SCREEN_FONT_SCALABLE:
1887 if (ignore_system_lyxrc ||
1888 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1889 os << "\\screen_font_scalable "
1890 << convert<string>(use_scalable_fonts)
1896 case RC_SCREEN_FONT_SIZES:
1897 if (ignore_system_lyxrc ||
1898 font_sizes[FONT_SIZE_TINY]
1899 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1900 font_sizes[FONT_SIZE_SCRIPT]
1901 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1902 font_sizes[FONT_SIZE_FOOTNOTE]
1903 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1904 font_sizes[FONT_SIZE_SMALL]
1905 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1906 font_sizes[FONT_SIZE_NORMAL]
1907 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1908 font_sizes[FONT_SIZE_LARGE]
1909 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1910 font_sizes[FONT_SIZE_LARGER]
1911 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1912 font_sizes[FONT_SIZE_LARGEST]
1913 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1914 font_sizes[FONT_SIZE_HUGE]
1915 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1916 font_sizes[FONT_SIZE_HUGER]
1917 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1918 streamsize old_prec = os.precision();
1919 os.setf(ios::fixed);
1921 os << "\\screen_font_sizes"
1922 << ' ' << font_sizes[FONT_SIZE_TINY]
1923 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1924 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1925 << ' ' << font_sizes[FONT_SIZE_SMALL]
1926 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1927 << ' ' << font_sizes[FONT_SIZE_LARGE]
1928 << ' ' << font_sizes[FONT_SIZE_LARGER]
1929 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1930 << ' ' << font_sizes[FONT_SIZE_HUGE]
1931 << ' ' << font_sizes[FONT_SIZE_HUGER]
1933 os.precision(old_prec);
1934 os.unsetf(ios::fixed);
1939 case RC_FULL_SCREEN_LIMIT:
1940 if (ignore_system_lyxrc ||
1941 full_screen_limit != system_lyxrc.full_screen_limit) {
1942 os << "\\fullscreen_limit "
1943 << convert<string>(full_screen_limit)
1949 case RC_FULL_SCREEN_TOOLBARS:
1950 if (ignore_system_lyxrc ||
1951 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1952 os << "\\fullscreen_toolbars "
1953 << convert<string>(full_screen_toolbars)
1959 case RC_FULL_SCREEN_SCROLLBAR:
1960 if (ignore_system_lyxrc ||
1961 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1962 os << "\\fullscreen_scrollbar "
1963 << convert<string>(full_screen_scrollbar)
1969 case RC_FULL_SCREEN_STATUSBAR:
1970 if (ignore_system_lyxrc ||
1971 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1972 os << "\\fullscreen_statusbar "
1973 << convert<string>(full_screen_statusbar)
1979 case RC_FULL_SCREEN_TABBAR:
1980 if (ignore_system_lyxrc ||
1981 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1982 os << "\\fullscreen_tabbar "
1983 << convert<string>(full_screen_tabbar)
1989 case RC_FULL_SCREEN_MENUBAR:
1990 if (ignore_system_lyxrc ||
1991 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1992 os << "\\fullscreen_menubar "
1993 << convert<string>(full_screen_menubar)
1999 case RC_FULL_SCREEN_WIDTH:
2000 if (ignore_system_lyxrc ||
2001 full_screen_width != system_lyxrc.full_screen_width) {
2002 os << "\\fullscreen_width "
2003 << convert<string>(full_screen_width)
2009 case RC_OPEN_BUFFERS_IN_TABS:
2010 if (ignore_system_lyxrc ||
2011 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2012 os << "\\open_buffers_in_tabs "
2013 << convert<string>(open_buffers_in_tabs)
2019 case RC_SINGLE_CLOSE_TAB_BUTTON:
2020 if (ignore_system_lyxrc ||
2021 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2022 os << "\\single_close_tab_button "
2023 << convert<string>(single_close_tab_button)
2029 case RC_SINGLE_INSTANCE:
2030 if (ignore_system_lyxrc ||
2031 single_instance != system_lyxrc.single_instance) {
2032 os << "\\single_instance "
2033 << convert<string>(single_instance)
2039 case RC_FORWARD_SEARCH_DVI:
2040 if (ignore_system_lyxrc ||
2041 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2042 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2047 case RC_FORWARD_SEARCH_PDF:
2048 if (ignore_system_lyxrc ||
2049 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2050 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2056 << "# COLOR SECTION ###################################\n"
2061 for (int i = 0; i < Color_ignore; ++i) {
2062 ColorCode lc = static_cast<ColorCode>(i);
2063 string const col = lcolor.getX11Name(lc);
2064 if (ignore_system_lyxrc
2065 || col != system_lcolor.getX11Name(lc)) {
2066 os << "\\set_color \""
2067 << lcolor.getLyXName(lc) << "\" \""
2075 << "# PRINTER SECTION ###################################\n"
2079 case RC_PRINTLANDSCAPEFLAG:
2080 if (ignore_system_lyxrc ||
2081 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2082 os << "\\print_landscape_flag \"" << print_landscape_flag
2088 case RC_PRINTPAPERFLAG:
2089 if (ignore_system_lyxrc ||
2090 print_paper_flag != system_lyxrc.print_paper_flag) {
2091 os << "\\print_paper_flag \"" << print_paper_flag
2097 case RC_PRINTPAPERDIMENSIONFLAG:
2098 if (ignore_system_lyxrc ||
2099 print_paper_dimension_flag
2100 != system_lyxrc.print_paper_dimension_flag) {
2101 os << "\\print_paper_dimension_flag \""
2102 << print_paper_dimension_flag << "\"\n";
2108 << "# TEX SECTION #######################################\n"
2112 case RC_TEXINPUTS_PREFIX:
2113 if (ignore_system_lyxrc ||
2114 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2115 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2120 case RC_FONT_ENCODING:
2121 if (ignore_system_lyxrc ||
2122 fontenc != system_lyxrc.fontenc) {
2123 os << "\\font_encoding \"" << fontenc << "\"\n";
2129 << "# FILE SECTION ######################################\n"
2133 case RC_DOCUMENTPATH:
2134 if (ignore_system_lyxrc ||
2135 document_path != system_lyxrc.document_path) {
2136 string const path = os::external_path(document_path);
2137 os << "\\document_path \"" << path << "\"\n";
2142 case RC_USELASTFILEPOS:
2143 if (ignore_system_lyxrc ||
2144 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2145 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2151 case RC_LOADSESSION:
2152 if (ignore_system_lyxrc ||
2153 load_session != system_lyxrc.load_session) {
2154 os << "\\load_session " << convert<string>(load_session)
2160 case RC_MOUSE_WHEEL_SPEED:
2161 if (ignore_system_lyxrc ||
2162 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2163 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2168 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2169 if (ignore_system_lyxrc ||
2170 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2171 os << "\\mouse_middlebutton_paste "
2172 << convert<string>(mouse_middlebutton_paste) << '\n';
2177 case RC_COMPLETION_INLINE_DELAY:
2178 if (ignore_system_lyxrc ||
2179 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2180 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2185 case RC_COMPLETION_INLINE_MATH:
2186 if (ignore_system_lyxrc ||
2187 completion_inline_math != system_lyxrc.completion_inline_math) {
2188 os << "\\completion_inline_math "
2189 << convert<string>(completion_inline_math) << '\n';
2194 case RC_COMPLETION_INLINE_TEXT:
2195 if (ignore_system_lyxrc ||
2196 completion_inline_text != system_lyxrc.completion_inline_text) {
2197 os << "\\completion_inline_text "
2198 << convert<string>(completion_inline_text) << '\n';
2203 case RC_COMPLETION_INLINE_DOTS:
2204 if (ignore_system_lyxrc ||
2205 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2206 os << "\\completion_inline_dots "
2207 << convert<string>(completion_inline_dots) << '\n';
2212 case RC_AUTOCORRECTION_MATH:
2213 if (ignore_system_lyxrc ||
2214 autocorrection_math != system_lyxrc.autocorrection_math) {
2215 os << "\\autocorrection_math "
2216 << convert<string>(autocorrection_math) << '\n';
2221 case RC_COMPLETION_POPUP_DELAY:
2222 if (ignore_system_lyxrc ||
2223 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2224 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2229 case RC_COMPLETION_POPUP_MATH:
2230 if (ignore_system_lyxrc ||
2231 completion_popup_math != system_lyxrc.completion_popup_math) {
2232 os << "\\completion_popup_math "
2233 << convert<string>(completion_popup_math) << '\n';
2238 case RC_COMPLETION_POPUP_TEXT:
2239 if (ignore_system_lyxrc ||
2240 completion_popup_text != system_lyxrc.completion_popup_text) {
2241 os << "\\completion_popup_text "
2242 << convert<string>(completion_popup_text) << '\n';
2247 case RC_COMPLETION_CURSOR_TEXT:
2248 if (ignore_system_lyxrc ||
2249 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2250 os << "\\completion_cursor_text "
2251 << convert<string>(completion_cursor_text) << '\n';
2256 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2257 if (ignore_system_lyxrc ||
2258 completion_popup_after_complete
2259 != system_lyxrc.completion_popup_after_complete) {
2260 os << "\\completion_popup_after_complete "
2261 << convert<string>(completion_popup_after_complete) << '\n';
2266 case RC_COMPLETION_MINLENGTH:
2267 if (ignore_system_lyxrc ||
2268 completion_minlength != system_lyxrc.completion_minlength) {
2269 os << "\\completion_minlength " << convert<string>(completion_minlength)
2275 case RC_NUMLASTFILES:
2276 if (ignore_system_lyxrc ||
2277 num_lastfiles != system_lyxrc.num_lastfiles) {
2278 os << "\\num_lastfiles " << num_lastfiles << '\n';
2283 case RC_CHECKLASTFILES:
2284 if (ignore_system_lyxrc ||
2285 check_lastfiles != system_lyxrc.check_lastfiles) {
2286 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2292 case RC_EXAMPLEPATH:
2293 if (ignore_system_lyxrc ||
2294 example_path != system_lyxrc.example_path) {
2295 string const path = os::external_path(example_path);
2296 os << "\\example_path \"" << path << "\"\n";
2301 case RC_TEMPLATEPATH:
2302 if (ignore_system_lyxrc ||
2303 template_path != system_lyxrc.template_path) {
2304 string const path = os::external_path(template_path);
2305 os << "\\template_path \"" << path << "\"\n";
2310 case RC_TEMPDIRPATH:
2311 if (ignore_system_lyxrc ||
2312 tempdir_path != system_lyxrc.tempdir_path) {
2313 string const path = os::external_path(tempdir_path);
2314 os << "\\tempdir_path \"" << path << "\"\n";
2319 case RC_THESAURUSDIRPATH:
2320 if (ignore_system_lyxrc ||
2321 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2322 string const path = os::external_path(thesaurusdir_path);
2323 os << "\\thesaurusdir_path \"" << path << "\"\n";
2328 case RC_HUNSPELLDIR_PATH:
2329 if (ignore_system_lyxrc ||
2330 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2331 string const path = os::external_path(hunspelldir_path);
2332 os << "\\hunspelldir_path \"" << path << "\"\n";
2337 case RC_PLAINTEXT_LINELEN:
2338 if (ignore_system_lyxrc ||
2339 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2340 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2345 case RC_MAKE_BACKUP:
2346 if (ignore_system_lyxrc ||
2347 make_backup != system_lyxrc.make_backup) {
2348 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2353 case RC_SAVE_COMPRESSED:
2354 if (ignore_system_lyxrc ||
2355 save_compressed != system_lyxrc.save_compressed) {
2356 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2361 case RC_SAVE_ORIGIN:
2362 if (ignore_system_lyxrc ||
2363 save_origin != system_lyxrc.save_origin) {
2364 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2369 case RC_BACKUPDIR_PATH:
2370 if (ignore_system_lyxrc ||
2371 backupdir_path != system_lyxrc.backupdir_path) {
2372 string const path = os::external_path(backupdir_path);
2373 os << "\\backupdir_path \"" << path << "\"\n";
2379 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2383 << "# SPELLCHECKER SECTION ##############################\n"
2387 case RC_ACCEPT_COMPOUND:
2388 if (ignore_system_lyxrc ||
2389 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2390 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2397 if (ignore_system_lyxrc ||
2398 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2399 os << "\\alternate_language \"" << spellchecker_alt_lang
2406 if (ignore_system_lyxrc ||
2407 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2408 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2413 case RC_USE_SYSTEM_COLORS:
2414 if (ignore_system_lyxrc ||
2415 use_system_colors != system_lyxrc.use_system_colors) {
2416 os << "\\use_system_colors "
2417 << convert<string>(use_system_colors)
2423 case RC_USE_TOOLTIP:
2424 if (ignore_system_lyxrc ||
2425 use_tooltip != system_lyxrc.use_tooltip) {
2426 os << "\\use_tooltip "
2427 << convert<string>(use_tooltip)
2433 case RC_USE_PIXMAP_CACHE:
2434 if (ignore_system_lyxrc ||
2435 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2436 os << "\\use_pixmap_cache "
2437 << convert<string>(use_pixmap_cache)
2444 if (ignore_system_lyxrc ||
2445 use_qimage != system_lyxrc.use_qimage) {
2446 os << "\\use_qimage "
2447 << convert<string>(use_qimage)
2454 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2458 case RC_DEFAULT_DECIMAL_POINT:
2459 if (ignore_system_lyxrc ||
2460 default_decimal_point != system_lyxrc.default_decimal_point) {
2461 os << "\\default_decimal_point " << default_decimal_point << '\n';
2466 case RC_DEFAULT_LENGTH_UNIT:
2467 if (ignore_system_lyxrc ||
2468 default_length_unit != system_lyxrc.default_length_unit) {
2469 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2474 case RC_SPELLCHECKER:
2475 if (ignore_system_lyxrc ||
2476 spellchecker != system_lyxrc.spellchecker) {
2477 os << "\\spellchecker " << spellchecker << '\n';
2482 case RC_SPELLCHECK_CONTINUOUSLY:
2483 if (ignore_system_lyxrc ||
2484 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2485 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2491 case RC_SPELLCHECK_NOTES:
2492 if (ignore_system_lyxrc ||
2493 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2494 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2500 case RC_VISUAL_CURSOR:
2501 if (ignore_system_lyxrc ||
2502 visual_cursor != system_lyxrc.visual_cursor) {
2503 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2508 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2509 if (ignore_system_lyxrc ||
2510 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2511 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2512 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2517 case RC_LANGUAGE_CUSTOM_PACKAGE:
2518 if (ignore_system_lyxrc ||
2519 language_custom_package != system_lyxrc.language_custom_package) {
2520 os << "\\language_custom_package \"" << language_custom_package
2526 case RC_LANGUAGE_GLOBAL_OPTIONS:
2527 if (ignore_system_lyxrc ||
2528 language_global_options
2529 != system_lyxrc.language_global_options) {
2530 os << "\\language_global_options \""
2531 << convert<string>(language_global_options)
2537 case RC_LANGUAGE_PACKAGE_SELECTION:
2538 if (ignore_system_lyxrc ||
2539 language_package_selection != system_lyxrc.language_package_selection) {
2540 os << "\\language_package_selection ";
2541 switch (language_package_selection) {
2559 case RC_LANGUAGE_COMMAND_BEGIN:
2560 if (ignore_system_lyxrc ||
2561 language_command_begin
2562 != system_lyxrc.language_command_begin) {
2563 os << "\\language_command_begin \""
2564 << language_command_begin
2570 case RC_LANGUAGE_COMMAND_END:
2571 if (ignore_system_lyxrc ||
2572 language_command_end
2573 != system_lyxrc.language_command_end) {
2574 os << "\\language_command_end \"" << language_command_end
2580 case RC_LANGUAGE_COMMAND_LOCAL:
2581 if (ignore_system_lyxrc ||
2582 language_command_local
2583 != system_lyxrc.language_command_local) {
2584 os << "\\language_command_local \""
2585 << language_command_local
2591 case RC_LANGUAGE_AUTO_BEGIN:
2592 if (ignore_system_lyxrc ||
2593 language_auto_begin != system_lyxrc.language_auto_begin) {
2594 os << "\\language_auto_begin "
2595 << convert<string>(language_auto_begin) << '\n';
2600 case RC_LANGUAGE_AUTO_END:
2601 if (ignore_system_lyxrc ||
2602 language_auto_end != system_lyxrc.language_auto_end) {
2603 os << "\\language_auto_end "
2604 << convert<string>(language_auto_end) << '\n';
2609 case RC_MARK_FOREIGN_LANGUAGE:
2610 if (ignore_system_lyxrc ||
2611 mark_foreign_language
2612 != system_lyxrc.mark_foreign_language) {
2613 os << "\\mark_foreign_language " <<
2614 convert<string>(mark_foreign_language) << '\n';
2620 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2624 case RC_AUTO_NUMBER:
2625 if (ignore_system_lyxrc ||
2626 auto_number != system_lyxrc.auto_number) {
2627 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2632 case RC_GUI_LANGUAGE:
2633 if (ignore_system_lyxrc ||
2634 gui_language != system_lyxrc.gui_language) {
2635 os << "\\gui_language " << gui_language << '\n';
2640 case RC_EXPORT_OVERWRITE:
2641 if (ignore_system_lyxrc ||
2642 export_overwrite != system_lyxrc.export_overwrite) {
2644 switch (export_overwrite) {
2655 os << "\\export_overwrite " << status << '\n';
2660 case RC_SCROLL_WHEEL_ZOOM:
2661 if (ignore_system_lyxrc ||
2662 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2664 switch (scroll_wheel_zoom) {
2665 case SCROLL_WHEEL_ZOOM_OFF:
2668 case SCROLL_WHEEL_ZOOM_CTRL:
2671 case SCROLL_WHEEL_ZOOM_SHIFT:
2674 case SCROLL_WHEEL_ZOOM_ALT:
2678 os << "\\scroll_wheel_zoom " << status << '\n';
2684 << "# FORMATS SECTION ##########################\n"
2689 // New/modified formats
2690 for (Formats::const_iterator cit = theFormats().begin();
2691 cit != theFormats().end(); ++cit) {
2692 Format const * format =
2693 theSystemFormats().getFormat(cit->name());
2695 format->extensions() != cit->extensions() ||
2696 format->prettyname() != cit->prettyname() ||
2697 format->shortcut() != cit->shortcut() ||
2698 format->viewer() != cit->viewer() ||
2699 format->editor() != cit->editor() ||
2700 format->documentFormat() != cit->documentFormat() ||
2701 format->vectorFormat() != cit->vectorFormat() ||
2702 format->inExportMenu() != cit->inExportMenu() ||
2703 format->mime() != cit->mime()) {
2704 os << "\\format \"" << cit->name() << "\" \""
2705 << cit->extensions() << "\" \""
2706 << to_utf8(cit->prettyname()) << "\" \""
2707 << cit->shortcut() << "\" \""
2708 << escapeCommand(cit->viewer()) << "\" \""
2709 << escapeCommand(cit->editor()) << "\" \"";
2710 vector<string> flags;
2711 if (cit->documentFormat())
2712 flags.push_back("document");
2713 if (cit->vectorFormat())
2714 flags.push_back("vector");
2715 if (cit->zippedNative())
2716 flags.push_back("zipped=native");
2717 if (cit->inExportMenu())
2718 flags.push_back("menu=export");
2720 os << getStringFromVector(flags);
2721 os << "\" \"" << cit->mime() << "\"\n";
2725 // Look for deleted formats
2726 for (Formats::const_iterator cit = theSystemFormats().begin();
2727 cit != theSystemFormats().end(); ++cit)
2728 if (!theFormats().getFormat(cit->name()))
2729 os << "\\format \"" << cit->name()
2730 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2734 case RC_VIEWER_ALTERNATIVES: {
2735 Alternatives::const_iterator it = viewer_alternatives.begin();
2736 Alternatives::const_iterator const en = viewer_alternatives.end();
2737 Alternatives::const_iterator const sysend =
2738 system_lyxrc.viewer_alternatives.end();
2739 for (; it != en; ++it) {
2740 string const & fmt = it->first;
2741 CommandSet const & cmd = it->second;
2742 CommandSet::const_iterator sit = cmd.begin();
2743 CommandSet::const_iterator const sen = cmd.end();
2744 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2745 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2746 system_lyxrc.viewer_alternatives.find(fmt);
2747 for (; sit != sen; ++sit) {
2748 string const & cmd = *sit;
2749 if (ignore_system_lyxrc
2750 || sysfmt == sysend // format not found
2751 || sysfmt->second.count(cmd) == 0 // this command not found
2753 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(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 << " \"" << escapeCommand(cmd) << "\"\n";
2786 case RC_DEFAULT_OTF_VIEW_FORMAT:
2787 if ((ignore_system_lyxrc ||
2788 default_otf_view_format != system_lyxrc.default_otf_view_format)
2789 && !default_otf_view_format.empty()) {
2790 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2795 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2796 if ((ignore_system_lyxrc ||
2797 default_platex_view_format != system_lyxrc.default_platex_view_format)
2798 && !default_platex_view_format.empty()) {
2799 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2804 case RC_DEFAULT_VIEW_FORMAT:
2805 if (ignore_system_lyxrc ||
2806 default_view_format != system_lyxrc.default_view_format) {
2807 os << "\\default_view_format " << default_view_format << '\n';
2818 << "# CONVERTERS SECTION ##########################\n"
2823 // Look for new converters
2824 for (Converters::const_iterator cit = theConverters().begin();
2825 cit != theConverters().end(); ++cit) {
2826 Converter const * converter =
2827 theSystemConverters().getConverter(cit->from(),
2830 converter->command() != cit->command() ||
2831 converter->flags() != cit->flags())
2832 os << "\\converter \"" << cit->from() << "\" \""
2833 << cit->to() << "\" \""
2834 << escapeCommand(cit->command()) << "\" \""
2835 << cit->flags() << "\"\n";
2838 // New/modifed converters
2839 for (Converters::const_iterator cit = theSystemConverters().begin();
2840 cit != theSystemConverters().end(); ++cit)
2841 if (!theConverters().getConverter(cit->from(), cit->to()))
2842 os << "\\converter \"" << cit->from()
2843 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2850 << "# COPIERS SECTION ##########################\n"
2853 // Look for new movers
2854 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2855 Movers::const_iterator const sysend = theSystemMovers().end();
2856 Movers::const_iterator it = theMovers().begin();
2857 Movers::const_iterator end = theMovers().end();
2859 for (; it != end; ++it) {
2860 Movers::const_iterator const sysit =
2861 find_if(sysbegin, sysend, SameMover(*it));
2862 if (sysit == sysend) {
2863 string const & fmt = it->first;
2864 string const & command =
2865 it->second.command();
2867 os << "\\copier " << fmt
2868 << " \"" << escapeCommand(command) << "\"\n";
2874 // We don't actually delete SpecialisedMover(s) from the
2875 // map, just clear their 'command', so there's no need
2876 // to test for anything else.
2883 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2885 // Why the switch you might ask. It is a trick to ensure that all
2886 // the elements in the LyXRCTags enum is handled. As you can see
2887 // there are no breaks at all. So it is just a huge fall-through.
2888 // The nice thing is that we will get a warning from the compiler
2889 // if we forget an element.
2890 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2892 case LyXRC::RC_LAST:
2893 case LyXRC::RC_ACCEPT_COMPOUND:
2894 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2895 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2897 case LyXRC::RC_ALT_LANG:
2898 case LyXRC::RC_PLAINTEXT_LINELEN:
2899 case LyXRC::RC_AUTOCORRECTION_MATH:
2900 case LyXRC::RC_AUTOREGIONDELETE:
2901 case LyXRC::RC_AUTORESET_OPTIONS:
2902 case LyXRC::RC_AUTOSAVE:
2903 case LyXRC::RC_AUTO_NUMBER:
2904 case LyXRC::RC_BACKUPDIR_PATH:
2905 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2906 case LyXRC::RC_BIBTEX_COMMAND:
2907 case LyXRC::RC_BINDFILE:
2908 case LyXRC::RC_CHECKLASTFILES:
2909 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2910 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2911 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2912 case LyXRC::RC_COMPLETION_INLINE_MATH:
2913 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2914 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2915 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2916 case LyXRC::RC_COMPLETION_POPUP_MATH:
2917 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2918 case LyXRC::RC_COMPLETION_MINLENGTH:
2919 case LyXRC::RC_USELASTFILEPOS:
2920 case LyXRC::RC_LOADSESSION:
2921 case LyXRC::RC_CHKTEX_COMMAND:
2922 case LyXRC::RC_CONVERTER:
2923 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2924 case LyXRC::RC_COPIER:
2925 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2926 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2927 case LyXRC::RC_DATE_INSERT_FORMAT:
2928 case LyXRC::RC_GUI_LANGUAGE:
2929 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2930 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2931 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2932 case LyXRC::RC_DEFFILE:
2933 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2934 case LyXRC::RC_DISPLAY_GRAPHICS:
2935 case LyXRC::RC_DOCUMENTPATH:
2936 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2937 FileName path(lyxrc_new.document_path);
2938 if (path.exists() && path.isDirectory())
2939 package().document_dir() = FileName(lyxrc.document_path);
2942 case LyXRC::RC_EDITOR_ALTERNATIVES:
2943 case LyXRC::RC_ESC_CHARS:
2944 case LyXRC::RC_EXAMPLEPATH:
2945 case LyXRC::RC_FONT_ENCODING:
2946 case LyXRC::RC_FILEFORMAT:
2947 case LyXRC::RC_GROUP_LAYOUTS:
2948 case LyXRC::RC_HUNSPELLDIR_PATH:
2949 case LyXRC::RC_ICON_SET:
2950 case LyXRC::RC_INDEX_ALTERNATIVES:
2951 case LyXRC::RC_INDEX_COMMAND:
2952 case LyXRC::RC_JBIBTEX_COMMAND:
2953 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2954 case LyXRC::RC_JINDEX_COMMAND:
2955 case LyXRC::RC_NOMENCL_COMMAND:
2956 case LyXRC::RC_PYGMENTIZE_COMMAND:
2957 case LyXRC::RC_INPUT:
2958 case LyXRC::RC_KBMAP:
2959 case LyXRC::RC_KBMAP_PRIMARY:
2960 case LyXRC::RC_KBMAP_SECONDARY:
2961 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2962 case LyXRC::RC_LANGUAGE_AUTO_END:
2963 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2964 case LyXRC::RC_LANGUAGE_COMMAND_END:
2965 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2966 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2967 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2968 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2969 case LyXRC::RC_LYXRCFORMAT:
2970 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2971 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2972 case LyXRC::RC_MACRO_EDIT_STYLE:
2973 case LyXRC::RC_MAKE_BACKUP:
2974 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2975 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2976 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2977 case LyXRC::RC_NUMLASTFILES:
2978 case LyXRC::RC_PARAGRAPH_MARKERS:
2979 case LyXRC::RC_PATH_PREFIX:
2980 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2981 prependEnvPath("PATH", lyxrc_new.path_prefix);
2982 // Resets python path
2983 support::os::python(true);
2986 case LyXRC::RC_PREVIEW:
2987 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2988 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2989 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2990 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2991 case LyXRC::RC_PRINTPAPERFLAG:
2992 case LyXRC::RC_SAVE_COMPRESSED:
2993 case LyXRC::RC_SAVE_ORIGIN:
2994 case LyXRC::RC_SCREEN_DPI:
2995 case LyXRC::RC_SCREEN_FONT_ROMAN:
2996 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2997 case LyXRC::RC_SCREEN_FONT_SANS:
2998 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2999 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3000 case LyXRC::RC_SCREEN_FONT_SIZES:
3001 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3002 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3003 case LyXRC::RC_GEOMETRY_SESSION:
3004 case LyXRC::RC_SCREEN_ZOOM:
3005 case LyXRC::RC_SERVERPIPE:
3006 case LyXRC::RC_SET_COLOR:
3007 case LyXRC::RC_SHOW_BANNER:
3008 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3009 case LyXRC::RC_SPELLCHECKER:
3010 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3013 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3014 case LyXRC::RC_SPELLCHECK_NOTES:
3015 case LyXRC::RC_SPLITINDEX_COMMAND:
3016 case LyXRC::RC_TEMPDIRPATH:
3017 case LyXRC::RC_TEMPLATEPATH:
3018 case LyXRC::RC_TEX_ALLOWS_SPACES:
3019 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3020 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3021 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3024 case LyXRC::RC_TEXINPUTS_PREFIX:
3025 case LyXRC::RC_THESAURUSDIRPATH:
3026 case LyXRC::RC_UIFILE:
3027 case LyXRC::RC_USER_EMAIL:
3028 case LyXRC::RC_USER_NAME:
3029 case LyXRC::RC_USE_CONVERTER_CACHE:
3030 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
3031 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
3032 case LyXRC::RC_USE_SYSTEM_COLORS:
3033 case LyXRC::RC_USE_TOOLTIP:
3034 case LyXRC::RC_USE_PIXMAP_CACHE:
3035 case LyXRC::RC_USE_QIMAGE:
3036 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3037 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3038 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3039 case LyXRC::RC_SINGLE_INSTANCE:
3040 case LyXRC::RC_SORT_LAYOUTS:
3041 case LyXRC::RC_FULL_SCREEN_LIMIT:
3042 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3043 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3044 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3045 case LyXRC::RC_FULL_SCREEN_TABBAR:
3046 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3047 case LyXRC::RC_FULL_SCREEN_WIDTH:
3048 case LyXRC::RC_VISUAL_CURSOR:
3049 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3050 case LyXRC::RC_VIEWER:
3051 case LyXRC::RC_VIEWER_ALTERNATIVES:
3052 case LyXRC::RC_FORWARD_SEARCH_DVI:
3053 case LyXRC::RC_FORWARD_SEARCH_PDF:
3054 case LyXRC::RC_EXPORT_OVERWRITE:
3055 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3056 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3057 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3058 case LyXRC::RC_CURSOR_WIDTH:
3065 string const LyXRC::getDescription(LyXRCTags tag)
3070 case RC_ACCEPT_COMPOUND:
3071 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3075 str = _("Specify an alternate language. The default is to use the language of the document.");
3078 case RC_PLAINTEXT_LINELEN:
3079 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.");
3082 case RC_AUTOREGIONDELETE:
3083 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3086 case RC_AUTORESET_OPTIONS:
3087 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3091 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3094 case RC_AUTO_NUMBER:
3097 case RC_BACKUPDIR_PATH:
3098 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.");
3101 case RC_BIBTEX_COMMAND:
3102 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3105 case RC_JBIBTEX_COMMAND:
3106 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3110 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3113 case RC_CHECKLASTFILES:
3114 str = _("Select to check whether the lastfiles still exist.");
3117 case RC_CHKTEX_COMMAND:
3118 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3124 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3125 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3128 case RC_CONVERTER_NEEDAUTH:
3129 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3135 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3136 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.");
3139 case RC_CURSOR_WIDTH:
3140 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3143 case RC_SCROLL_BELOW_DOCUMENT:
3144 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");
3147 case RC_MAC_DONTSWAP_CTRL_META:
3148 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3151 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3152 str = _("Use the Mac OS X conventions for cursor movement");
3155 case RC_SHOW_MACRO_LABEL:
3156 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3159 case RC_DATE_INSERT_FORMAT:
3160 //xgettext:no-c-format
3161 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3165 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3168 case RC_DEFAULT_OTF_VIEW_FORMAT:
3169 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3172 case RC_DEFAULT_VIEW_FORMAT:
3173 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3176 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3177 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3180 case RC_DISPLAY_GRAPHICS:
3181 str = _("Select how LyX will display any graphics.");
3184 case RC_DOCUMENTPATH:
3185 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3189 str = _("Specify additional chars that can be part of a word.");
3192 case RC_EXAMPLEPATH:
3193 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3196 case RC_FONT_ENCODING:
3197 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3203 case RC_INDEX_COMMAND:
3204 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\".");
3207 case RC_JINDEX_COMMAND:
3208 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3211 case RC_NOMENCL_COMMAND:
3212 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3215 case RC_PYGMENTIZE_COMMAND:
3216 str = _("The command to run the python pygments syntax highlighter.");
3223 case RC_KBMAP_PRIMARY:
3224 case RC_KBMAP_SECONDARY:
3225 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.");
3228 case RC_LANGUAGE_AUTO_BEGIN:
3229 str = _("Select if a language switching command is needed at the beginning of the document.");
3232 case RC_LANGUAGE_AUTO_END:
3233 str = _("Select if a language switching command is needed at the end of the document.");
3236 case RC_LANGUAGE_COMMAND_BEGIN:
3237 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.");
3240 case RC_LANGUAGE_COMMAND_END:
3241 str = _("The LaTeX command for changing back to the language of the document.");
3244 case RC_LANGUAGE_COMMAND_LOCAL:
3245 str = _("The LaTeX command for local changing of the language.");
3248 case RC_LANGUAGE_GLOBAL_OPTIONS:
3249 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3252 case RC_LANGUAGE_CUSTOM_PACKAGE:
3253 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3256 case RC_LANGUAGE_PACKAGE_SELECTION:
3257 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3260 case RC_USELASTFILEPOS:
3261 str = _("De-select if you do not want LyX to scroll to saved position.");
3264 case RC_LOADSESSION:
3265 str = _("De-select to prevent loading files opened from the last LyX session.");
3268 case RC_MAKE_BACKUP:
3269 str = _("De-select if you don't want LyX to create backup files.");
3272 case RC_MARK_FOREIGN_LANGUAGE:
3273 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3276 case RC_MOUSE_WHEEL_SPEED:
3277 str = _("The scrolling speed of the mouse wheel.");
3280 case RC_COMPLETION_POPUP_DELAY:
3281 str = _("The completion popup delay.");
3284 case RC_COMPLETION_POPUP_MATH:
3285 str = _("Select to display the completion popup in math mode.");
3288 case RC_COMPLETION_POPUP_TEXT:
3289 str = _("Select to display the completion popup in text mode.");
3292 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3293 str = _("Show the completion popup without delay after non-unique completion attempt.");
3296 case RC_COMPLETION_POPUP_TEXT:
3297 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3300 case RC_COMPLETION_POPUP_DELAY:
3301 str = _("The inline completion delay.");
3304 case RC_COMPLETION_INLINE_MATH:
3305 str = _("Select to display the inline completion in math mode.");
3308 case RC_COMPLETION_INLINE_TEXT:
3309 str = _("Select to display the inline completion in text mode.");
3312 case RC_COMPLETION_INLINE_DOTS:
3313 str = _("Use \"...\" to shorten long completions.");
3316 case RC_AUTOCORRECTION_MATH:
3317 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3320 case RC_NUMLASTFILES:
3321 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3325 case RC_PATH_PREFIX:
3326 str = _("Specify those directories which should be "
3327 "prepended to the PATH environment variable.\n"
3328 "Use the OS native format.");
3332 str = _("Shows a typeset preview of things such as math");
3335 case RC_PREVIEW_HASHED_LABELS:
3336 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3339 case RC_PREVIEW_SCALE_FACTOR:
3340 str = _("Scale the preview size to suit.");
3343 case RC_PRINTLANDSCAPEFLAG:
3344 str = _("The option to print out in landscape.");
3347 case RC_PRINTPAPERDIMENSIONFLAG:
3348 str = _("Option to specify the dimensions of the print paper.");
3351 case RC_PRINTPAPERFLAG:
3352 str = _("The option to specify paper type.");
3355 case RC_VISUAL_CURSOR:
3356 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3359 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3360 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).");
3364 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3367 case RC_SCREEN_FONT_ROMAN:
3368 case RC_SCREEN_FONT_SANS:
3369 case RC_SCREEN_FONT_TYPEWRITER:
3370 str = _("The screen fonts used to display the text while editing.");
3373 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3374 case RC_SCREEN_FONT_SANS_FOUNDRY:
3375 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3378 case RC_SCREEN_FONT_SCALABLE:
3379 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.");
3382 case RC_SCREEN_FONT_SIZES:
3383 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3386 case RC_SCREEN_ZOOM:
3387 //xgettext:no-c-format
3388 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3391 case RC_GEOMETRY_SESSION:
3392 str = _("Allow session manager to save and restore windows geometry.");
3396 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3402 case RC_SHOW_BANNER:
3403 str = _("De-select if you don't want the startup banner.");
3406 case RC_TEMPDIRPATH:
3407 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3410 case RC_THESAURUSDIRPATH:
3411 str = _("This is the place where the files of the thesaurus library reside.");
3414 case RC_TEMPLATEPATH:
3415 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3418 case RC_TEX_ALLOWS_SPACES:
3421 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3424 case RC_TEXINPUTS_PREFIX:
3425 str = _("Specify those directories which should be "
3426 "prepended to the TEXINPUTS environment variable.\n"
3427 "A '.' represents the current document directory. "
3428 "Use the OS native format.");
3432 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3441 case RC_USE_USE_SYSTEM_COLORS:
3442 str = _("Enable use the system colors for some things like main window background and selection.");
3445 case RC_USE_TOOLTIP:
3446 str = _("Enable the automatic appearance of tool tips in the work area.");
3449 case RC_USE_PIXMAP_CACHE:
3450 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3453 case RC_VIEWDVI_PAPEROPTION:
3454 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3469 // The global instance
3472 // The global copy of the system lyxrc entries (everything except preferences)