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 = 25; // lasgouttes: remove qimage
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 // compatibility with versions older than 1.4.0 only
200 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
201 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
202 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
203 { "\\user_email", LyXRC::RC_USER_EMAIL },
204 { "\\user_name", LyXRC::RC_USER_NAME },
205 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
206 // compatibility with versions older than 1.4.0 only
207 { "\\viewer", LyXRC::RC_VIEWER},
208 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
209 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
210 { "format", LyXRC::RC_LYXRCFORMAT }
213 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
224 void LyXRC::setDefaults()
227 use_system_theme_icons = false;
229 def_file = "default";
231 // The current document directory
232 texinputs_prefix = ".";
233 print_landscape_flag = "-t landscape";
234 print_paper_flag = "-t";
235 print_paper_dimension_flag = "-T";
236 document_path.erase();
237 view_dvi_paper_option.erase();
238 default_view_format = "pdf2";
239 default_otf_view_format = "pdf4";
240 default_platex_view_format = "pdf3";
241 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
242 bibtex_command = "automatic";
244 index_command = "makeindex -c -q";
245 nomencl_command = "makeindex -s nomencl.ist";
246 pygmentize_command = string();
248 // Because a screen is typically wider than a piece of paper:
250 currentZoom = defaultZoom;
251 allow_geometry_session = true;
252 // Default LaTeX font size:
253 font_sizes[FONT_SIZE_TINY] = "5.0";
254 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
255 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
256 font_sizes[FONT_SIZE_SMALL] = "9.0";
257 font_sizes[FONT_SIZE_NORMAL] = "10.0";
258 font_sizes[FONT_SIZE_LARGE] = "12.0";
259 font_sizes[FONT_SIZE_LARGER] = "14.4";
260 font_sizes[FONT_SIZE_LARGEST] = "17.26";
261 font_sizes[FONT_SIZE_HUGE] = "20.74";
262 font_sizes[FONT_SIZE_HUGER] = "24.88";
263 use_scalable_fonts = true;
264 roman_font_name = "";
266 typewriter_font_name = "";
268 auto_region_delete = true;
269 auto_reset_options = false;
270 plaintext_linelen = 65;
271 mouse_wheel_speed = 1.0;
273 check_lastfiles = true;
274 use_lastfilepos = true;
275 load_session = false;
277 save_compressed = false;
279 backupdir_path.erase();
280 display_graphics = true;
281 // Spellchecker settings:
282 // FIXME: this check should test the target platform (darwin)
283 #if defined(USE_MACOSX_PACKAGING)
284 spellchecker = "native";
285 #elif defined(USE_ASPELL)
286 spellchecker = "aspell";
287 #elif defined(USE_HUNSPELL)
288 spellchecker = "hunspell";
290 spellchecker = "aspell";
292 spellchecker_accept_compound = false;
293 spellcheck_continuously = false;
294 completion_minlength = 6;
295 spellcheck_notes = true;
297 visual_cursor = false;
299 mark_foreign_language = true;
300 language_auto_begin = true;
301 language_auto_end = true;
302 language_global_options = true;
303 language_package_selection = LP_AUTO;
304 language_custom_package = "\\usepackage{babel}";
305 language_command_begin = "\\selectlanguage{$$lang}";
306 language_command_local = "\\foreignlanguage{$$lang}{";
307 sort_layouts = false;
308 group_layouts = true;
309 gui_language = "auto";
311 windows_style_tex_paths = false;
312 tex_allows_spaces = false;
313 date_insert_format = "%x";
314 cursor_follows_scrollbar = false;
315 scroll_below_document = false;
316 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
317 paragraph_markers = false;
318 mac_dontswap_ctrl_meta = false;
319 mac_like_cursor_movement = false;
320 macro_edit_style = MACRO_EDIT_INLINE_BOX;
321 dialogs_iconify_with_main = false;
322 preview = PREVIEW_OFF;
323 preview_hashed_labels = false;
324 preview_scale_factor = 1.0;
325 use_converter_cache = true;
326 use_converter_needauth_forbidden = true;
327 use_converter_needauth = true;
328 use_system_colors = false;
330 use_pixmap_cache = false;
331 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
332 user_name = to_utf8(support::user_name());
333 user_email = to_utf8(support::user_email());
334 open_buffers_in_tabs = true;
335 single_close_tab_button = false;
336 single_instance = true;
337 forward_search_dvi = string();
338 forward_search_pdf = string();
339 export_overwrite = NO_FILES;
341 // Fullscreen settings
342 full_screen_limit = false;
343 full_screen_toolbars = true;
344 full_screen_tabbar = true;
345 full_screen_menubar = true;
346 full_screen_statusbar = true;
347 full_screen_scrollbar = true;
348 full_screen_width = 700;
350 completion_cursor_text = true;
351 completion_popup_math = true;
352 completion_popup_text = false;
353 completion_popup_delay = 2.0;
354 completion_popup_after_complete = true;
355 autocorrection_math = false;
356 completion_inline_math = true;
357 completion_inline_text = false;
358 completion_inline_dots = -1;
359 completion_inline_delay = 0.2;
360 default_decimal_point = ".";
361 default_length_unit = Length::CM;
363 close_buffer_with_last_view = "yes";
364 mouse_middlebutton_paste = true;
370 void oldFontFormat(string & family, string & foundry)
372 if (family.empty() || family[0] != '-')
374 foundry = token(family, '-', 1);
375 family = token(family, '-', 2);
383 bool LyXRC::read(FileName const & filename, bool check_format)
385 Lexer lexrc(lyxrcTags);
386 lexrc.setFile(filename);
387 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
388 ReturnValues retval = read(lexrc, check_format);
389 if (!check_format || retval != FormatMismatch)
390 return retval == ReadOK;
392 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
393 TempFile tmp("convert_lyxrc");
394 FileName const tempfile = tmp.name();
395 bool const success = prefs2prefs(filename, tempfile, false);
397 LYXERR0 ("Unable to convert " << filename.absFileName() <<
398 " to format " << LYXRC_FILEFORMAT);
401 // Keep this in the else branch, such that lexrc2 goes out
402 // of scope and releases the lock on tempfile before we
403 // attempt to remove it. This matters on Windows.
404 Lexer lexrc2(lyxrcTags);
405 lexrc2.setFile(tempfile);
406 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
407 retval = read(lexrc2, check_format);
409 return retval == ReadOK;
413 // don't need to worry about conversion, because this is always
414 // from an internal source
415 bool LyXRC::read(istream & is)
417 Lexer lexrc(lyxrcTags);
419 LYXERR(Debug::LYXRC, "Reading istream...");
420 return read(lexrc, false) == ReadOK;
424 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
426 if (lyxerr.debugging(Debug::PARSER))
427 lexrc.printTable(lyxerr);
432 // format prior to 2.0 and introduction of format tag
433 unsigned int format = 0;
435 while (lexrc.isOK()) {
436 // By using two switches we take advantage of the compiler
437 // telling us if we have missed a LyXRCTags element in
438 // the second switch.
439 // Note that this also shows a problem with Lexer since it
440 // helps us avoid taking advantage of the strictness of the
443 int le = lexrc.lex();
445 case Lexer::LEX_UNDEF:
446 lexrc.printError("Unknown tag `$$Token'");
448 case Lexer::LEX_FEOF:
453 switch (static_cast<LyXRCTags>(le)) {
456 format = lexrc.getInteger();
458 case RC_INPUT: // Include file
461 libFileSearch(string(),
463 if (!read(tmp, check_format)) {
465 "Error reading included file: " + tmp.absFileName());
471 bind_file = os::internal_path(lexrc.getString());
476 def_file = os::internal_path(lexrc.getString());
481 ui_file = os::internal_path(lexrc.getString());
484 case RC_AUTORESET_OPTIONS:
485 lexrc >> auto_reset_options;
488 case RC_DISPLAY_GRAPHICS:
490 display_graphics = lexrc.getString() == "true";
493 case RC_TEX_EXPECTS_WINDOWS_PATHS:
494 lexrc >> windows_style_tex_paths;
497 case RC_TEX_ALLOWS_SPACES:
498 lexrc >> tex_allows_spaces;
501 case RC_TEXINPUTS_PREFIX:
502 lexrc >> texinputs_prefix;
509 case RC_KBMAP_PRIMARY:
511 string const kmap(os::internal_path(lexrc.getString()));
512 if (!libFileSearch("kbd", kmap, "kmap").empty()
514 primary_kbmap = kmap;
516 lexrc.printError("LyX: Keymap `$$Token' not found");
521 case RC_KBMAP_SECONDARY:
523 string const kmap(os::internal_path(lexrc.getString()));
524 if (!libFileSearch("kbd", kmap, "kmap").empty()
526 secondary_kbmap = kmap;
528 lexrc.printError("LyX: Keymap `$$Token' not found");
533 case RC_FONT_ENCODING:
537 case RC_PRINTLANDSCAPEFLAG:
538 lexrc >> print_landscape_flag;
541 case RC_PRINTPAPERDIMENSIONFLAG:
542 lexrc >> print_paper_dimension_flag;
545 case RC_PRINTPAPERFLAG:
546 lexrc >> print_paper_flag;
549 case RC_PYGMENTIZE_COMMAND:
550 if (lexrc.next(true)) {
551 pygmentize_command = lexrc.getString();
555 case RC_VIEWDVI_PAPEROPTION:
557 view_dvi_paper_option = lexrc.getString();
559 view_dvi_paper_option.erase();
562 case RC_CHKTEX_COMMAND:
563 if (lexrc.next(true)) {
564 chktex_command = lexrc.getString();
568 case RC_BIBTEX_ALTERNATIVES:
569 if (lexrc.next(true)) {
570 bibtex_alternatives.insert(lexrc.getString());
574 case RC_BIBTEX_COMMAND:
575 if (lexrc.next(true)) {
576 bibtex_command = lexrc.getString();
580 case RC_JBIBTEX_COMMAND:
581 if (lexrc.next(true)) {
582 jbibtex_command = lexrc.getString();
586 case RC_JBIBTEX_ALTERNATIVES:
587 if (lexrc.next(true)) {
588 jbibtex_alternatives.insert(lexrc.getString());
592 case RC_INDEX_ALTERNATIVES:
593 if (lexrc.next(true)) {
594 index_alternatives.insert(lexrc.getString());
598 case RC_INDEX_COMMAND:
599 if (lexrc.next(true)) {
600 index_command = lexrc.getString();
604 case RC_JINDEX_COMMAND:
605 if (lexrc.next(true)) {
606 jindex_command = lexrc.getString();
610 case RC_SPLITINDEX_COMMAND:
611 if (lexrc.next(true)) {
612 splitindex_command = lexrc.getString();
616 case RC_NOMENCL_COMMAND:
617 if (lexrc.next(true)) {
618 nomencl_command = lexrc.getString();
627 lexrc >> defaultZoom;
628 if (defaultZoom < 10)
632 case RC_GEOMETRY_SESSION:
633 lexrc >> allow_geometry_session;
636 case RC_SCREEN_FONT_SIZES:
637 lexrc >> font_sizes[FONT_SIZE_TINY];
638 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
639 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
640 lexrc >> font_sizes[FONT_SIZE_SMALL];
641 lexrc >> font_sizes[FONT_SIZE_NORMAL];
642 lexrc >> font_sizes[FONT_SIZE_LARGE];
643 lexrc >> font_sizes[FONT_SIZE_LARGER];
644 lexrc >> font_sizes[FONT_SIZE_LARGEST];
645 lexrc >> font_sizes[FONT_SIZE_HUGE];
646 lexrc >> font_sizes[FONT_SIZE_HUGER];
649 case RC_SCREEN_FONT_SCALABLE:
650 lexrc >> use_scalable_fonts;
657 case RC_DOCUMENTPATH:
659 document_path = os::internal_path(lexrc.getString());
664 example_path = os::internal_path(lexrc.getString());
667 case RC_TEMPLATEPATH:
669 template_path = os::internal_path(lexrc.getString());
674 tempdir_path = os::internal_path(lexrc.getString());
677 case RC_THESAURUSDIRPATH:
679 thesaurusdir_path = os::internal_path(lexrc.getString());
682 case RC_HUNSPELLDIR_PATH:
684 hunspelldir_path = os::internal_path(lexrc.getString());
687 case RC_USELASTFILEPOS:
688 lexrc >> use_lastfilepos;
692 lexrc >> load_session;
695 case RC_MOUSE_WHEEL_SPEED:
696 lexrc >> mouse_wheel_speed;
699 case RC_COMPLETION_INLINE_DELAY:
700 lexrc >> completion_inline_delay;
703 case RC_COMPLETION_INLINE_MATH:
704 lexrc >> completion_inline_math;
707 case RC_COMPLETION_INLINE_TEXT:
708 lexrc >> completion_inline_text;
711 case RC_COMPLETION_INLINE_DOTS:
712 lexrc >> completion_inline_dots;
715 case RC_AUTOCORRECTION_MATH:
716 lexrc >> autocorrection_math;
719 case RC_COMPLETION_POPUP_DELAY:
720 lexrc >> completion_popup_delay;
723 case RC_COMPLETION_POPUP_MATH:
724 lexrc >> completion_popup_math;
727 case RC_COMPLETION_POPUP_TEXT:
728 lexrc >> completion_popup_text;
731 case RC_COMPLETION_CURSOR_TEXT:
732 lexrc >> completion_cursor_text;
735 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
736 lexrc >> completion_popup_after_complete;
739 case RC_COMPLETION_MINLENGTH:
740 lexrc >> completion_minlength;
743 case RC_NUMLASTFILES:
744 lexrc >> num_lastfiles;
747 case RC_CHECKLASTFILES:
748 lexrc >> check_lastfiles;
755 case RC_USE_SYSTEM_THEME_ICONS:
756 lexrc >> use_system_theme_icons;
759 case RC_SCREEN_FONT_ROMAN:
761 roman_font_name = lexrc.getString();
762 oldFontFormat(roman_font_name,
767 case RC_SCREEN_FONT_SANS:
769 sans_font_name = lexrc.getString();
770 oldFontFormat(sans_font_name, sans_font_foundry);
774 case RC_SCREEN_FONT_TYPEWRITER:
776 typewriter_font_name = lexrc.getString();
777 oldFontFormat(typewriter_font_name,
778 typewriter_font_foundry);
782 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
783 lexrc >> roman_font_foundry;
786 case RC_SCREEN_FONT_SANS_FOUNDRY:
787 lexrc >> sans_font_foundry;
790 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
791 lexrc >> typewriter_font_foundry;
796 lexrc.printError("Missing color tag.");
799 string lyx_name = lexrc.getString();
802 lexrc.printError("Missing color name for color: `$$Token'");
805 string x11_name = lexrc.getString();
807 ColorCode const col =
808 lcolor.getFromLyXName(lyx_name);
809 if (col == Color_none ||
810 col == Color_inherit ||
814 if (!lcolor.setColor(col, x11_name))
815 LYXERR0("Bad lyxrc set_color for " << lyx_name);
819 case RC_AUTOREGIONDELETE:
820 // Auto region delete defaults to true
821 lexrc >> auto_region_delete;
826 lyxpipes = os::internal_path(lexrc.getString());
829 case RC_CURSOR_FOLLOWS_SCROLLBAR:
830 lexrc >> cursor_follows_scrollbar;
833 case RC_CURSOR_WIDTH:
834 lexrc >> cursor_width;
837 case RC_SCROLL_BELOW_DOCUMENT:
838 lexrc >> scroll_below_document;
841 case RC_PARAGRAPH_MARKERS:
842 lexrc >> paragraph_markers;
845 case RC_MAC_DONTSWAP_CTRL_META:
846 lexrc >> mac_dontswap_ctrl_meta;
849 case RC_MAC_LIKE_CURSOR_MOVEMENT:
850 lexrc >> mac_like_cursor_movement;
853 case RC_MACRO_EDIT_STYLE:
855 switch (lexrc.getInteger()) {
856 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
857 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
858 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
863 case RC_DIALOGS_ICONIFY_WITH_MAIN:
864 lexrc >> dialogs_iconify_with_main;
867 case RC_PLAINTEXT_LINELEN:
868 lexrc >> plaintext_linelen;
870 // Spellchecker settings:
871 case RC_ACCEPT_COMPOUND:
872 lexrc >> spellchecker_accept_compound;
874 case RC_USE_SYSTEM_COLORS:
875 lexrc >> use_system_colors;
878 lexrc >> use_tooltip;
880 case RC_USE_PIXMAP_CACHE:
881 lexrc >> use_pixmap_cache;
883 case RC_SPELLCHECKER:
884 lexrc >> spellchecker;
887 lexrc >> spellchecker_alt_lang;
890 lexrc >> spellchecker_esc_chars;
892 case RC_SPELLCHECK_CONTINUOUSLY:
893 lexrc >> spellcheck_continuously;
895 case RC_SPELLCHECK_NOTES:
896 lexrc >> spellcheck_notes;
899 lexrc >> make_backup;
901 case RC_SAVE_COMPRESSED:
902 lexrc >> save_compressed;
905 lexrc >> save_origin;
907 case RC_BACKUPDIR_PATH:
909 backupdir_path = os::internal_path(lexrc.getString());
911 case RC_DEFAULT_DECIMAL_POINT:
912 lexrc >> default_decimal_point;
914 case RC_DEFAULT_LENGTH_UNIT:
916 default_length_unit = (Length::UNIT) lexrc.getInteger();
918 case RC_DATE_INSERT_FORMAT:
919 lexrc >> date_insert_format;
921 case RC_LANGUAGE_CUSTOM_PACKAGE:
922 lexrc >> language_custom_package;
924 case RC_LANGUAGE_AUTO_BEGIN:
925 lexrc >> language_auto_begin;
927 case RC_LANGUAGE_AUTO_END:
928 lexrc >> language_auto_end;
930 case RC_LANGUAGE_GLOBAL_OPTIONS:
931 lexrc >> language_global_options;
933 case RC_LANGUAGE_PACKAGE_SELECTION:
935 switch (lexrc.getInteger()) {
937 language_package_selection = LP_AUTO;
940 language_package_selection = LP_BABEL;
943 language_package_selection = LP_CUSTOM;
946 language_package_selection = LP_NONE;
951 case RC_LANGUAGE_COMMAND_BEGIN:
952 lexrc >> language_command_begin;
954 case RC_LANGUAGE_COMMAND_END:
955 lexrc >> language_command_end;
957 case RC_LANGUAGE_COMMAND_LOCAL:
958 lexrc >> language_command_local;
960 case RC_VISUAL_CURSOR:
961 lexrc >> visual_cursor;
963 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
964 lexrc >> close_buffer_with_last_view;
967 lexrc >> auto_number;
969 case RC_MARK_FOREIGN_LANGUAGE:
970 lexrc >> mark_foreign_language;
976 fmt = lexrc.getString();
977 if (lexrc.next(true))
978 command = lexrc.getString();
979 setMover(fmt, command);
984 string from, to, command, flags;
986 from = lexrc.getString();
988 to = lexrc.getString();
989 if (lexrc.next(true))
990 command = lexrc.getString();
992 flags = lexrc.getString();
994 theConverters().erase(from, to);
996 theConverters().add(from, to, command, flags);
999 // compatibility with versions older than 1.4.0 only
1001 string format, command;
1002 lexrc >> format >> command;
1003 theFormats().setViewer(format, command);
1006 case RC_FILEFORMAT: {
1008 string format, extensions, shortcut;
1009 docstring prettyname;
1010 if (!(lexrc >> format >> extensions))
1012 if (ok && lexrc.next(true))
1013 prettyname = lexrc.getDocString();
1017 if(!(lexrc >> shortcut))
1019 string viewer, editor;
1020 if (ok && lexrc.next(true))
1021 viewer = lexrc.getString();
1024 if (ok && lexrc.next(true))
1025 editor = lexrc.getString();
1029 if (!(lexrc >> flags >> mime))
1031 int flgs = Format::none;
1032 while (!flags.empty()) {
1034 flags = split(flags, flag, ',');
1035 if (flag == "document")
1036 flgs |= Format::document;
1037 else if (flag == "vector")
1038 flgs |= Format::vector;
1039 else if (flag == "zipped=native")
1040 flgs |= Format::zipped_native;
1041 else if (flag == "menu=export")
1042 flgs |= Format::export_menu;
1044 LYXERR0("Ignoring unknown flag `"
1045 << flag << "' for format `"
1049 LYXERR0("Syntax error in format " << format);
1050 else if (prettyname.empty()) {
1051 if (theConverters().formatIsUsed(format))
1052 LYXERR0("Can't delete format " << format);
1054 theFormats().erase(format);
1056 theFormats().add(format, extensions, prettyname,
1057 shortcut, viewer, editor, mime, flgs);
1061 case RC_VIEWER_ALTERNATIVES: {
1062 string format, command;
1063 if ((lexrc >> format) && lexrc.next(true)) {
1064 command = lexrc.getString();
1065 viewer_alternatives[format].insert(command);
1069 case RC_EDITOR_ALTERNATIVES: {
1070 string format, command;
1071 if ((lexrc >> format) && lexrc.next(true)) {
1072 command = lexrc.getString();
1073 editor_alternatives[format].insert(command);
1078 case RC_DEFAULT_OTF_VIEW_FORMAT:
1079 lexrc >> default_otf_view_format;
1082 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
1083 lexrc >> default_platex_view_format;
1086 case RC_DEFAULT_VIEW_FORMAT:
1087 lexrc >> default_view_format;
1090 case RC_GUI_LANGUAGE:
1091 lexrc >> gui_language;
1094 case RC_SHOW_BANNER:
1095 lexrc >> show_banner;
1100 string const tmp = lexrc.getString();
1101 if (tmp == "true" || tmp == "on")
1102 preview = PREVIEW_ON;
1103 else if (tmp == "no_math")
1104 preview = PREVIEW_NO_MATH;
1106 preview = PREVIEW_OFF;
1107 if (tmp != "false" && tmp != "off")
1108 LYXERR0("Unrecognized preview status \""
1114 case RC_PREVIEW_HASHED_LABELS:
1115 lexrc >> preview_hashed_labels;
1118 case RC_PREVIEW_SCALE_FACTOR:
1119 lexrc >> preview_scale_factor;
1126 lexrc >> user_email;
1129 case RC_PATH_PREFIX:
1130 lexrc >> path_prefix;
1133 case RC_USE_CONVERTER_CACHE:
1134 lexrc >> use_converter_cache;
1136 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1137 lexrc >> use_converter_needauth_forbidden;
1139 case RC_USE_CONVERTER_NEEDAUTH:
1140 lexrc >> use_converter_needauth;
1142 case RC_CONVERTER_CACHE_MAXAGE:
1143 lexrc >> converter_cache_maxage;
1146 case RC_SORT_LAYOUTS:
1147 lexrc >> sort_layouts;
1149 case RC_GROUP_LAYOUTS:
1150 lexrc >> group_layouts;
1152 case RC_FULL_SCREEN_LIMIT:
1153 lexrc >> full_screen_limit;
1155 case RC_FULL_SCREEN_TOOLBARS:
1156 lexrc >> full_screen_toolbars;
1158 case RC_FULL_SCREEN_SCROLLBAR:
1159 lexrc >> full_screen_scrollbar;
1161 case RC_FULL_SCREEN_STATUSBAR:
1162 lexrc >> full_screen_statusbar;
1164 case RC_FULL_SCREEN_TABBAR:
1165 lexrc >> full_screen_tabbar;
1167 case RC_FULL_SCREEN_MENUBAR:
1168 lexrc >> full_screen_menubar;
1170 case RC_FULL_SCREEN_WIDTH:
1171 lexrc >> full_screen_width;
1173 case RC_OPEN_BUFFERS_IN_TABS:
1174 lexrc >> open_buffers_in_tabs;
1176 case RC_SINGLE_CLOSE_TAB_BUTTON:
1177 lexrc >> single_close_tab_button;
1179 case RC_SINGLE_INSTANCE:
1180 lexrc >> single_instance;
1181 if (run_mode == PREFERRED)
1182 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1184 case RC_FORWARD_SEARCH_DVI:
1185 if (lexrc.next(true))
1186 forward_search_dvi = lexrc.getString();
1188 case RC_FORWARD_SEARCH_PDF:
1189 if (lexrc.next(true))
1190 forward_search_pdf = lexrc.getString();
1192 case RC_EXPORT_OVERWRITE:
1194 string const tmp = lexrc.getString();
1195 if (tmp == "all" || tmp == "true")
1196 export_overwrite = ALL_FILES;
1197 else if (tmp == "main")
1198 export_overwrite = MAIN_FILE;
1200 export_overwrite = NO_FILES;
1201 if (tmp != "ask" && tmp != "false")
1202 LYXERR0("Unrecognized export_overwrite status \""
1207 case RC_SCROLL_WHEEL_ZOOM:
1209 string const tmp = lexrc.getString();
1211 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1212 else if (tmp == "shift")
1213 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1214 else if (tmp == "alt")
1215 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1217 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1218 if (tmp != "off" && tmp != "false")
1219 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1225 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1226 lexrc >> mouse_middlebutton_paste;
1230 break; // this is just a dummy
1233 // This is triggered the first time through the loop unless
1234 // we hit a format tag.
1235 if (check_format && format != LYXRC_FILEFORMAT)
1236 return FormatMismatch;
1239 /// Update converters data-structures
1240 theConverters().update(theFormats());
1241 theConverters().buildGraph();
1242 theBufferList().invalidateConverterCache();
1248 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1250 ofstream ofs(filename.toFilesystemEncoding().c_str());
1252 write(ofs, ignore_system_lyxrc);
1256 void LyXRC::print() const
1258 if (lyxerr.debugging())
1259 write(lyxerr, false);
1267 typedef pair<string, SpecialisedMover> Data;
1269 SameMover(Data const & comparison)
1270 : comparison_(comparison) {}
1272 bool operator()(Data const & data) const
1274 return data.first == comparison_.first &&
1275 data.second.command() == comparison_.second.command();
1285 // Escape \ and " so that LyXLex can read the string later
1286 string escapeCommand(string const & str) {
1287 return subst(subst(str , "\\", "\\\\"),
1294 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1296 LyXRCTags tag = RC_LAST;
1298 if (!name.empty()) {
1299 for (int i = 0; i != lyxrcCount; ++i)
1300 if ("\\" + name == lyxrcTags[i].tag)
1301 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1305 os << "# LyX " << lyx_version
1306 << " generated this file. If you want to make your own\n"
1307 << "# modifications you should do them from inside LyX and save.\n\n"
1308 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1310 // Why the switch you might ask. It is a trick to ensure that all
1311 // the elements in the LyXRCTags enum are handled. As you can see
1312 // there are no breaks at all. So it is just a huge fall-through.
1313 // The nice thing is that we will get a warning from the compiler
1314 // if we forget an element.
1318 // input/include files are not done here
1319 case RC_LYXRCFORMAT:
1321 if (ignore_system_lyxrc ||
1322 bind_file != system_lyxrc.bind_file) {
1323 string const path = os::external_path(bind_file);
1324 os << "\\bind_file \"" << path << "\"\n";
1330 if (ignore_system_lyxrc ||
1331 def_file != system_lyxrc.def_file) {
1332 string const path = os::external_path(def_file);
1333 os << "\\def_file \"" << path << "\"\n";
1342 << "# MISC SECTION ######################################\n"
1344 // bind files are not done here.
1346 case RC_PATH_PREFIX:
1347 if (ignore_system_lyxrc ||
1348 path_prefix != system_lyxrc.path_prefix) {
1349 os << "\\path_prefix \"" << path_prefix << "\"\n";
1355 if (ignore_system_lyxrc ||
1356 ui_file != system_lyxrc.ui_file) {
1357 string const path = os::external_path(ui_file);
1358 os << "\\ui_file \"" << path << "\"\n";
1363 case RC_AUTOREGIONDELETE:
1364 if (ignore_system_lyxrc ||
1365 auto_region_delete != system_lyxrc.auto_region_delete) {
1366 os << "# Set to false to inhibit automatic replacement of\n"
1367 << "# the current selection.\n"
1368 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1374 case RC_AUTORESET_OPTIONS:
1375 if (ignore_system_lyxrc ||
1376 auto_reset_options != system_lyxrc.auto_reset_options) {
1377 os << "# Set to false to inhibit automatic reset of\n"
1378 << "# the class options to defaults on class change.\n"
1379 << "\\auto_reset_options "
1380 << convert<string>(auto_reset_options)
1387 if (ignore_system_lyxrc ||
1388 autosave != system_lyxrc.autosave) {
1389 os << "# The time interval between auto-saves in seconds.\n"
1390 << "\\autosave " << autosave << '\n';
1395 case RC_DISPLAY_GRAPHICS:
1396 if (ignore_system_lyxrc ||
1397 display_graphics != system_lyxrc.display_graphics) {
1398 os << "# Display graphics within LyX\n"
1400 << "\\display_graphics "
1401 << (display_graphics ? "true" : "false")
1407 case RC_SORT_LAYOUTS:
1408 if (ignore_system_lyxrc ||
1409 sort_layouts != system_lyxrc.sort_layouts) {
1410 os << "# Sort layouts alphabetically.\n"
1411 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1416 case RC_GROUP_LAYOUTS:
1417 if (ignore_system_lyxrc ||
1418 group_layouts != system_lyxrc.group_layouts) {
1419 os << "# Group layouts by their category.\n"
1420 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1425 case RC_VIEWDVI_PAPEROPTION:
1426 if (ignore_system_lyxrc ||
1427 view_dvi_paper_option
1428 != system_lyxrc.view_dvi_paper_option) {
1429 os << "# Options used to specify paper size to the\n"
1430 << "# view_dvi_command (e.g. -paper)\n"
1431 << "\\view_dvi_paper_option \""
1432 << view_dvi_paper_option << "\"\n";
1437 case RC_CHKTEX_COMMAND:
1438 if (ignore_system_lyxrc ||
1439 chktex_command != system_lyxrc.chktex_command) {
1440 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1445 case RC_BIBTEX_ALTERNATIVES: {
1446 CommandSet::const_iterator it = bibtex_alternatives.begin();
1447 CommandSet::const_iterator end = bibtex_alternatives.end();
1448 for ( ; it != end; ++it) {
1449 if (ignore_system_lyxrc
1450 || !system_lyxrc.bibtex_alternatives.count(*it))
1451 os << "\\bibtex_alternatives \""
1458 case RC_BIBTEX_COMMAND:
1459 if (ignore_system_lyxrc ||
1460 bibtex_command != system_lyxrc.bibtex_command) {
1461 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1466 case RC_JBIBTEX_COMMAND:
1467 if (ignore_system_lyxrc ||
1468 jbibtex_command != system_lyxrc.jbibtex_command) {
1469 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1474 case RC_JBIBTEX_ALTERNATIVES: {
1475 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1476 CommandSet::const_iterator end = jbibtex_alternatives.end();
1477 for ( ; it != end; ++it) {
1478 if (ignore_system_lyxrc
1479 || !system_lyxrc.jbibtex_alternatives.count(*it))
1480 os << "\\jbibtex_alternatives \""
1487 case RC_INDEX_ALTERNATIVES: {
1488 CommandSet::const_iterator it = index_alternatives.begin();
1489 CommandSet::const_iterator end = index_alternatives.end();
1490 for ( ; it != end; ++it) {
1491 if (ignore_system_lyxrc
1492 || !system_lyxrc.index_alternatives.count(*it))
1493 os << "\\index_alternatives \""
1500 case RC_INDEX_COMMAND:
1501 if (ignore_system_lyxrc ||
1502 index_command != system_lyxrc.index_command) {
1503 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1508 case RC_JINDEX_COMMAND:
1509 if (ignore_system_lyxrc ||
1510 jindex_command != system_lyxrc.jindex_command) {
1511 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1516 case RC_SPLITINDEX_COMMAND:
1517 if (ignore_system_lyxrc ||
1518 splitindex_command != system_lyxrc.splitindex_command) {
1519 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1524 case RC_NOMENCL_COMMAND:
1525 if (ignore_system_lyxrc ||
1526 nomencl_command != system_lyxrc.nomencl_command) {
1527 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1532 case RC_PYGMENTIZE_COMMAND:
1533 if (ignore_system_lyxrc ||
1534 pygmentize_command != system_lyxrc.pygmentize_command) {
1535 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1540 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1541 // Don't write this setting to the preferences file,
1542 // but allow temporary changes (bug 7557).
1543 if (ignore_system_lyxrc) {
1544 os << "\\tex_expects_windows_paths "
1545 << convert<string>(windows_style_tex_paths) << '\n';
1550 case RC_TEX_ALLOWS_SPACES:
1551 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1552 os << "\\tex_allows_spaces "
1553 << convert<string>(tex_allows_spaces) << '\n';
1559 if (ignore_system_lyxrc ||
1560 use_kbmap != system_lyxrc.use_kbmap) {
1561 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1566 case RC_KBMAP_PRIMARY:
1567 if (ignore_system_lyxrc ||
1568 primary_kbmap != system_lyxrc.primary_kbmap) {
1569 string const path = os::external_path(primary_kbmap);
1570 os << "\\kbmap_primary \"" << path << "\"\n";
1575 case RC_KBMAP_SECONDARY:
1576 if (ignore_system_lyxrc ||
1577 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1578 string const path = os::external_path(secondary_kbmap);
1579 os << "\\kbmap_secondary \"" << path << "\"\n";
1585 if (ignore_system_lyxrc ||
1586 lyxpipes != system_lyxrc.lyxpipes) {
1587 string const path = os::external_path(lyxpipes);
1588 os << "\\serverpipe \"" << path << "\"\n";
1593 case RC_DATE_INSERT_FORMAT:
1594 if (ignore_system_lyxrc ||
1595 date_insert_format != system_lyxrc.date_insert_format) {
1596 os << "\\date_insert_format \"" << date_insert_format
1603 os << "\\user_name \"" << user_name << "\"\n";
1608 os << "\\user_email \"" << user_email << "\"\n";
1612 case RC_SHOW_BANNER:
1613 if (ignore_system_lyxrc ||
1614 show_banner != system_lyxrc.show_banner) {
1615 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1621 if (ignore_system_lyxrc ||
1622 preview != system_lyxrc.preview) {
1628 case PREVIEW_NO_MATH:
1635 os << "\\preview " << status << '\n';
1640 case RC_PREVIEW_HASHED_LABELS:
1641 if (ignore_system_lyxrc ||
1642 preview_hashed_labels !=
1643 system_lyxrc.preview_hashed_labels) {
1644 os << "\\preview_hashed_labels "
1645 << convert<string>(preview_hashed_labels) << '\n';
1650 case RC_PREVIEW_SCALE_FACTOR:
1651 if (ignore_system_lyxrc ||
1652 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1653 os << "\\preview_scale_factor "
1654 << preview_scale_factor << '\n';
1659 case RC_USE_CONVERTER_CACHE:
1660 if (ignore_system_lyxrc ||
1661 use_converter_cache != system_lyxrc.use_converter_cache) {
1662 os << "\\use_converter_cache "
1663 << convert<string>(use_converter_cache) << '\n';
1668 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1669 if (ignore_system_lyxrc ||
1670 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1671 os << "\\use_converter_needauth_forbidden "
1672 << convert<string>(use_converter_needauth_forbidden) << '\n';
1677 case RC_USE_CONVERTER_NEEDAUTH:
1678 if (ignore_system_lyxrc ||
1679 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1680 os << "\\use_converter_needauth "
1681 << convert<string>(use_converter_needauth) << '\n';
1686 case RC_CONVERTER_CACHE_MAXAGE:
1687 if (ignore_system_lyxrc ||
1688 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1689 os << "\\converter_cache_maxage "
1690 << converter_cache_maxage << '\n';
1696 << "# SCREEN & FONTS SECTION ############################\n"
1700 if (ignore_system_lyxrc ||
1701 icon_set != system_lyxrc.icon_set) {
1702 os << "\\icon_set \"" << icon_set
1708 case RC_USE_SYSTEM_THEME_ICONS:
1709 if (ignore_system_lyxrc ||
1710 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1711 os << "\\use_system_theme_icons "
1712 << convert<string>(use_system_theme_icons)
1719 if (ignore_system_lyxrc ||
1720 dpi != system_lyxrc.dpi) {
1721 os << "\\screen_dpi " << dpi << '\n';
1726 case RC_SCREEN_ZOOM:
1727 if (ignore_system_lyxrc ||
1728 defaultZoom != system_lyxrc.defaultZoom) {
1729 os << "\\screen_zoom " << defaultZoom << '\n';
1734 case RC_GEOMETRY_SESSION:
1735 if (ignore_system_lyxrc ||
1736 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1737 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1743 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1744 if (ignore_system_lyxrc ||
1745 cursor_follows_scrollbar
1746 != system_lyxrc.cursor_follows_scrollbar) {
1747 os << "\\cursor_follows_scrollbar "
1748 << convert<string>(cursor_follows_scrollbar) << '\n';
1753 case RC_CURSOR_WIDTH:
1754 if (ignore_system_lyxrc ||
1756 != system_lyxrc.cursor_width) {
1757 os << "\\cursor_width "
1758 << cursor_width << '\n';
1763 case RC_SCROLL_BELOW_DOCUMENT:
1764 if (ignore_system_lyxrc ||
1765 scroll_below_document
1766 != system_lyxrc.scroll_below_document) {
1767 os << "\\scroll_below_document "
1768 << convert<string>(scroll_below_document) << '\n';
1773 case RC_PARAGRAPH_MARKERS:
1774 if (ignore_system_lyxrc ||
1776 != system_lyxrc.paragraph_markers) {
1777 os << "\\paragraph_markers "
1778 << convert<string>(paragraph_markers) << '\n';
1783 case RC_MAC_DONTSWAP_CTRL_META:
1784 if (ignore_system_lyxrc ||
1785 mac_dontswap_ctrl_meta
1786 != system_lyxrc.mac_dontswap_ctrl_meta) {
1787 os << "\\mac_dontswap_ctrl_meta "
1788 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1793 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1794 if (ignore_system_lyxrc ||
1795 mac_like_cursor_movement
1796 != system_lyxrc.mac_like_cursor_movement) {
1797 os << "\\mac_like_cursor_movement "
1798 << convert<string>(mac_like_cursor_movement) << '\n';
1803 case RC_MACRO_EDIT_STYLE:
1804 if (ignore_system_lyxrc ||
1806 != system_lyxrc.macro_edit_style) {
1807 os << "\\macro_edit_style ";
1808 switch (macro_edit_style) {
1809 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1810 case MACRO_EDIT_INLINE: os << "1\n"; break;
1811 case MACRO_EDIT_LIST: os << "2\n"; break;
1817 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1818 if (ignore_system_lyxrc ||
1819 dialogs_iconify_with_main
1820 != system_lyxrc.dialogs_iconify_with_main) {
1821 os << "\\dialogs_iconify_with_main "
1822 << convert<string>(dialogs_iconify_with_main) << '\n';
1827 case RC_SCREEN_FONT_ROMAN:
1828 if (ignore_system_lyxrc ||
1829 roman_font_name != system_lyxrc.roman_font_name) {
1830 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
1845 case RC_SCREEN_FONT_SANS:
1846 if (ignore_system_lyxrc ||
1847 sans_font_name != system_lyxrc.sans_font_name) {
1848 os << "\\screen_font_sans \"" << sans_font_name
1854 case RC_SCREEN_FONT_SANS_FOUNDRY:
1855 if (ignore_system_lyxrc ||
1856 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1857 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1863 case RC_SCREEN_FONT_TYPEWRITER:
1864 if (ignore_system_lyxrc ||
1865 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1866 os << "\\screen_font_typewriter \""
1867 << typewriter_font_name << "\"\n";
1872 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1873 if (ignore_system_lyxrc ||
1874 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1875 os << "\\screen_font_typewriter_foundry \""
1876 << typewriter_font_foundry << "\"\n";
1881 case RC_SCREEN_FONT_SCALABLE:
1882 if (ignore_system_lyxrc ||
1883 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1884 os << "\\screen_font_scalable "
1885 << convert<string>(use_scalable_fonts)
1891 case RC_SCREEN_FONT_SIZES:
1892 if (ignore_system_lyxrc ||
1893 font_sizes[FONT_SIZE_TINY]
1894 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1895 font_sizes[FONT_SIZE_SCRIPT]
1896 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1897 font_sizes[FONT_SIZE_FOOTNOTE]
1898 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1899 font_sizes[FONT_SIZE_SMALL]
1900 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1901 font_sizes[FONT_SIZE_NORMAL]
1902 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1903 font_sizes[FONT_SIZE_LARGE]
1904 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1905 font_sizes[FONT_SIZE_LARGER]
1906 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1907 font_sizes[FONT_SIZE_LARGEST]
1908 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1909 font_sizes[FONT_SIZE_HUGE]
1910 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1911 font_sizes[FONT_SIZE_HUGER]
1912 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1913 streamsize old_prec = os.precision();
1914 os.setf(ios::fixed);
1916 os << "\\screen_font_sizes"
1917 << ' ' << font_sizes[FONT_SIZE_TINY]
1918 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1919 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1920 << ' ' << font_sizes[FONT_SIZE_SMALL]
1921 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1922 << ' ' << font_sizes[FONT_SIZE_LARGE]
1923 << ' ' << font_sizes[FONT_SIZE_LARGER]
1924 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1925 << ' ' << font_sizes[FONT_SIZE_HUGE]
1926 << ' ' << font_sizes[FONT_SIZE_HUGER]
1928 os.precision(old_prec);
1929 os.unsetf(ios::fixed);
1934 case RC_FULL_SCREEN_LIMIT:
1935 if (ignore_system_lyxrc ||
1936 full_screen_limit != system_lyxrc.full_screen_limit) {
1937 os << "\\fullscreen_limit "
1938 << convert<string>(full_screen_limit)
1944 case RC_FULL_SCREEN_TOOLBARS:
1945 if (ignore_system_lyxrc ||
1946 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1947 os << "\\fullscreen_toolbars "
1948 << convert<string>(full_screen_toolbars)
1954 case RC_FULL_SCREEN_SCROLLBAR:
1955 if (ignore_system_lyxrc ||
1956 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1957 os << "\\fullscreen_scrollbar "
1958 << convert<string>(full_screen_scrollbar)
1964 case RC_FULL_SCREEN_STATUSBAR:
1965 if (ignore_system_lyxrc ||
1966 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1967 os << "\\fullscreen_statusbar "
1968 << convert<string>(full_screen_statusbar)
1974 case RC_FULL_SCREEN_TABBAR:
1975 if (ignore_system_lyxrc ||
1976 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1977 os << "\\fullscreen_tabbar "
1978 << convert<string>(full_screen_tabbar)
1984 case RC_FULL_SCREEN_MENUBAR:
1985 if (ignore_system_lyxrc ||
1986 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1987 os << "\\fullscreen_menubar "
1988 << convert<string>(full_screen_menubar)
1994 case RC_FULL_SCREEN_WIDTH:
1995 if (ignore_system_lyxrc ||
1996 full_screen_width != system_lyxrc.full_screen_width) {
1997 os << "\\fullscreen_width "
1998 << convert<string>(full_screen_width)
2004 case RC_OPEN_BUFFERS_IN_TABS:
2005 if (ignore_system_lyxrc ||
2006 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2007 os << "\\open_buffers_in_tabs "
2008 << convert<string>(open_buffers_in_tabs)
2014 case RC_SINGLE_CLOSE_TAB_BUTTON:
2015 if (ignore_system_lyxrc ||
2016 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2017 os << "\\single_close_tab_button "
2018 << convert<string>(single_close_tab_button)
2024 case RC_SINGLE_INSTANCE:
2025 if (ignore_system_lyxrc ||
2026 single_instance != system_lyxrc.single_instance) {
2027 os << "\\single_instance "
2028 << convert<string>(single_instance)
2034 case RC_FORWARD_SEARCH_DVI:
2035 if (ignore_system_lyxrc ||
2036 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2037 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2042 case RC_FORWARD_SEARCH_PDF:
2043 if (ignore_system_lyxrc ||
2044 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2045 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2051 << "# COLOR SECTION ###################################\n"
2056 for (int i = 0; i < Color_ignore; ++i) {
2057 ColorCode lc = static_cast<ColorCode>(i);
2058 string const col = lcolor.getX11Name(lc);
2059 if (ignore_system_lyxrc
2060 || col != system_lcolor.getX11Name(lc)) {
2061 os << "\\set_color \""
2062 << lcolor.getLyXName(lc) << "\" \""
2070 << "# PRINTER SECTION ###################################\n"
2074 case RC_PRINTLANDSCAPEFLAG:
2075 if (ignore_system_lyxrc ||
2076 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2077 os << "\\print_landscape_flag \"" << print_landscape_flag
2083 case RC_PRINTPAPERFLAG:
2084 if (ignore_system_lyxrc ||
2085 print_paper_flag != system_lyxrc.print_paper_flag) {
2086 os << "\\print_paper_flag \"" << print_paper_flag
2092 case RC_PRINTPAPERDIMENSIONFLAG:
2093 if (ignore_system_lyxrc ||
2094 print_paper_dimension_flag
2095 != system_lyxrc.print_paper_dimension_flag) {
2096 os << "\\print_paper_dimension_flag \""
2097 << print_paper_dimension_flag << "\"\n";
2103 << "# TEX SECTION #######################################\n"
2107 case RC_TEXINPUTS_PREFIX:
2108 if (ignore_system_lyxrc ||
2109 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2110 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2115 case RC_FONT_ENCODING:
2116 if (ignore_system_lyxrc ||
2117 fontenc != system_lyxrc.fontenc) {
2118 os << "\\font_encoding \"" << fontenc << "\"\n";
2124 << "# FILE SECTION ######################################\n"
2128 case RC_DOCUMENTPATH:
2129 if (ignore_system_lyxrc ||
2130 document_path != system_lyxrc.document_path) {
2131 string const path = os::external_path(document_path);
2132 os << "\\document_path \"" << path << "\"\n";
2137 case RC_USELASTFILEPOS:
2138 if (ignore_system_lyxrc ||
2139 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2140 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2146 case RC_LOADSESSION:
2147 if (ignore_system_lyxrc ||
2148 load_session != system_lyxrc.load_session) {
2149 os << "\\load_session " << convert<string>(load_session)
2155 case RC_MOUSE_WHEEL_SPEED:
2156 if (ignore_system_lyxrc ||
2157 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2158 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2163 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2164 if (ignore_system_lyxrc ||
2165 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2166 os << "\\mouse_middlebutton_paste "
2167 << convert<string>(mouse_middlebutton_paste) << '\n';
2172 case RC_COMPLETION_INLINE_DELAY:
2173 if (ignore_system_lyxrc ||
2174 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2175 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2180 case RC_COMPLETION_INLINE_MATH:
2181 if (ignore_system_lyxrc ||
2182 completion_inline_math != system_lyxrc.completion_inline_math) {
2183 os << "\\completion_inline_math "
2184 << convert<string>(completion_inline_math) << '\n';
2189 case RC_COMPLETION_INLINE_TEXT:
2190 if (ignore_system_lyxrc ||
2191 completion_inline_text != system_lyxrc.completion_inline_text) {
2192 os << "\\completion_inline_text "
2193 << convert<string>(completion_inline_text) << '\n';
2198 case RC_COMPLETION_INLINE_DOTS:
2199 if (ignore_system_lyxrc ||
2200 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2201 os << "\\completion_inline_dots "
2202 << convert<string>(completion_inline_dots) << '\n';
2207 case RC_AUTOCORRECTION_MATH:
2208 if (ignore_system_lyxrc ||
2209 autocorrection_math != system_lyxrc.autocorrection_math) {
2210 os << "\\autocorrection_math "
2211 << convert<string>(autocorrection_math) << '\n';
2216 case RC_COMPLETION_POPUP_DELAY:
2217 if (ignore_system_lyxrc ||
2218 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2219 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2224 case RC_COMPLETION_POPUP_MATH:
2225 if (ignore_system_lyxrc ||
2226 completion_popup_math != system_lyxrc.completion_popup_math) {
2227 os << "\\completion_popup_math "
2228 << convert<string>(completion_popup_math) << '\n';
2233 case RC_COMPLETION_POPUP_TEXT:
2234 if (ignore_system_lyxrc ||
2235 completion_popup_text != system_lyxrc.completion_popup_text) {
2236 os << "\\completion_popup_text "
2237 << convert<string>(completion_popup_text) << '\n';
2242 case RC_COMPLETION_CURSOR_TEXT:
2243 if (ignore_system_lyxrc ||
2244 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2245 os << "\\completion_cursor_text "
2246 << convert<string>(completion_cursor_text) << '\n';
2251 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2252 if (ignore_system_lyxrc ||
2253 completion_popup_after_complete
2254 != system_lyxrc.completion_popup_after_complete) {
2255 os << "\\completion_popup_after_complete "
2256 << convert<string>(completion_popup_after_complete) << '\n';
2261 case RC_COMPLETION_MINLENGTH:
2262 if (ignore_system_lyxrc ||
2263 completion_minlength != system_lyxrc.completion_minlength) {
2264 os << "\\completion_minlength " << convert<string>(completion_minlength)
2270 case RC_NUMLASTFILES:
2271 if (ignore_system_lyxrc ||
2272 num_lastfiles != system_lyxrc.num_lastfiles) {
2273 os << "\\num_lastfiles " << num_lastfiles << '\n';
2278 case RC_CHECKLASTFILES:
2279 if (ignore_system_lyxrc ||
2280 check_lastfiles != system_lyxrc.check_lastfiles) {
2281 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2287 case RC_EXAMPLEPATH:
2288 if (ignore_system_lyxrc ||
2289 example_path != system_lyxrc.example_path) {
2290 string const path = os::external_path(example_path);
2291 os << "\\example_path \"" << path << "\"\n";
2296 case RC_TEMPLATEPATH:
2297 if (ignore_system_lyxrc ||
2298 template_path != system_lyxrc.template_path) {
2299 string const path = os::external_path(template_path);
2300 os << "\\template_path \"" << path << "\"\n";
2305 case RC_TEMPDIRPATH:
2306 if (ignore_system_lyxrc ||
2307 tempdir_path != system_lyxrc.tempdir_path) {
2308 string const path = os::external_path(tempdir_path);
2309 os << "\\tempdir_path \"" << path << "\"\n";
2314 case RC_THESAURUSDIRPATH:
2315 if (ignore_system_lyxrc ||
2316 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2317 string const path = os::external_path(thesaurusdir_path);
2318 os << "\\thesaurusdir_path \"" << path << "\"\n";
2323 case RC_HUNSPELLDIR_PATH:
2324 if (ignore_system_lyxrc ||
2325 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2326 string const path = os::external_path(hunspelldir_path);
2327 os << "\\hunspelldir_path \"" << path << "\"\n";
2332 case RC_PLAINTEXT_LINELEN:
2333 if (ignore_system_lyxrc ||
2334 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2335 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2340 case RC_MAKE_BACKUP:
2341 if (ignore_system_lyxrc ||
2342 make_backup != system_lyxrc.make_backup) {
2343 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2348 case RC_SAVE_COMPRESSED:
2349 if (ignore_system_lyxrc ||
2350 save_compressed != system_lyxrc.save_compressed) {
2351 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2356 case RC_SAVE_ORIGIN:
2357 if (ignore_system_lyxrc ||
2358 save_origin != system_lyxrc.save_origin) {
2359 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2364 case RC_BACKUPDIR_PATH:
2365 if (ignore_system_lyxrc ||
2366 backupdir_path != system_lyxrc.backupdir_path) {
2367 string const path = os::external_path(backupdir_path);
2368 os << "\\backupdir_path \"" << path << "\"\n";
2374 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2378 << "# SPELLCHECKER SECTION ##############################\n"
2382 case RC_ACCEPT_COMPOUND:
2383 if (ignore_system_lyxrc ||
2384 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2385 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2392 if (ignore_system_lyxrc ||
2393 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2394 os << "\\alternate_language \"" << spellchecker_alt_lang
2401 if (ignore_system_lyxrc ||
2402 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2403 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2408 case RC_USE_SYSTEM_COLORS:
2409 if (ignore_system_lyxrc ||
2410 use_system_colors != system_lyxrc.use_system_colors) {
2411 os << "\\use_system_colors "
2412 << convert<string>(use_system_colors)
2418 case RC_USE_TOOLTIP:
2419 if (ignore_system_lyxrc ||
2420 use_tooltip != system_lyxrc.use_tooltip) {
2421 os << "\\use_tooltip "
2422 << convert<string>(use_tooltip)
2428 case RC_USE_PIXMAP_CACHE:
2429 if (ignore_system_lyxrc ||
2430 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2431 os << "\\use_pixmap_cache "
2432 << convert<string>(use_pixmap_cache)
2440 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2444 case RC_DEFAULT_DECIMAL_POINT:
2445 if (ignore_system_lyxrc ||
2446 default_decimal_point != system_lyxrc.default_decimal_point) {
2447 os << "\\default_decimal_point " << default_decimal_point << '\n';
2452 case RC_DEFAULT_LENGTH_UNIT:
2453 if (ignore_system_lyxrc ||
2454 default_length_unit != system_lyxrc.default_length_unit) {
2455 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2460 case RC_SPELLCHECKER:
2461 if (ignore_system_lyxrc ||
2462 spellchecker != system_lyxrc.spellchecker) {
2463 os << "\\spellchecker " << spellchecker << '\n';
2468 case RC_SPELLCHECK_CONTINUOUSLY:
2469 if (ignore_system_lyxrc ||
2470 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2471 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2477 case RC_SPELLCHECK_NOTES:
2478 if (ignore_system_lyxrc ||
2479 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2480 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2486 case RC_VISUAL_CURSOR:
2487 if (ignore_system_lyxrc ||
2488 visual_cursor != system_lyxrc.visual_cursor) {
2489 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2494 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2495 if (ignore_system_lyxrc ||
2496 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2497 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2498 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2503 case RC_LANGUAGE_CUSTOM_PACKAGE:
2504 if (ignore_system_lyxrc ||
2505 language_custom_package != system_lyxrc.language_custom_package) {
2506 os << "\\language_custom_package \"" << language_custom_package
2512 case RC_LANGUAGE_GLOBAL_OPTIONS:
2513 if (ignore_system_lyxrc ||
2514 language_global_options
2515 != system_lyxrc.language_global_options) {
2516 os << "\\language_global_options \""
2517 << convert<string>(language_global_options)
2523 case RC_LANGUAGE_PACKAGE_SELECTION:
2524 if (ignore_system_lyxrc ||
2525 language_package_selection != system_lyxrc.language_package_selection) {
2526 os << "\\language_package_selection ";
2527 switch (language_package_selection) {
2545 case RC_LANGUAGE_COMMAND_BEGIN:
2546 if (ignore_system_lyxrc ||
2547 language_command_begin
2548 != system_lyxrc.language_command_begin) {
2549 os << "\\language_command_begin \""
2550 << language_command_begin
2556 case RC_LANGUAGE_COMMAND_END:
2557 if (ignore_system_lyxrc ||
2558 language_command_end
2559 != system_lyxrc.language_command_end) {
2560 os << "\\language_command_end \"" << language_command_end
2566 case RC_LANGUAGE_COMMAND_LOCAL:
2567 if (ignore_system_lyxrc ||
2568 language_command_local
2569 != system_lyxrc.language_command_local) {
2570 os << "\\language_command_local \""
2571 << language_command_local
2577 case RC_LANGUAGE_AUTO_BEGIN:
2578 if (ignore_system_lyxrc ||
2579 language_auto_begin != system_lyxrc.language_auto_begin) {
2580 os << "\\language_auto_begin "
2581 << convert<string>(language_auto_begin) << '\n';
2586 case RC_LANGUAGE_AUTO_END:
2587 if (ignore_system_lyxrc ||
2588 language_auto_end != system_lyxrc.language_auto_end) {
2589 os << "\\language_auto_end "
2590 << convert<string>(language_auto_end) << '\n';
2595 case RC_MARK_FOREIGN_LANGUAGE:
2596 if (ignore_system_lyxrc ||
2597 mark_foreign_language
2598 != system_lyxrc.mark_foreign_language) {
2599 os << "\\mark_foreign_language " <<
2600 convert<string>(mark_foreign_language) << '\n';
2606 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2610 case RC_AUTO_NUMBER:
2611 if (ignore_system_lyxrc ||
2612 auto_number != system_lyxrc.auto_number) {
2613 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2618 case RC_GUI_LANGUAGE:
2619 if (ignore_system_lyxrc ||
2620 gui_language != system_lyxrc.gui_language) {
2621 os << "\\gui_language " << gui_language << '\n';
2626 case RC_EXPORT_OVERWRITE:
2627 if (ignore_system_lyxrc ||
2628 export_overwrite != system_lyxrc.export_overwrite) {
2630 switch (export_overwrite) {
2641 os << "\\export_overwrite " << status << '\n';
2646 case RC_SCROLL_WHEEL_ZOOM:
2647 if (ignore_system_lyxrc ||
2648 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2650 switch (scroll_wheel_zoom) {
2651 case SCROLL_WHEEL_ZOOM_OFF:
2654 case SCROLL_WHEEL_ZOOM_CTRL:
2657 case SCROLL_WHEEL_ZOOM_SHIFT:
2660 case SCROLL_WHEEL_ZOOM_ALT:
2664 os << "\\scroll_wheel_zoom " << status << '\n';
2670 << "# FORMATS SECTION ##########################\n"
2675 // New/modified formats
2676 for (Formats::const_iterator cit = theFormats().begin();
2677 cit != theFormats().end(); ++cit) {
2678 Format const * format =
2679 theSystemFormats().getFormat(cit->name());
2681 format->extensions() != cit->extensions() ||
2682 format->prettyname() != cit->prettyname() ||
2683 format->shortcut() != cit->shortcut() ||
2684 format->viewer() != cit->viewer() ||
2685 format->editor() != cit->editor() ||
2686 format->documentFormat() != cit->documentFormat() ||
2687 format->vectorFormat() != cit->vectorFormat() ||
2688 format->inExportMenu() != cit->inExportMenu() ||
2689 format->mime() != cit->mime()) {
2690 os << "\\format \"" << cit->name() << "\" \""
2691 << cit->extensions() << "\" \""
2692 << to_utf8(cit->prettyname()) << "\" \""
2693 << cit->shortcut() << "\" \""
2694 << escapeCommand(cit->viewer()) << "\" \""
2695 << escapeCommand(cit->editor()) << "\" \"";
2696 vector<string> flags;
2697 if (cit->documentFormat())
2698 flags.push_back("document");
2699 if (cit->vectorFormat())
2700 flags.push_back("vector");
2701 if (cit->zippedNative())
2702 flags.push_back("zipped=native");
2703 if (cit->inExportMenu())
2704 flags.push_back("menu=export");
2706 os << getStringFromVector(flags);
2707 os << "\" \"" << cit->mime() << "\"\n";
2711 // Look for deleted formats
2712 for (Formats::const_iterator cit = theSystemFormats().begin();
2713 cit != theSystemFormats().end(); ++cit)
2714 if (!theFormats().getFormat(cit->name()))
2715 os << "\\format \"" << cit->name()
2716 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2720 case RC_VIEWER_ALTERNATIVES: {
2721 Alternatives::const_iterator it = viewer_alternatives.begin();
2722 Alternatives::const_iterator const en = viewer_alternatives.end();
2723 Alternatives::const_iterator const sysend =
2724 system_lyxrc.viewer_alternatives.end();
2725 for (; it != en; ++it) {
2726 string const & fmt = it->first;
2727 CommandSet const & cmd = it->second;
2728 CommandSet::const_iterator sit = cmd.begin();
2729 CommandSet::const_iterator const sen = cmd.end();
2730 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2731 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2732 system_lyxrc.viewer_alternatives.find(fmt);
2733 for (; sit != sen; ++sit) {
2734 string const & cmd = *sit;
2735 if (ignore_system_lyxrc
2736 || sysfmt == sysend // format not found
2737 || sysfmt->second.count(cmd) == 0 // this command not found
2739 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2746 case RC_EDITOR_ALTERNATIVES: {
2747 Alternatives::const_iterator it = editor_alternatives.begin();
2748 Alternatives::const_iterator const en = editor_alternatives.end();
2749 Alternatives::const_iterator const sysend =
2750 system_lyxrc.editor_alternatives.end();
2751 for (; it != en; ++it) {
2752 string const & fmt = it->first;
2753 CommandSet const & cmd = it->second;
2754 CommandSet::const_iterator sit = cmd.begin();
2755 CommandSet::const_iterator const sen = cmd.end();
2756 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2757 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2758 system_lyxrc.editor_alternatives.find(fmt);
2759 for (; sit != sen; ++sit) {
2760 string const & cmd = *sit;
2761 if (ignore_system_lyxrc
2762 || sysfmt == sysend // format not found
2763 || sysfmt->second.count(cmd) == 0 // this command not found
2765 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2772 case RC_DEFAULT_OTF_VIEW_FORMAT:
2773 if ((ignore_system_lyxrc ||
2774 default_otf_view_format != system_lyxrc.default_otf_view_format)
2775 && !default_otf_view_format.empty()) {
2776 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2781 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2782 if ((ignore_system_lyxrc ||
2783 default_platex_view_format != system_lyxrc.default_platex_view_format)
2784 && !default_platex_view_format.empty()) {
2785 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2790 case RC_DEFAULT_VIEW_FORMAT:
2791 if (ignore_system_lyxrc ||
2792 default_view_format != system_lyxrc.default_view_format) {
2793 os << "\\default_view_format " << default_view_format << '\n';
2804 << "# CONVERTERS SECTION ##########################\n"
2809 // Look for new converters
2810 for (Converters::const_iterator cit = theConverters().begin();
2811 cit != theConverters().end(); ++cit) {
2812 Converter const * converter =
2813 theSystemConverters().getConverter(cit->from(),
2816 converter->command() != cit->command() ||
2817 converter->flags() != cit->flags())
2818 os << "\\converter \"" << cit->from() << "\" \""
2819 << cit->to() << "\" \""
2820 << escapeCommand(cit->command()) << "\" \""
2821 << cit->flags() << "\"\n";
2824 // New/modifed converters
2825 for (Converters::const_iterator cit = theSystemConverters().begin();
2826 cit != theSystemConverters().end(); ++cit)
2827 if (!theConverters().getConverter(cit->from(), cit->to()))
2828 os << "\\converter \"" << cit->from()
2829 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2836 << "# COPIERS SECTION ##########################\n"
2839 // Look for new movers
2840 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2841 Movers::const_iterator const sysend = theSystemMovers().end();
2842 Movers::const_iterator it = theMovers().begin();
2843 Movers::const_iterator end = theMovers().end();
2845 for (; it != end; ++it) {
2846 Movers::const_iterator const sysit =
2847 find_if(sysbegin, sysend, SameMover(*it));
2848 if (sysit == sysend) {
2849 string const & fmt = it->first;
2850 string const & command =
2851 it->second.command();
2853 os << "\\copier " << fmt
2854 << " \"" << escapeCommand(command) << "\"\n";
2860 // We don't actually delete SpecialisedMover(s) from the
2861 // map, just clear their 'command', so there's no need
2862 // to test for anything else.
2869 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2871 // Why the switch you might ask. It is a trick to ensure that all
2872 // the elements in the LyXRCTags enum is handled. As you can see
2873 // there are no breaks at all. So it is just a huge fall-through.
2874 // The nice thing is that we will get a warning from the compiler
2875 // if we forget an element.
2876 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2878 case LyXRC::RC_LAST:
2879 case LyXRC::RC_ACCEPT_COMPOUND:
2880 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2881 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2883 case LyXRC::RC_ALT_LANG:
2884 case LyXRC::RC_PLAINTEXT_LINELEN:
2885 case LyXRC::RC_AUTOCORRECTION_MATH:
2886 case LyXRC::RC_AUTOREGIONDELETE:
2887 case LyXRC::RC_AUTORESET_OPTIONS:
2888 case LyXRC::RC_AUTOSAVE:
2889 case LyXRC::RC_AUTO_NUMBER:
2890 case LyXRC::RC_BACKUPDIR_PATH:
2891 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2892 case LyXRC::RC_BIBTEX_COMMAND:
2893 case LyXRC::RC_BINDFILE:
2894 case LyXRC::RC_CHECKLASTFILES:
2895 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2896 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2897 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2898 case LyXRC::RC_COMPLETION_INLINE_MATH:
2899 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2900 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2901 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2902 case LyXRC::RC_COMPLETION_POPUP_MATH:
2903 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2904 case LyXRC::RC_COMPLETION_MINLENGTH:
2905 case LyXRC::RC_USELASTFILEPOS:
2906 case LyXRC::RC_LOADSESSION:
2907 case LyXRC::RC_CHKTEX_COMMAND:
2908 case LyXRC::RC_CONVERTER:
2909 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2910 case LyXRC::RC_COPIER:
2911 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2912 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2913 case LyXRC::RC_DATE_INSERT_FORMAT:
2914 case LyXRC::RC_GUI_LANGUAGE:
2915 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2916 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2917 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2918 case LyXRC::RC_DEFFILE:
2919 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2920 case LyXRC::RC_DISPLAY_GRAPHICS:
2921 case LyXRC::RC_DOCUMENTPATH:
2922 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2923 FileName path(lyxrc_new.document_path);
2924 if (path.exists() && path.isDirectory())
2925 package().document_dir() = FileName(lyxrc.document_path);
2928 case LyXRC::RC_EDITOR_ALTERNATIVES:
2929 case LyXRC::RC_ESC_CHARS:
2930 case LyXRC::RC_EXAMPLEPATH:
2931 case LyXRC::RC_FONT_ENCODING:
2932 case LyXRC::RC_FILEFORMAT:
2933 case LyXRC::RC_GROUP_LAYOUTS:
2934 case LyXRC::RC_HUNSPELLDIR_PATH:
2935 case LyXRC::RC_ICON_SET:
2936 case LyXRC::RC_INDEX_ALTERNATIVES:
2937 case LyXRC::RC_INDEX_COMMAND:
2938 case LyXRC::RC_JBIBTEX_COMMAND:
2939 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2940 case LyXRC::RC_JINDEX_COMMAND:
2941 case LyXRC::RC_NOMENCL_COMMAND:
2942 case LyXRC::RC_PYGMENTIZE_COMMAND:
2943 case LyXRC::RC_INPUT:
2944 case LyXRC::RC_KBMAP:
2945 case LyXRC::RC_KBMAP_PRIMARY:
2946 case LyXRC::RC_KBMAP_SECONDARY:
2947 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2948 case LyXRC::RC_LANGUAGE_AUTO_END:
2949 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2950 case LyXRC::RC_LANGUAGE_COMMAND_END:
2951 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2952 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2953 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2954 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2955 case LyXRC::RC_LYXRCFORMAT:
2956 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2957 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2958 case LyXRC::RC_MACRO_EDIT_STYLE:
2959 case LyXRC::RC_MAKE_BACKUP:
2960 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2961 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2962 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2963 case LyXRC::RC_NUMLASTFILES:
2964 case LyXRC::RC_PARAGRAPH_MARKERS:
2965 case LyXRC::RC_PATH_PREFIX:
2966 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2967 prependEnvPath("PATH", lyxrc_new.path_prefix);
2968 // Resets python path
2969 support::os::python(true);
2972 case LyXRC::RC_PREVIEW:
2973 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2974 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2975 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2976 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2977 case LyXRC::RC_PRINTPAPERFLAG:
2978 case LyXRC::RC_SAVE_COMPRESSED:
2979 case LyXRC::RC_SAVE_ORIGIN:
2980 case LyXRC::RC_SCREEN_DPI:
2981 case LyXRC::RC_SCREEN_FONT_ROMAN:
2982 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2983 case LyXRC::RC_SCREEN_FONT_SANS:
2984 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2985 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2986 case LyXRC::RC_SCREEN_FONT_SIZES:
2987 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2988 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2989 case LyXRC::RC_GEOMETRY_SESSION:
2990 case LyXRC::RC_SCREEN_ZOOM:
2991 case LyXRC::RC_SERVERPIPE:
2992 case LyXRC::RC_SET_COLOR:
2993 case LyXRC::RC_SHOW_BANNER:
2994 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2995 case LyXRC::RC_SPELLCHECKER:
2996 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2999 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3000 case LyXRC::RC_SPELLCHECK_NOTES:
3001 case LyXRC::RC_SPLITINDEX_COMMAND:
3002 case LyXRC::RC_TEMPDIRPATH:
3003 case LyXRC::RC_TEMPLATEPATH:
3004 case LyXRC::RC_TEX_ALLOWS_SPACES:
3005 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3006 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3007 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3010 case LyXRC::RC_TEXINPUTS_PREFIX:
3011 case LyXRC::RC_THESAURUSDIRPATH:
3012 case LyXRC::RC_UIFILE:
3013 case LyXRC::RC_USER_EMAIL:
3014 case LyXRC::RC_USER_NAME:
3015 case LyXRC::RC_USE_CONVERTER_CACHE:
3016 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
3017 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
3018 case LyXRC::RC_USE_SYSTEM_COLORS:
3019 case LyXRC::RC_USE_TOOLTIP:
3020 case LyXRC::RC_USE_PIXMAP_CACHE:
3021 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3022 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3023 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3024 case LyXRC::RC_SINGLE_INSTANCE:
3025 case LyXRC::RC_SORT_LAYOUTS:
3026 case LyXRC::RC_FULL_SCREEN_LIMIT:
3027 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3028 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3029 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3030 case LyXRC::RC_FULL_SCREEN_TABBAR:
3031 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3032 case LyXRC::RC_FULL_SCREEN_WIDTH:
3033 case LyXRC::RC_VISUAL_CURSOR:
3034 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3035 case LyXRC::RC_VIEWER:
3036 case LyXRC::RC_VIEWER_ALTERNATIVES:
3037 case LyXRC::RC_FORWARD_SEARCH_DVI:
3038 case LyXRC::RC_FORWARD_SEARCH_PDF:
3039 case LyXRC::RC_EXPORT_OVERWRITE:
3040 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3041 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3042 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3043 case LyXRC::RC_CURSOR_WIDTH:
3050 string const LyXRC::getDescription(LyXRCTags tag)
3055 case RC_ACCEPT_COMPOUND:
3056 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3060 str = _("Specify an alternate language. The default is to use the language of the document.");
3063 case RC_PLAINTEXT_LINELEN:
3064 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.");
3067 case RC_AUTOREGIONDELETE:
3068 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3071 case RC_AUTORESET_OPTIONS:
3072 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3076 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3079 case RC_AUTO_NUMBER:
3082 case RC_BACKUPDIR_PATH:
3083 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.");
3086 case RC_BIBTEX_COMMAND:
3087 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3090 case RC_JBIBTEX_COMMAND:
3091 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3095 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3098 case RC_CHECKLASTFILES:
3099 str = _("Select to check whether the lastfiles still exist.");
3102 case RC_CHKTEX_COMMAND:
3103 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3109 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3110 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3113 case RC_CONVERTER_NEEDAUTH:
3114 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3120 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3121 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.");
3124 case RC_CURSOR_WIDTH:
3125 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3128 case RC_SCROLL_BELOW_DOCUMENT:
3129 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");
3132 case RC_MAC_DONTSWAP_CTRL_META:
3133 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3136 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3137 str = _("Use the Mac OS X conventions for cursor movement");
3140 case RC_SHOW_MACRO_LABEL:
3141 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3144 case RC_DATE_INSERT_FORMAT:
3145 //xgettext:no-c-format
3146 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3150 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3153 case RC_DEFAULT_OTF_VIEW_FORMAT:
3154 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3157 case RC_DEFAULT_VIEW_FORMAT:
3158 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3161 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3162 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3165 case RC_DISPLAY_GRAPHICS:
3166 str = _("Select how LyX will display any graphics.");
3169 case RC_DOCUMENTPATH:
3170 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3174 str = _("Specify additional chars that can be part of a word.");
3177 case RC_EXAMPLEPATH:
3178 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3181 case RC_FONT_ENCODING:
3182 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3188 case RC_INDEX_COMMAND:
3189 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\".");
3192 case RC_JINDEX_COMMAND:
3193 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3196 case RC_NOMENCL_COMMAND:
3197 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3200 case RC_PYGMENTIZE_COMMAND:
3201 str = _("The command to run the python pygments syntax highlighter.");
3208 case RC_KBMAP_PRIMARY:
3209 case RC_KBMAP_SECONDARY:
3210 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.");
3213 case RC_LANGUAGE_AUTO_BEGIN:
3214 str = _("Select if a language switching command is needed at the beginning of the document.");
3217 case RC_LANGUAGE_AUTO_END:
3218 str = _("Select if a language switching command is needed at the end of the document.");
3221 case RC_LANGUAGE_COMMAND_BEGIN:
3222 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.");
3225 case RC_LANGUAGE_COMMAND_END:
3226 str = _("The LaTeX command for changing back to the language of the document.");
3229 case RC_LANGUAGE_COMMAND_LOCAL:
3230 str = _("The LaTeX command for local changing of the language.");
3233 case RC_LANGUAGE_GLOBAL_OPTIONS:
3234 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3237 case RC_LANGUAGE_CUSTOM_PACKAGE:
3238 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3241 case RC_LANGUAGE_PACKAGE_SELECTION:
3242 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3245 case RC_USELASTFILEPOS:
3246 str = _("De-select if you do not want LyX to scroll to saved position.");
3249 case RC_LOADSESSION:
3250 str = _("De-select to prevent loading files opened from the last LyX session.");
3253 case RC_MAKE_BACKUP:
3254 str = _("De-select if you don't want LyX to create backup files.");
3257 case RC_MARK_FOREIGN_LANGUAGE:
3258 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3261 case RC_MOUSE_WHEEL_SPEED:
3262 str = _("The scrolling speed of the mouse wheel.");
3265 case RC_COMPLETION_POPUP_DELAY:
3266 str = _("The completion popup delay.");
3269 case RC_COMPLETION_POPUP_MATH:
3270 str = _("Select to display the completion popup in math mode.");
3273 case RC_COMPLETION_POPUP_TEXT:
3274 str = _("Select to display the completion popup in text mode.");
3277 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3278 str = _("Show the completion popup without delay after non-unique completion attempt.");
3281 case RC_COMPLETION_POPUP_TEXT:
3282 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3285 case RC_COMPLETION_POPUP_DELAY:
3286 str = _("The inline completion delay.");
3289 case RC_COMPLETION_INLINE_MATH:
3290 str = _("Select to display the inline completion in math mode.");
3293 case RC_COMPLETION_INLINE_TEXT:
3294 str = _("Select to display the inline completion in text mode.");
3297 case RC_COMPLETION_INLINE_DOTS:
3298 str = _("Use \"...\" to shorten long completions.");
3301 case RC_AUTOCORRECTION_MATH:
3302 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3305 case RC_NUMLASTFILES:
3306 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3310 case RC_PATH_PREFIX:
3311 str = _("Specify those directories which should be "
3312 "prepended to the PATH environment variable.\n"
3313 "Use the OS native format.");
3317 str = _("Shows a typeset preview of things such as math");
3320 case RC_PREVIEW_HASHED_LABELS:
3321 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3324 case RC_PREVIEW_SCALE_FACTOR:
3325 str = _("Scale the preview size to suit.");
3328 case RC_PRINTLANDSCAPEFLAG:
3329 str = _("The option to print out in landscape.");
3332 case RC_PRINTPAPERDIMENSIONFLAG:
3333 str = _("Option to specify the dimensions of the print paper.");
3336 case RC_PRINTPAPERFLAG:
3337 str = _("The option to specify paper type.");
3340 case RC_VISUAL_CURSOR:
3341 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3344 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3345 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).");
3349 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3352 case RC_SCREEN_FONT_ROMAN:
3353 case RC_SCREEN_FONT_SANS:
3354 case RC_SCREEN_FONT_TYPEWRITER:
3355 str = _("The screen fonts used to display the text while editing.");
3358 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3359 case RC_SCREEN_FONT_SANS_FOUNDRY:
3360 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3363 case RC_SCREEN_FONT_SCALABLE:
3364 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.");
3367 case RC_SCREEN_FONT_SIZES:
3368 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3371 case RC_SCREEN_ZOOM:
3372 //xgettext:no-c-format
3373 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3376 case RC_GEOMETRY_SESSION:
3377 str = _("Allow session manager to save and restore windows geometry.");
3381 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3387 case RC_SHOW_BANNER:
3388 str = _("De-select if you don't want the startup banner.");
3391 case RC_TEMPDIRPATH:
3392 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3395 case RC_THESAURUSDIRPATH:
3396 str = _("This is the place where the files of the thesaurus library reside.");
3399 case RC_TEMPLATEPATH:
3400 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3403 case RC_TEX_ALLOWS_SPACES:
3406 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3409 case RC_TEXINPUTS_PREFIX:
3410 str = _("Specify those directories which should be "
3411 "prepended to the TEXINPUTS environment variable.\n"
3412 "A '.' represents the current document directory. "
3413 "Use the OS native format.");
3417 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3426 case RC_USE_USE_SYSTEM_COLORS:
3427 str = _("Enable use the system colors for some things like main window background and selection.");
3430 case RC_USE_TOOLTIP:
3431 str = _("Enable the automatic appearance of tool tips in the work area.");
3434 case RC_USE_PIXMAP_CACHE:
3435 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3438 case RC_VIEWDVI_PAPEROPTION:
3439 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3454 // The global instance
3457 // The global copy of the system lyxrc entries (everything except preferences)