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 = 26; // spitz: remove font_encoding
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 { "\\format", LyXRC::RC_FILEFORMAT },
111 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
112 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
113 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
114 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
115 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
116 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
117 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
118 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
119 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
120 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
121 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
122 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
123 { "\\icon_set", LyXRC::RC_ICON_SET },
124 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
125 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
126 { "\\input", LyXRC::RC_INPUT },
127 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
128 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
129 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
130 { "\\kbmap", LyXRC::RC_KBMAP },
131 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
132 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
133 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
134 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
135 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
136 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
137 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
138 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
139 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
140 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
141 { "\\load_session", LyXRC::RC_LOADSESSION },
142 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
143 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
144 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
145 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
146 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
147 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
148 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
149 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
150 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
151 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
152 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
153 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
154 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
155 { "\\preview", LyXRC::RC_PREVIEW },
156 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
157 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
158 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
159 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
160 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
161 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
162 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
163 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
164 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
165 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
166 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
167 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
168 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
169 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
170 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
171 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
172 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
173 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
174 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
175 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
176 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
177 { "\\set_color", LyXRC::RC_SET_COLOR },
178 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
179 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
180 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
181 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
182 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
183 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
184 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
185 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
186 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
187 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
188 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
189 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
190 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
191 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
192 { "\\ui_file", LyXRC::RC_UIFILE },
193 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
194 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
195 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
196 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
197 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
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";
243 index_command = "makeindex -c -q";
244 nomencl_command = "makeindex -s nomencl.ist";
245 pygmentize_command = string();
247 // Because a screen is typically wider than a piece of paper:
249 currentZoom = defaultZoom;
250 allow_geometry_session = true;
251 // Default LaTeX font size:
252 font_sizes[FONT_SIZE_TINY] = "5.0";
253 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
254 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
255 font_sizes[FONT_SIZE_SMALL] = "9.0";
256 font_sizes[FONT_SIZE_NORMAL] = "10.0";
257 font_sizes[FONT_SIZE_LARGE] = "12.0";
258 font_sizes[FONT_SIZE_LARGER] = "14.4";
259 font_sizes[FONT_SIZE_LARGEST] = "17.26";
260 font_sizes[FONT_SIZE_HUGE] = "20.74";
261 font_sizes[FONT_SIZE_HUGER] = "24.88";
262 use_scalable_fonts = true;
263 roman_font_name = "";
265 typewriter_font_name = "";
267 auto_region_delete = true;
268 auto_reset_options = false;
269 plaintext_linelen = 65;
270 mouse_wheel_speed = 1.0;
272 check_lastfiles = true;
273 use_lastfilepos = true;
274 use_native_filedialog = 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_ENCHANT)
286 spellchecker = "enchant";
287 #elif defined(USE_ASPELL)
288 spellchecker = "aspell";
289 #elif defined(USE_HUNSPELL)
290 spellchecker = "hunspell";
292 spellchecker = "aspell";
294 spellchecker_accept_compound = false;
295 spellcheck_continuously = false;
296 completion_minlength = 6;
297 spellcheck_notes = true;
299 visual_cursor = false;
301 mark_foreign_language = true;
302 language_auto_begin = true;
303 language_auto_end = true;
304 language_global_options = true;
305 language_package_selection = LP_AUTO;
306 language_custom_package = "\\usepackage{babel}";
307 language_command_begin = "\\selectlanguage{$$lang}";
308 language_command_local = "\\foreignlanguage{$$lang}{";
309 sort_layouts = false;
310 group_layouts = true;
311 gui_language = "auto";
313 windows_style_tex_paths = false;
314 tex_allows_spaces = false;
315 date_insert_format = "%x";
316 cursor_follows_scrollbar = false;
317 scroll_below_document = false;
318 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
319 paragraph_markers = false;
320 mac_dontswap_ctrl_meta = false;
321 mac_like_cursor_movement = false;
322 macro_edit_style = MACRO_EDIT_INLINE_BOX;
323 dialogs_iconify_with_main = false;
324 preview = PREVIEW_OFF;
325 preview_hashed_labels = false;
326 preview_scale_factor = 1.0;
327 use_converter_cache = true;
328 use_converter_needauth_forbidden = true;
329 use_converter_needauth = true;
330 use_system_colors = false;
332 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);
410 if (retval == FormatMismatch)
411 LYXERR0("Conversion failed for " << filename.absFileName());
413 return retval == ReadOK;
417 // don't need to worry about conversion, because this is always
418 // from an internal source
419 bool LyXRC::read(istream & is)
421 Lexer lexrc(lyxrcTags);
423 LYXERR(Debug::LYXRC, "Reading istream...");
424 return read(lexrc, false) == ReadOK;
428 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
430 if (lyxerr.debugging(Debug::PARSER))
431 lexrc.printTable(lyxerr);
436 // format prior to 2.0 and introduction of format tag
437 unsigned int rc_format = 0;
439 while (lexrc.isOK()) {
440 // By using two switches we take advantage of the compiler
441 // telling us if we have missed a LyXRCTags element in
442 // the second switch.
443 // Note that this also shows a problem with Lexer since it
444 // helps us avoid taking advantage of the strictness of the
447 int le = lexrc.lex();
449 case Lexer::LEX_UNDEF:
450 lexrc.printError("Unknown tag `$$Token'");
452 case Lexer::LEX_FEOF:
457 switch (static_cast<LyXRCTags>(le)) {
460 rc_format = lexrc.getInteger();
462 case RC_INPUT: // Include file
465 libFileSearch(string(),
467 if (!read(tmp, check_format)) {
469 "Error reading included file: " + tmp.absFileName());
475 bind_file = os::internal_path(lexrc.getString());
480 def_file = os::internal_path(lexrc.getString());
485 ui_file = os::internal_path(lexrc.getString());
488 case RC_AUTORESET_OPTIONS:
489 lexrc >> auto_reset_options;
492 case RC_DISPLAY_GRAPHICS:
494 display_graphics = lexrc.getString() == "true";
497 case RC_TEX_EXPECTS_WINDOWS_PATHS:
498 lexrc >> windows_style_tex_paths;
501 case RC_TEX_ALLOWS_SPACES:
502 lexrc >> tex_allows_spaces;
505 case RC_TEXINPUTS_PREFIX:
506 lexrc >> texinputs_prefix;
513 case RC_KBMAP_PRIMARY:
515 string const kmap(os::internal_path(lexrc.getString()));
516 if (!libFileSearch("kbd", kmap, "kmap").empty()
518 primary_kbmap = kmap;
520 lexrc.printError("LyX: Keymap `$$Token' not found");
525 case RC_KBMAP_SECONDARY:
527 string const kmap(os::internal_path(lexrc.getString()));
528 if (!libFileSearch("kbd", kmap, "kmap").empty()
530 secondary_kbmap = kmap;
532 lexrc.printError("LyX: Keymap `$$Token' not found");
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_NATIVE_FILEDIALOG:
875 lexrc >> use_native_filedialog;
877 case RC_USE_SYSTEM_COLORS:
878 lexrc >> use_system_colors;
881 lexrc >> use_tooltip;
883 case RC_USE_PIXMAP_CACHE:
884 lexrc >> use_pixmap_cache;
886 case RC_SPELLCHECKER:
887 lexrc >> spellchecker;
890 lexrc >> spellchecker_alt_lang;
893 lexrc >> spellchecker_esc_chars;
895 case RC_SPELLCHECK_CONTINUOUSLY:
896 lexrc >> spellcheck_continuously;
898 case RC_SPELLCHECK_NOTES:
899 lexrc >> spellcheck_notes;
902 lexrc >> make_backup;
904 case RC_SAVE_COMPRESSED:
905 lexrc >> save_compressed;
908 lexrc >> save_origin;
910 case RC_BACKUPDIR_PATH:
912 backupdir_path = os::internal_path(lexrc.getString());
914 case RC_DEFAULT_DECIMAL_POINT:
915 lexrc >> default_decimal_point;
917 case RC_DEFAULT_LENGTH_UNIT:
919 default_length_unit = (Length::UNIT) lexrc.getInteger();
921 case RC_DATE_INSERT_FORMAT:
922 lexrc >> date_insert_format;
924 case RC_LANGUAGE_CUSTOM_PACKAGE:
925 lexrc >> language_custom_package;
927 case RC_LANGUAGE_AUTO_BEGIN:
928 lexrc >> language_auto_begin;
930 case RC_LANGUAGE_AUTO_END:
931 lexrc >> language_auto_end;
933 case RC_LANGUAGE_GLOBAL_OPTIONS:
934 lexrc >> language_global_options;
936 case RC_LANGUAGE_PACKAGE_SELECTION:
938 switch (lexrc.getInteger()) {
940 language_package_selection = LP_AUTO;
943 language_package_selection = LP_BABEL;
946 language_package_selection = LP_CUSTOM;
949 language_package_selection = LP_NONE;
954 case RC_LANGUAGE_COMMAND_BEGIN:
955 lexrc >> language_command_begin;
957 case RC_LANGUAGE_COMMAND_END:
958 lexrc >> language_command_end;
960 case RC_LANGUAGE_COMMAND_LOCAL:
961 lexrc >> language_command_local;
963 case RC_VISUAL_CURSOR:
964 lexrc >> visual_cursor;
966 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
967 lexrc >> close_buffer_with_last_view;
970 lexrc >> auto_number;
972 case RC_MARK_FOREIGN_LANGUAGE:
973 lexrc >> mark_foreign_language;
979 fmt = lexrc.getString();
980 if (lexrc.next(true))
981 command = lexrc.getString();
982 setMover(fmt, command);
987 string from, to, command, flags;
989 from = lexrc.getString();
991 to = lexrc.getString();
992 if (lexrc.next(true))
993 command = lexrc.getString();
995 flags = lexrc.getString();
997 theConverters().erase(from, to);
999 theConverters().add(from, to, command, flags);
1002 // compatibility with versions older than 1.4.0 only
1004 string format, command;
1005 lexrc >> format >> command;
1006 theFormats().setViewer(format, command);
1009 case RC_FILEFORMAT: {
1011 string format, extensions, shortcut;
1012 docstring prettyname;
1013 if (!(lexrc >> format >> extensions))
1015 if (ok && lexrc.next(true))
1016 prettyname = lexrc.getDocString();
1020 if(!(lexrc >> shortcut))
1022 string viewer, editor;
1023 if (ok && lexrc.next(true))
1024 viewer = lexrc.getString();
1027 if (ok && lexrc.next(true))
1028 editor = lexrc.getString();
1032 if (!(lexrc >> flags >> mime))
1034 int flgs = Format::none;
1035 while (!flags.empty()) {
1037 flags = split(flags, flag, ',');
1038 if (flag == "document")
1039 flgs |= Format::document;
1040 else if (flag == "vector")
1041 flgs |= Format::vector;
1042 else if (flag == "zipped=native")
1043 flgs |= Format::zipped_native;
1044 else if (flag == "menu=export")
1045 flgs |= Format::export_menu;
1047 LYXERR0("Ignoring unknown flag `"
1048 << flag << "' for format `"
1052 LYXERR0("Syntax error in format " << format);
1053 else if (prettyname.empty()) {
1054 if (theConverters().formatIsUsed(format))
1055 LYXERR0("Can't delete format " << format);
1057 theFormats().erase(format);
1059 theFormats().add(format, extensions, prettyname,
1060 shortcut, viewer, editor, mime, flgs);
1064 case RC_VIEWER_ALTERNATIVES: {
1065 string format, command;
1066 if ((lexrc >> format) && lexrc.next(true)) {
1067 command = lexrc.getString();
1068 viewer_alternatives[format].insert(command);
1072 case RC_EDITOR_ALTERNATIVES: {
1073 string format, command;
1074 if ((lexrc >> format) && lexrc.next(true)) {
1075 command = lexrc.getString();
1076 editor_alternatives[format].insert(command);
1081 case RC_DEFAULT_OTF_VIEW_FORMAT:
1082 lexrc >> default_otf_view_format;
1085 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
1086 lexrc >> default_platex_view_format;
1089 case RC_DEFAULT_VIEW_FORMAT:
1090 lexrc >> default_view_format;
1093 case RC_GUI_LANGUAGE:
1094 lexrc >> gui_language;
1097 case RC_SHOW_BANNER:
1098 lexrc >> show_banner;
1103 string const tmp = lexrc.getString();
1104 if (tmp == "true" || tmp == "on")
1105 preview = PREVIEW_ON;
1106 else if (tmp == "no_math")
1107 preview = PREVIEW_NO_MATH;
1109 preview = PREVIEW_OFF;
1110 if (tmp != "false" && tmp != "off")
1111 LYXERR0("Unrecognized preview status \""
1117 case RC_PREVIEW_HASHED_LABELS:
1118 lexrc >> preview_hashed_labels;
1121 case RC_PREVIEW_SCALE_FACTOR:
1122 lexrc >> preview_scale_factor;
1129 lexrc >> user_email;
1132 case RC_PATH_PREFIX:
1133 lexrc >> path_prefix;
1136 case RC_USE_CONVERTER_CACHE:
1137 lexrc >> use_converter_cache;
1139 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1140 lexrc >> use_converter_needauth_forbidden;
1142 case RC_USE_CONVERTER_NEEDAUTH:
1143 lexrc >> use_converter_needauth;
1145 case RC_CONVERTER_CACHE_MAXAGE:
1146 lexrc >> converter_cache_maxage;
1149 case RC_SORT_LAYOUTS:
1150 lexrc >> sort_layouts;
1152 case RC_GROUP_LAYOUTS:
1153 lexrc >> group_layouts;
1155 case RC_FULL_SCREEN_LIMIT:
1156 lexrc >> full_screen_limit;
1158 case RC_FULL_SCREEN_TOOLBARS:
1159 lexrc >> full_screen_toolbars;
1161 case RC_FULL_SCREEN_SCROLLBAR:
1162 lexrc >> full_screen_scrollbar;
1164 case RC_FULL_SCREEN_STATUSBAR:
1165 lexrc >> full_screen_statusbar;
1167 case RC_FULL_SCREEN_TABBAR:
1168 lexrc >> full_screen_tabbar;
1170 case RC_FULL_SCREEN_MENUBAR:
1171 lexrc >> full_screen_menubar;
1173 case RC_FULL_SCREEN_WIDTH:
1174 lexrc >> full_screen_width;
1176 case RC_OPEN_BUFFERS_IN_TABS:
1177 lexrc >> open_buffers_in_tabs;
1179 case RC_SINGLE_CLOSE_TAB_BUTTON:
1180 lexrc >> single_close_tab_button;
1182 case RC_SINGLE_INSTANCE:
1183 lexrc >> single_instance;
1184 if (run_mode == PREFERRED)
1185 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1187 case RC_FORWARD_SEARCH_DVI:
1188 if (lexrc.next(true))
1189 forward_search_dvi = lexrc.getString();
1191 case RC_FORWARD_SEARCH_PDF:
1192 if (lexrc.next(true))
1193 forward_search_pdf = lexrc.getString();
1195 case RC_EXPORT_OVERWRITE:
1197 string const tmp = lexrc.getString();
1198 if (tmp == "all" || tmp == "true")
1199 export_overwrite = ALL_FILES;
1200 else if (tmp == "main")
1201 export_overwrite = MAIN_FILE;
1203 export_overwrite = NO_FILES;
1204 if (tmp != "ask" && tmp != "false")
1205 LYXERR0("Unrecognized export_overwrite status \""
1210 case RC_SCROLL_WHEEL_ZOOM:
1212 string const tmp = lexrc.getString();
1214 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1215 else if (tmp == "shift")
1216 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1217 else if (tmp == "alt")
1218 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1220 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1221 if (tmp != "off" && tmp != "false")
1222 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1228 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1229 lexrc >> mouse_middlebutton_paste;
1233 break; // this is just a dummy
1236 // This is triggered the first time through the loop unless
1237 // we hit a format tag.
1238 if (check_format && rc_format != LYXRC_FILEFORMAT)
1239 return FormatMismatch;
1242 /// Update converters data-structures
1243 theConverters().update(theFormats());
1244 theConverters().buildGraph();
1245 theBufferList().invalidateConverterCache();
1251 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1253 ofstream ofs(filename.toFilesystemEncoding().c_str());
1255 write(ofs, ignore_system_lyxrc);
1259 void LyXRC::print() const
1261 if (lyxerr.debugging())
1262 write(lyxerr, false);
1270 typedef pair<string, SpecialisedMover> Data;
1272 SameMover(Data const & comparison)
1273 : comparison_(comparison) {}
1275 bool operator()(Data const & data) const
1277 return data.first == comparison_.first &&
1278 data.second.command() == comparison_.second.command();
1288 // Escape \ and " so that LyXLex can read the string later
1289 string escapeCommand(string const & str) {
1290 return subst(subst(str , "\\", "\\\\"),
1297 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1299 LyXRCTags tag = RC_LAST;
1301 if (!name.empty()) {
1302 for (int i = 0; i != lyxrcCount; ++i)
1303 if ("\\" + name == lyxrcTags[i].tag)
1304 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1308 os << "# LyX " << lyx_version
1309 << " generated this file. If you want to make your own\n"
1310 << "# modifications you should do them from inside LyX and save.\n\n"
1311 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1313 // Why the switch you might ask. It is a trick to ensure that all
1314 // the elements in the LyXRCTags enum are handled. As you can see
1315 // there are no breaks at all. So it is just a huge fall-through.
1316 // The nice thing is that we will get a warning from the compiler
1317 // if we forget an element.
1321 // input/include files are not done here
1322 case RC_LYXRCFORMAT:
1324 if (ignore_system_lyxrc ||
1325 bind_file != system_lyxrc.bind_file) {
1326 string const path = os::external_path(bind_file);
1327 os << "\\bind_file \"" << path << "\"\n";
1333 if (ignore_system_lyxrc ||
1334 def_file != system_lyxrc.def_file) {
1335 string const path = os::external_path(def_file);
1336 os << "\\def_file \"" << path << "\"\n";
1345 << "# MISC SECTION ######################################\n"
1347 // bind files are not done here.
1349 case RC_PATH_PREFIX:
1350 if (ignore_system_lyxrc ||
1351 path_prefix != system_lyxrc.path_prefix) {
1352 os << "\\path_prefix \"" << path_prefix << "\"\n";
1358 if (ignore_system_lyxrc ||
1359 ui_file != system_lyxrc.ui_file) {
1360 string const path = os::external_path(ui_file);
1361 os << "\\ui_file \"" << path << "\"\n";
1366 case RC_AUTOREGIONDELETE:
1367 if (ignore_system_lyxrc ||
1368 auto_region_delete != system_lyxrc.auto_region_delete) {
1369 os << "# Set to false to inhibit automatic replacement of\n"
1370 << "# the current selection.\n"
1371 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1377 case RC_AUTORESET_OPTIONS:
1378 if (ignore_system_lyxrc ||
1379 auto_reset_options != system_lyxrc.auto_reset_options) {
1380 os << "# Set to false to inhibit automatic reset of\n"
1381 << "# the class options to defaults on class change.\n"
1382 << "\\auto_reset_options "
1383 << convert<string>(auto_reset_options)
1390 if (ignore_system_lyxrc ||
1391 autosave != system_lyxrc.autosave) {
1392 os << "# The time interval between auto-saves in seconds.\n"
1393 << "\\autosave " << autosave << '\n';
1398 case RC_DISPLAY_GRAPHICS:
1399 if (ignore_system_lyxrc ||
1400 display_graphics != system_lyxrc.display_graphics) {
1401 os << "# Display graphics within LyX\n"
1403 << "\\display_graphics "
1404 << (display_graphics ? "true" : "false")
1410 case RC_SORT_LAYOUTS:
1411 if (ignore_system_lyxrc ||
1412 sort_layouts != system_lyxrc.sort_layouts) {
1413 os << "# Sort layouts alphabetically.\n"
1414 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1419 case RC_GROUP_LAYOUTS:
1420 if (ignore_system_lyxrc ||
1421 group_layouts != system_lyxrc.group_layouts) {
1422 os << "# Group layouts by their category.\n"
1423 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1428 case RC_VIEWDVI_PAPEROPTION:
1429 if (ignore_system_lyxrc ||
1430 view_dvi_paper_option
1431 != system_lyxrc.view_dvi_paper_option) {
1432 os << "# Options used to specify paper size to the\n"
1433 << "# view_dvi_command (e.g. -paper)\n"
1434 << "\\view_dvi_paper_option \""
1435 << view_dvi_paper_option << "\"\n";
1440 case RC_CHKTEX_COMMAND:
1441 if (ignore_system_lyxrc ||
1442 chktex_command != system_lyxrc.chktex_command) {
1443 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1448 case RC_BIBTEX_ALTERNATIVES: {
1449 CommandSet::const_iterator it = bibtex_alternatives.begin();
1450 CommandSet::const_iterator end = bibtex_alternatives.end();
1451 for ( ; it != end; ++it) {
1452 if (ignore_system_lyxrc
1453 || !system_lyxrc.bibtex_alternatives.count(*it))
1454 os << "\\bibtex_alternatives \""
1461 case RC_BIBTEX_COMMAND:
1462 if (ignore_system_lyxrc ||
1463 bibtex_command != system_lyxrc.bibtex_command) {
1464 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1469 case RC_JBIBTEX_COMMAND:
1470 if (ignore_system_lyxrc ||
1471 jbibtex_command != system_lyxrc.jbibtex_command) {
1472 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1477 case RC_JBIBTEX_ALTERNATIVES: {
1478 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1479 CommandSet::const_iterator end = jbibtex_alternatives.end();
1480 for ( ; it != end; ++it) {
1481 if (ignore_system_lyxrc
1482 || !system_lyxrc.jbibtex_alternatives.count(*it))
1483 os << "\\jbibtex_alternatives \""
1490 case RC_INDEX_ALTERNATIVES: {
1491 CommandSet::const_iterator it = index_alternatives.begin();
1492 CommandSet::const_iterator end = index_alternatives.end();
1493 for ( ; it != end; ++it) {
1494 if (ignore_system_lyxrc
1495 || !system_lyxrc.index_alternatives.count(*it))
1496 os << "\\index_alternatives \""
1503 case RC_INDEX_COMMAND:
1504 if (ignore_system_lyxrc ||
1505 index_command != system_lyxrc.index_command) {
1506 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1511 case RC_JINDEX_COMMAND:
1512 if (ignore_system_lyxrc ||
1513 jindex_command != system_lyxrc.jindex_command) {
1514 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1519 case RC_SPLITINDEX_COMMAND:
1520 if (ignore_system_lyxrc ||
1521 splitindex_command != system_lyxrc.splitindex_command) {
1522 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1527 case RC_NOMENCL_COMMAND:
1528 if (ignore_system_lyxrc ||
1529 nomencl_command != system_lyxrc.nomencl_command) {
1530 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1535 case RC_PYGMENTIZE_COMMAND:
1536 if (ignore_system_lyxrc ||
1537 pygmentize_command != system_lyxrc.pygmentize_command) {
1538 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1543 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1544 // Don't write this setting to the preferences file,
1545 // but allow temporary changes (bug 7557).
1546 if (ignore_system_lyxrc) {
1547 os << "\\tex_expects_windows_paths "
1548 << convert<string>(windows_style_tex_paths) << '\n';
1553 case RC_TEX_ALLOWS_SPACES:
1554 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1555 os << "\\tex_allows_spaces "
1556 << convert<string>(tex_allows_spaces) << '\n';
1562 if (ignore_system_lyxrc ||
1563 use_kbmap != system_lyxrc.use_kbmap) {
1564 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1569 case RC_KBMAP_PRIMARY:
1570 if (ignore_system_lyxrc ||
1571 primary_kbmap != system_lyxrc.primary_kbmap) {
1572 string const path = os::external_path(primary_kbmap);
1573 os << "\\kbmap_primary \"" << path << "\"\n";
1578 case RC_KBMAP_SECONDARY:
1579 if (ignore_system_lyxrc ||
1580 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1581 string const path = os::external_path(secondary_kbmap);
1582 os << "\\kbmap_secondary \"" << path << "\"\n";
1588 if (ignore_system_lyxrc ||
1589 lyxpipes != system_lyxrc.lyxpipes) {
1590 string const path = os::external_path(lyxpipes);
1591 os << "\\serverpipe \"" << path << "\"\n";
1596 case RC_DATE_INSERT_FORMAT:
1597 if (ignore_system_lyxrc ||
1598 date_insert_format != system_lyxrc.date_insert_format) {
1599 os << "\\date_insert_format \"" << date_insert_format
1606 os << "\\user_name \"" << user_name << "\"\n";
1611 os << "\\user_email \"" << user_email << "\"\n";
1615 case RC_SHOW_BANNER:
1616 if (ignore_system_lyxrc ||
1617 show_banner != system_lyxrc.show_banner) {
1618 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1624 if (ignore_system_lyxrc ||
1625 preview != system_lyxrc.preview) {
1631 case PREVIEW_NO_MATH:
1638 os << "\\preview " << status << '\n';
1643 case RC_PREVIEW_HASHED_LABELS:
1644 if (ignore_system_lyxrc ||
1645 preview_hashed_labels !=
1646 system_lyxrc.preview_hashed_labels) {
1647 os << "\\preview_hashed_labels "
1648 << convert<string>(preview_hashed_labels) << '\n';
1653 case RC_PREVIEW_SCALE_FACTOR:
1654 if (ignore_system_lyxrc ||
1655 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1656 os << "\\preview_scale_factor "
1657 << preview_scale_factor << '\n';
1662 case RC_USE_CONVERTER_CACHE:
1663 if (ignore_system_lyxrc ||
1664 use_converter_cache != system_lyxrc.use_converter_cache) {
1665 os << "\\use_converter_cache "
1666 << convert<string>(use_converter_cache) << '\n';
1671 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1672 if (ignore_system_lyxrc ||
1673 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1674 os << "\\use_converter_needauth_forbidden "
1675 << convert<string>(use_converter_needauth_forbidden) << '\n';
1680 case RC_USE_CONVERTER_NEEDAUTH:
1681 if (ignore_system_lyxrc ||
1682 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1683 os << "\\use_converter_needauth "
1684 << convert<string>(use_converter_needauth) << '\n';
1689 case RC_CONVERTER_CACHE_MAXAGE:
1690 if (ignore_system_lyxrc ||
1691 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1692 os << "\\converter_cache_maxage "
1693 << converter_cache_maxage << '\n';
1699 << "# SCREEN & FONTS SECTION ############################\n"
1703 if (ignore_system_lyxrc ||
1704 icon_set != system_lyxrc.icon_set) {
1705 os << "\\icon_set \"" << icon_set
1711 case RC_USE_SYSTEM_THEME_ICONS:
1712 if (ignore_system_lyxrc ||
1713 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1714 os << "\\use_system_theme_icons "
1715 << convert<string>(use_system_theme_icons)
1722 if (ignore_system_lyxrc ||
1723 dpi != system_lyxrc.dpi) {
1724 os << "\\screen_dpi " << dpi << '\n';
1729 case RC_SCREEN_ZOOM:
1730 if (ignore_system_lyxrc ||
1731 defaultZoom != system_lyxrc.defaultZoom) {
1732 os << "\\screen_zoom " << defaultZoom << '\n';
1737 case RC_GEOMETRY_SESSION:
1738 if (ignore_system_lyxrc ||
1739 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1740 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1746 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1747 if (ignore_system_lyxrc ||
1748 cursor_follows_scrollbar
1749 != system_lyxrc.cursor_follows_scrollbar) {
1750 os << "\\cursor_follows_scrollbar "
1751 << convert<string>(cursor_follows_scrollbar) << '\n';
1756 case RC_CURSOR_WIDTH:
1757 if (ignore_system_lyxrc ||
1759 != system_lyxrc.cursor_width) {
1760 os << "\\cursor_width "
1761 << cursor_width << '\n';
1766 case RC_SCROLL_BELOW_DOCUMENT:
1767 if (ignore_system_lyxrc ||
1768 scroll_below_document
1769 != system_lyxrc.scroll_below_document) {
1770 os << "\\scroll_below_document "
1771 << convert<string>(scroll_below_document) << '\n';
1776 case RC_PARAGRAPH_MARKERS:
1777 if (ignore_system_lyxrc ||
1779 != system_lyxrc.paragraph_markers) {
1780 os << "\\paragraph_markers "
1781 << convert<string>(paragraph_markers) << '\n';
1786 case RC_MAC_DONTSWAP_CTRL_META:
1787 if (ignore_system_lyxrc ||
1788 mac_dontswap_ctrl_meta
1789 != system_lyxrc.mac_dontswap_ctrl_meta) {
1790 os << "\\mac_dontswap_ctrl_meta "
1791 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1796 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1797 if (ignore_system_lyxrc ||
1798 mac_like_cursor_movement
1799 != system_lyxrc.mac_like_cursor_movement) {
1800 os << "\\mac_like_cursor_movement "
1801 << convert<string>(mac_like_cursor_movement) << '\n';
1806 case RC_MACRO_EDIT_STYLE:
1807 if (ignore_system_lyxrc ||
1809 != system_lyxrc.macro_edit_style) {
1810 os << "\\macro_edit_style ";
1811 switch (macro_edit_style) {
1812 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1813 case MACRO_EDIT_INLINE: os << "1\n"; break;
1814 case MACRO_EDIT_LIST: os << "2\n"; break;
1820 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1821 if (ignore_system_lyxrc ||
1822 dialogs_iconify_with_main
1823 != system_lyxrc.dialogs_iconify_with_main) {
1824 os << "\\dialogs_iconify_with_main "
1825 << convert<string>(dialogs_iconify_with_main) << '\n';
1830 case RC_SCREEN_FONT_ROMAN:
1831 if (ignore_system_lyxrc ||
1832 roman_font_name != system_lyxrc.roman_font_name) {
1833 os << "\\screen_font_roman \"" << roman_font_name
1839 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1840 if (ignore_system_lyxrc ||
1841 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1842 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1848 case RC_SCREEN_FONT_SANS:
1849 if (ignore_system_lyxrc ||
1850 sans_font_name != system_lyxrc.sans_font_name) {
1851 os << "\\screen_font_sans \"" << sans_font_name
1857 case RC_SCREEN_FONT_SANS_FOUNDRY:
1858 if (ignore_system_lyxrc ||
1859 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1860 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1866 case RC_SCREEN_FONT_TYPEWRITER:
1867 if (ignore_system_lyxrc ||
1868 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1869 os << "\\screen_font_typewriter \""
1870 << typewriter_font_name << "\"\n";
1875 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1876 if (ignore_system_lyxrc ||
1877 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1878 os << "\\screen_font_typewriter_foundry \""
1879 << typewriter_font_foundry << "\"\n";
1884 case RC_SCREEN_FONT_SCALABLE:
1885 if (ignore_system_lyxrc ||
1886 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1887 os << "\\screen_font_scalable "
1888 << convert<string>(use_scalable_fonts)
1894 case RC_SCREEN_FONT_SIZES:
1895 if (ignore_system_lyxrc ||
1896 font_sizes[FONT_SIZE_TINY]
1897 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1898 font_sizes[FONT_SIZE_SCRIPT]
1899 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1900 font_sizes[FONT_SIZE_FOOTNOTE]
1901 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1902 font_sizes[FONT_SIZE_SMALL]
1903 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1904 font_sizes[FONT_SIZE_NORMAL]
1905 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1906 font_sizes[FONT_SIZE_LARGE]
1907 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1908 font_sizes[FONT_SIZE_LARGER]
1909 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1910 font_sizes[FONT_SIZE_LARGEST]
1911 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1912 font_sizes[FONT_SIZE_HUGE]
1913 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1914 font_sizes[FONT_SIZE_HUGER]
1915 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1916 streamsize old_prec = os.precision();
1917 os.setf(ios::fixed);
1919 os << "\\screen_font_sizes"
1920 << ' ' << font_sizes[FONT_SIZE_TINY]
1921 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1922 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1923 << ' ' << font_sizes[FONT_SIZE_SMALL]
1924 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1925 << ' ' << font_sizes[FONT_SIZE_LARGE]
1926 << ' ' << font_sizes[FONT_SIZE_LARGER]
1927 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1928 << ' ' << font_sizes[FONT_SIZE_HUGE]
1929 << ' ' << font_sizes[FONT_SIZE_HUGER]
1931 os.precision(old_prec);
1932 os.unsetf(ios::fixed);
1937 case RC_FULL_SCREEN_LIMIT:
1938 if (ignore_system_lyxrc ||
1939 full_screen_limit != system_lyxrc.full_screen_limit) {
1940 os << "\\fullscreen_limit "
1941 << convert<string>(full_screen_limit)
1947 case RC_FULL_SCREEN_TOOLBARS:
1948 if (ignore_system_lyxrc ||
1949 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1950 os << "\\fullscreen_toolbars "
1951 << convert<string>(full_screen_toolbars)
1957 case RC_FULL_SCREEN_SCROLLBAR:
1958 if (ignore_system_lyxrc ||
1959 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1960 os << "\\fullscreen_scrollbar "
1961 << convert<string>(full_screen_scrollbar)
1967 case RC_FULL_SCREEN_STATUSBAR:
1968 if (ignore_system_lyxrc ||
1969 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1970 os << "\\fullscreen_statusbar "
1971 << convert<string>(full_screen_statusbar)
1977 case RC_FULL_SCREEN_TABBAR:
1978 if (ignore_system_lyxrc ||
1979 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1980 os << "\\fullscreen_tabbar "
1981 << convert<string>(full_screen_tabbar)
1987 case RC_FULL_SCREEN_MENUBAR:
1988 if (ignore_system_lyxrc ||
1989 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1990 os << "\\fullscreen_menubar "
1991 << convert<string>(full_screen_menubar)
1997 case RC_FULL_SCREEN_WIDTH:
1998 if (ignore_system_lyxrc ||
1999 full_screen_width != system_lyxrc.full_screen_width) {
2000 os << "\\fullscreen_width "
2001 << convert<string>(full_screen_width)
2007 case RC_OPEN_BUFFERS_IN_TABS:
2008 if (ignore_system_lyxrc ||
2009 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2010 os << "\\open_buffers_in_tabs "
2011 << convert<string>(open_buffers_in_tabs)
2017 case RC_SINGLE_CLOSE_TAB_BUTTON:
2018 if (ignore_system_lyxrc ||
2019 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2020 os << "\\single_close_tab_button "
2021 << convert<string>(single_close_tab_button)
2027 case RC_SINGLE_INSTANCE:
2028 if (ignore_system_lyxrc ||
2029 single_instance != system_lyxrc.single_instance) {
2030 os << "\\single_instance "
2031 << convert<string>(single_instance)
2037 case RC_FORWARD_SEARCH_DVI:
2038 if (ignore_system_lyxrc ||
2039 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2040 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2045 case RC_FORWARD_SEARCH_PDF:
2046 if (ignore_system_lyxrc ||
2047 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2048 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2054 << "# COLOR SECTION ###################################\n"
2059 for (int i = 0; i < Color_ignore; ++i) {
2060 ColorCode lc = static_cast<ColorCode>(i);
2061 string const col = lcolor.getX11Name(lc);
2062 if (ignore_system_lyxrc
2063 || col != system_lcolor.getX11Name(lc)) {
2064 os << "\\set_color \""
2065 << lcolor.getLyXName(lc) << "\" \""
2073 << "# PRINTER SECTION ###################################\n"
2077 case RC_PRINTLANDSCAPEFLAG:
2078 if (ignore_system_lyxrc ||
2079 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2080 os << "\\print_landscape_flag \"" << print_landscape_flag
2086 case RC_PRINTPAPERFLAG:
2087 if (ignore_system_lyxrc ||
2088 print_paper_flag != system_lyxrc.print_paper_flag) {
2089 os << "\\print_paper_flag \"" << print_paper_flag
2095 case RC_PRINTPAPERDIMENSIONFLAG:
2096 if (ignore_system_lyxrc ||
2097 print_paper_dimension_flag
2098 != system_lyxrc.print_paper_dimension_flag) {
2099 os << "\\print_paper_dimension_flag \""
2100 << print_paper_dimension_flag << "\"\n";
2106 << "# TEX SECTION #######################################\n"
2110 case RC_TEXINPUTS_PREFIX:
2111 if (ignore_system_lyxrc ||
2112 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2113 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2119 << "# FILE SECTION ######################################\n"
2122 case RC_DOCUMENTPATH:
2123 if (ignore_system_lyxrc ||
2124 document_path != system_lyxrc.document_path) {
2125 string const path = os::external_path(document_path);
2126 os << "\\document_path \"" << path << "\"\n";
2131 case RC_USELASTFILEPOS:
2132 if (ignore_system_lyxrc ||
2133 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2134 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2140 case RC_LOADSESSION:
2141 if (ignore_system_lyxrc ||
2142 load_session != system_lyxrc.load_session) {
2143 os << "\\load_session " << convert<string>(load_session)
2149 case RC_MOUSE_WHEEL_SPEED:
2150 if (ignore_system_lyxrc ||
2151 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2152 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2157 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2158 if (ignore_system_lyxrc ||
2159 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2160 os << "\\mouse_middlebutton_paste "
2161 << convert<string>(mouse_middlebutton_paste) << '\n';
2166 case RC_COMPLETION_INLINE_DELAY:
2167 if (ignore_system_lyxrc ||
2168 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2169 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2174 case RC_COMPLETION_INLINE_MATH:
2175 if (ignore_system_lyxrc ||
2176 completion_inline_math != system_lyxrc.completion_inline_math) {
2177 os << "\\completion_inline_math "
2178 << convert<string>(completion_inline_math) << '\n';
2183 case RC_COMPLETION_INLINE_TEXT:
2184 if (ignore_system_lyxrc ||
2185 completion_inline_text != system_lyxrc.completion_inline_text) {
2186 os << "\\completion_inline_text "
2187 << convert<string>(completion_inline_text) << '\n';
2192 case RC_COMPLETION_INLINE_DOTS:
2193 if (ignore_system_lyxrc ||
2194 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2195 os << "\\completion_inline_dots "
2196 << convert<string>(completion_inline_dots) << '\n';
2201 case RC_AUTOCORRECTION_MATH:
2202 if (ignore_system_lyxrc ||
2203 autocorrection_math != system_lyxrc.autocorrection_math) {
2204 os << "\\autocorrection_math "
2205 << convert<string>(autocorrection_math) << '\n';
2210 case RC_COMPLETION_POPUP_DELAY:
2211 if (ignore_system_lyxrc ||
2212 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2213 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2218 case RC_COMPLETION_POPUP_MATH:
2219 if (ignore_system_lyxrc ||
2220 completion_popup_math != system_lyxrc.completion_popup_math) {
2221 os << "\\completion_popup_math "
2222 << convert<string>(completion_popup_math) << '\n';
2227 case RC_COMPLETION_POPUP_TEXT:
2228 if (ignore_system_lyxrc ||
2229 completion_popup_text != system_lyxrc.completion_popup_text) {
2230 os << "\\completion_popup_text "
2231 << convert<string>(completion_popup_text) << '\n';
2236 case RC_COMPLETION_CURSOR_TEXT:
2237 if (ignore_system_lyxrc ||
2238 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2239 os << "\\completion_cursor_text "
2240 << convert<string>(completion_cursor_text) << '\n';
2245 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2246 if (ignore_system_lyxrc ||
2247 completion_popup_after_complete
2248 != system_lyxrc.completion_popup_after_complete) {
2249 os << "\\completion_popup_after_complete "
2250 << convert<string>(completion_popup_after_complete) << '\n';
2255 case RC_COMPLETION_MINLENGTH:
2256 if (ignore_system_lyxrc ||
2257 completion_minlength != system_lyxrc.completion_minlength) {
2258 os << "\\completion_minlength " << convert<string>(completion_minlength)
2264 case RC_NUMLASTFILES:
2265 if (ignore_system_lyxrc ||
2266 num_lastfiles != system_lyxrc.num_lastfiles) {
2267 os << "\\num_lastfiles " << num_lastfiles << '\n';
2272 case RC_CHECKLASTFILES:
2273 if (ignore_system_lyxrc ||
2274 check_lastfiles != system_lyxrc.check_lastfiles) {
2275 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2281 case RC_EXAMPLEPATH:
2282 if (ignore_system_lyxrc ||
2283 example_path != system_lyxrc.example_path) {
2284 string const path = os::external_path(example_path);
2285 os << "\\example_path \"" << path << "\"\n";
2290 case RC_TEMPLATEPATH:
2291 if (ignore_system_lyxrc ||
2292 template_path != system_lyxrc.template_path) {
2293 string const path = os::external_path(template_path);
2294 os << "\\template_path \"" << path << "\"\n";
2299 case RC_TEMPDIRPATH:
2300 if (ignore_system_lyxrc ||
2301 tempdir_path != system_lyxrc.tempdir_path) {
2302 string const path = os::external_path(tempdir_path);
2303 os << "\\tempdir_path \"" << path << "\"\n";
2308 case RC_THESAURUSDIRPATH:
2309 if (ignore_system_lyxrc ||
2310 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2311 string const path = os::external_path(thesaurusdir_path);
2312 os << "\\thesaurusdir_path \"" << path << "\"\n";
2317 case RC_HUNSPELLDIR_PATH:
2318 if (ignore_system_lyxrc ||
2319 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2320 string const path = os::external_path(hunspelldir_path);
2321 os << "\\hunspelldir_path \"" << path << "\"\n";
2326 case RC_PLAINTEXT_LINELEN:
2327 if (ignore_system_lyxrc ||
2328 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2329 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2334 case RC_MAKE_BACKUP:
2335 if (ignore_system_lyxrc ||
2336 make_backup != system_lyxrc.make_backup) {
2337 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2342 case RC_SAVE_COMPRESSED:
2343 if (ignore_system_lyxrc ||
2344 save_compressed != system_lyxrc.save_compressed) {
2345 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2350 case RC_SAVE_ORIGIN:
2351 if (ignore_system_lyxrc ||
2352 save_origin != system_lyxrc.save_origin) {
2353 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2358 case RC_BACKUPDIR_PATH:
2359 if (ignore_system_lyxrc ||
2360 backupdir_path != system_lyxrc.backupdir_path) {
2361 string const path = os::external_path(backupdir_path);
2362 os << "\\backupdir_path \"" << path << "\"\n";
2368 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2372 << "# SPELLCHECKER SECTION ##############################\n"
2376 case RC_ACCEPT_COMPOUND:
2377 if (ignore_system_lyxrc ||
2378 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2379 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2386 if (ignore_system_lyxrc ||
2387 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2388 os << "\\alternate_language \"" << spellchecker_alt_lang
2395 if (ignore_system_lyxrc ||
2396 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2397 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2402 case RC_USE_NATIVE_FILEDIALOG:
2403 if (ignore_system_lyxrc ||
2404 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2405 os << "\\use_native_filedialog "
2406 << convert<string>(use_native_filedialog)
2412 case RC_USE_SYSTEM_COLORS:
2413 if (ignore_system_lyxrc ||
2414 use_system_colors != system_lyxrc.use_system_colors) {
2415 os << "\\use_system_colors "
2416 << convert<string>(use_system_colors)
2422 case RC_USE_TOOLTIP:
2423 if (ignore_system_lyxrc ||
2424 use_tooltip != system_lyxrc.use_tooltip) {
2425 os << "\\use_tooltip "
2426 << convert<string>(use_tooltip)
2432 case RC_USE_PIXMAP_CACHE:
2433 if (ignore_system_lyxrc ||
2434 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2435 os << "\\use_pixmap_cache "
2436 << convert<string>(use_pixmap_cache)
2444 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2448 case RC_DEFAULT_DECIMAL_POINT:
2449 if (ignore_system_lyxrc ||
2450 default_decimal_point != system_lyxrc.default_decimal_point) {
2451 os << "\\default_decimal_point " << default_decimal_point << '\n';
2456 case RC_DEFAULT_LENGTH_UNIT:
2457 if (ignore_system_lyxrc ||
2458 default_length_unit != system_lyxrc.default_length_unit) {
2459 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2464 case RC_SPELLCHECKER:
2465 if (ignore_system_lyxrc ||
2466 spellchecker != system_lyxrc.spellchecker) {
2467 os << "\\spellchecker " << spellchecker << '\n';
2472 case RC_SPELLCHECK_CONTINUOUSLY:
2473 if (ignore_system_lyxrc ||
2474 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2475 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2481 case RC_SPELLCHECK_NOTES:
2482 if (ignore_system_lyxrc ||
2483 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2484 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2490 case RC_VISUAL_CURSOR:
2491 if (ignore_system_lyxrc ||
2492 visual_cursor != system_lyxrc.visual_cursor) {
2493 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2498 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2499 if (ignore_system_lyxrc ||
2500 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2501 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2502 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2507 case RC_LANGUAGE_CUSTOM_PACKAGE:
2508 if (ignore_system_lyxrc ||
2509 language_custom_package != system_lyxrc.language_custom_package) {
2510 os << "\\language_custom_package \"" << language_custom_package
2516 case RC_LANGUAGE_GLOBAL_OPTIONS:
2517 if (ignore_system_lyxrc ||
2518 language_global_options
2519 != system_lyxrc.language_global_options) {
2520 os << "\\language_global_options \""
2521 << convert<string>(language_global_options)
2527 case RC_LANGUAGE_PACKAGE_SELECTION:
2528 if (ignore_system_lyxrc ||
2529 language_package_selection != system_lyxrc.language_package_selection) {
2530 os << "\\language_package_selection ";
2531 switch (language_package_selection) {
2549 case RC_LANGUAGE_COMMAND_BEGIN:
2550 if (ignore_system_lyxrc ||
2551 language_command_begin
2552 != system_lyxrc.language_command_begin) {
2553 os << "\\language_command_begin \""
2554 << language_command_begin
2560 case RC_LANGUAGE_COMMAND_END:
2561 if (ignore_system_lyxrc ||
2562 language_command_end
2563 != system_lyxrc.language_command_end) {
2564 os << "\\language_command_end \"" << language_command_end
2570 case RC_LANGUAGE_COMMAND_LOCAL:
2571 if (ignore_system_lyxrc ||
2572 language_command_local
2573 != system_lyxrc.language_command_local) {
2574 os << "\\language_command_local \""
2575 << language_command_local
2581 case RC_LANGUAGE_AUTO_BEGIN:
2582 if (ignore_system_lyxrc ||
2583 language_auto_begin != system_lyxrc.language_auto_begin) {
2584 os << "\\language_auto_begin "
2585 << convert<string>(language_auto_begin) << '\n';
2590 case RC_LANGUAGE_AUTO_END:
2591 if (ignore_system_lyxrc ||
2592 language_auto_end != system_lyxrc.language_auto_end) {
2593 os << "\\language_auto_end "
2594 << convert<string>(language_auto_end) << '\n';
2599 case RC_MARK_FOREIGN_LANGUAGE:
2600 if (ignore_system_lyxrc ||
2601 mark_foreign_language
2602 != system_lyxrc.mark_foreign_language) {
2603 os << "\\mark_foreign_language " <<
2604 convert<string>(mark_foreign_language) << '\n';
2610 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2614 case RC_AUTO_NUMBER:
2615 if (ignore_system_lyxrc ||
2616 auto_number != system_lyxrc.auto_number) {
2617 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2622 case RC_GUI_LANGUAGE:
2623 if (ignore_system_lyxrc ||
2624 gui_language != system_lyxrc.gui_language) {
2625 os << "\\gui_language " << gui_language << '\n';
2630 case RC_EXPORT_OVERWRITE:
2631 if (ignore_system_lyxrc ||
2632 export_overwrite != system_lyxrc.export_overwrite) {
2634 switch (export_overwrite) {
2645 os << "\\export_overwrite " << status << '\n';
2650 case RC_SCROLL_WHEEL_ZOOM:
2651 if (ignore_system_lyxrc ||
2652 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2654 switch (scroll_wheel_zoom) {
2655 case SCROLL_WHEEL_ZOOM_OFF:
2658 case SCROLL_WHEEL_ZOOM_CTRL:
2661 case SCROLL_WHEEL_ZOOM_SHIFT:
2664 case SCROLL_WHEEL_ZOOM_ALT:
2668 os << "\\scroll_wheel_zoom " << status << '\n';
2674 << "# FORMATS SECTION ##########################\n"
2679 // New/modified formats
2680 for (Formats::const_iterator cit = theFormats().begin();
2681 cit != theFormats().end(); ++cit) {
2682 Format const * format =
2683 theSystemFormats().getFormat(cit->name());
2685 format->extensions() != cit->extensions() ||
2686 format->prettyname() != cit->prettyname() ||
2687 format->shortcut() != cit->shortcut() ||
2688 format->viewer() != cit->viewer() ||
2689 format->editor() != cit->editor() ||
2690 format->documentFormat() != cit->documentFormat() ||
2691 format->vectorFormat() != cit->vectorFormat() ||
2692 format->inExportMenu() != cit->inExportMenu() ||
2693 format->mime() != cit->mime()) {
2694 os << "\\format \"" << cit->name() << "\" \""
2695 << cit->extensions() << "\" \""
2696 << to_utf8(cit->prettyname()) << "\" \""
2697 << cit->shortcut() << "\" \""
2698 << escapeCommand(cit->viewer()) << "\" \""
2699 << escapeCommand(cit->editor()) << "\" \"";
2700 vector<string> flags;
2701 if (cit->documentFormat())
2702 flags.push_back("document");
2703 if (cit->vectorFormat())
2704 flags.push_back("vector");
2705 if (cit->zippedNative())
2706 flags.push_back("zipped=native");
2707 if (cit->inExportMenu())
2708 flags.push_back("menu=export");
2710 os << getStringFromVector(flags);
2711 os << "\" \"" << cit->mime() << "\"\n";
2715 // Look for deleted formats
2716 for (Formats::const_iterator cit = theSystemFormats().begin();
2717 cit != theSystemFormats().end(); ++cit)
2718 if (!theFormats().getFormat(cit->name()))
2719 os << "\\format \"" << cit->name()
2720 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2724 case RC_VIEWER_ALTERNATIVES: {
2725 Alternatives::const_iterator it = viewer_alternatives.begin();
2726 Alternatives::const_iterator const en = viewer_alternatives.end();
2727 Alternatives::const_iterator const sysend =
2728 system_lyxrc.viewer_alternatives.end();
2729 for (; it != en; ++it) {
2730 string const & fmt = it->first;
2731 CommandSet const & cmd = it->second;
2732 CommandSet::const_iterator sit = cmd.begin();
2733 CommandSet::const_iterator const sen = cmd.end();
2734 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2735 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2736 system_lyxrc.viewer_alternatives.find(fmt);
2737 for (; sit != sen; ++sit) {
2738 string const & cmd = *sit;
2739 if (ignore_system_lyxrc
2740 || sysfmt == sysend // format not found
2741 || sysfmt->second.count(cmd) == 0 // this command not found
2743 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2750 case RC_EDITOR_ALTERNATIVES: {
2751 Alternatives::const_iterator it = editor_alternatives.begin();
2752 Alternatives::const_iterator const en = editor_alternatives.end();
2753 Alternatives::const_iterator const sysend =
2754 system_lyxrc.editor_alternatives.end();
2755 for (; it != en; ++it) {
2756 string const & fmt = it->first;
2757 CommandSet const & cmd = it->second;
2758 CommandSet::const_iterator sit = cmd.begin();
2759 CommandSet::const_iterator const sen = cmd.end();
2760 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2761 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2762 system_lyxrc.editor_alternatives.find(fmt);
2763 for (; sit != sen; ++sit) {
2764 string const & cmd = *sit;
2765 if (ignore_system_lyxrc
2766 || sysfmt == sysend // format not found
2767 || sysfmt->second.count(cmd) == 0 // this command not found
2769 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2776 case RC_DEFAULT_OTF_VIEW_FORMAT:
2777 if ((ignore_system_lyxrc ||
2778 default_otf_view_format != system_lyxrc.default_otf_view_format)
2779 && !default_otf_view_format.empty()) {
2780 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2785 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2786 if ((ignore_system_lyxrc ||
2787 default_platex_view_format != system_lyxrc.default_platex_view_format)
2788 && !default_platex_view_format.empty()) {
2789 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2794 case RC_DEFAULT_VIEW_FORMAT:
2795 if (ignore_system_lyxrc ||
2796 default_view_format != system_lyxrc.default_view_format) {
2797 os << "\\default_view_format " << default_view_format << '\n';
2808 << "# CONVERTERS SECTION ##########################\n"
2813 // Look for new converters
2814 for (Converters::const_iterator cit = theConverters().begin();
2815 cit != theConverters().end(); ++cit) {
2816 Converter const * converter =
2817 theSystemConverters().getConverter(cit->from(),
2820 converter->command() != cit->command() ||
2821 converter->flags() != cit->flags())
2822 os << "\\converter \"" << cit->from() << "\" \""
2823 << cit->to() << "\" \""
2824 << escapeCommand(cit->command()) << "\" \""
2825 << cit->flags() << "\"\n";
2828 // New/modifed converters
2829 for (Converters::const_iterator cit = theSystemConverters().begin();
2830 cit != theSystemConverters().end(); ++cit)
2831 if (!theConverters().getConverter(cit->from(), cit->to()))
2832 os << "\\converter \"" << cit->from()
2833 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2840 << "# COPIERS SECTION ##########################\n"
2843 // Look for new movers
2844 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2845 Movers::const_iterator const sysend = theSystemMovers().end();
2846 Movers::const_iterator it = theMovers().begin();
2847 Movers::const_iterator end = theMovers().end();
2849 for (; it != end; ++it) {
2850 Movers::const_iterator const sysit =
2851 find_if(sysbegin, sysend, SameMover(*it));
2852 if (sysit == sysend) {
2853 string const & fmt = it->first;
2854 string const & command =
2855 it->second.command();
2857 os << "\\copier " << fmt
2858 << " \"" << escapeCommand(command) << "\"\n";
2864 // We don't actually delete SpecialisedMover(s) from the
2865 // map, just clear their 'command', so there's no need
2866 // to test for anything else.
2873 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2875 // Why the switch you might ask. It is a trick to ensure that all
2876 // the elements in the LyXRCTags enum is handled. As you can see
2877 // there are no breaks at all. So it is just a huge fall-through.
2878 // The nice thing is that we will get a warning from the compiler
2879 // if we forget an element.
2880 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2882 case LyXRC::RC_LAST:
2883 case LyXRC::RC_ACCEPT_COMPOUND:
2884 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2885 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2887 case LyXRC::RC_ALT_LANG:
2888 case LyXRC::RC_PLAINTEXT_LINELEN:
2889 case LyXRC::RC_AUTOCORRECTION_MATH:
2890 case LyXRC::RC_AUTOREGIONDELETE:
2891 case LyXRC::RC_AUTORESET_OPTIONS:
2892 case LyXRC::RC_AUTOSAVE:
2893 case LyXRC::RC_AUTO_NUMBER:
2894 case LyXRC::RC_BACKUPDIR_PATH:
2895 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2896 case LyXRC::RC_BIBTEX_COMMAND:
2897 case LyXRC::RC_BINDFILE:
2898 case LyXRC::RC_CHECKLASTFILES:
2899 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2900 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2901 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2902 case LyXRC::RC_COMPLETION_INLINE_MATH:
2903 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2904 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2905 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2906 case LyXRC::RC_COMPLETION_POPUP_MATH:
2907 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2908 case LyXRC::RC_COMPLETION_MINLENGTH:
2909 case LyXRC::RC_USELASTFILEPOS:
2910 case LyXRC::RC_LOADSESSION:
2911 case LyXRC::RC_CHKTEX_COMMAND:
2912 case LyXRC::RC_CONVERTER:
2913 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2914 case LyXRC::RC_COPIER:
2915 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2916 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2917 case LyXRC::RC_DATE_INSERT_FORMAT:
2918 case LyXRC::RC_GUI_LANGUAGE:
2919 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2920 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2921 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2922 case LyXRC::RC_DEFFILE:
2923 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2924 case LyXRC::RC_DISPLAY_GRAPHICS:
2925 case LyXRC::RC_DOCUMENTPATH:
2926 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2927 FileName path(lyxrc_new.document_path);
2928 if (path.exists() && path.isDirectory())
2929 package().document_dir() = FileName(lyxrc.document_path);
2932 case LyXRC::RC_EDITOR_ALTERNATIVES:
2933 case LyXRC::RC_ESC_CHARS:
2934 case LyXRC::RC_EXAMPLEPATH:
2935 case LyXRC::RC_FILEFORMAT:
2936 case LyXRC::RC_GROUP_LAYOUTS:
2937 case LyXRC::RC_HUNSPELLDIR_PATH:
2938 case LyXRC::RC_ICON_SET:
2939 case LyXRC::RC_INDEX_ALTERNATIVES:
2940 case LyXRC::RC_INDEX_COMMAND:
2941 case LyXRC::RC_JBIBTEX_COMMAND:
2942 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2943 case LyXRC::RC_JINDEX_COMMAND:
2944 case LyXRC::RC_NOMENCL_COMMAND:
2945 case LyXRC::RC_PYGMENTIZE_COMMAND:
2946 case LyXRC::RC_INPUT:
2947 case LyXRC::RC_KBMAP:
2948 case LyXRC::RC_KBMAP_PRIMARY:
2949 case LyXRC::RC_KBMAP_SECONDARY:
2950 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2951 case LyXRC::RC_LANGUAGE_AUTO_END:
2952 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2953 case LyXRC::RC_LANGUAGE_COMMAND_END:
2954 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2955 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2956 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2957 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2958 case LyXRC::RC_LYXRCFORMAT:
2959 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2960 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2961 case LyXRC::RC_MACRO_EDIT_STYLE:
2962 case LyXRC::RC_MAKE_BACKUP:
2963 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2964 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2965 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2966 case LyXRC::RC_NUMLASTFILES:
2967 case LyXRC::RC_PARAGRAPH_MARKERS:
2968 case LyXRC::RC_PATH_PREFIX:
2969 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2970 prependEnvPath("PATH", lyxrc_new.path_prefix);
2971 // Resets python path
2972 support::os::python(true);
2975 case LyXRC::RC_PREVIEW:
2976 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2977 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2978 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2979 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2980 case LyXRC::RC_PRINTPAPERFLAG:
2981 case LyXRC::RC_SAVE_COMPRESSED:
2982 case LyXRC::RC_SAVE_ORIGIN:
2983 case LyXRC::RC_SCREEN_DPI:
2984 case LyXRC::RC_SCREEN_FONT_ROMAN:
2985 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2986 case LyXRC::RC_SCREEN_FONT_SANS:
2987 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2988 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2989 case LyXRC::RC_SCREEN_FONT_SIZES:
2990 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2991 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2992 case LyXRC::RC_GEOMETRY_SESSION:
2993 case LyXRC::RC_SCREEN_ZOOM:
2994 case LyXRC::RC_SERVERPIPE:
2995 case LyXRC::RC_SET_COLOR:
2996 case LyXRC::RC_SHOW_BANNER:
2997 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2998 case LyXRC::RC_SPELLCHECKER:
2999 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3002 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3003 case LyXRC::RC_SPELLCHECK_NOTES:
3004 case LyXRC::RC_SPLITINDEX_COMMAND:
3005 case LyXRC::RC_TEMPDIRPATH:
3006 case LyXRC::RC_TEMPLATEPATH:
3007 case LyXRC::RC_TEX_ALLOWS_SPACES:
3008 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3009 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3010 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3013 case LyXRC::RC_TEXINPUTS_PREFIX:
3014 case LyXRC::RC_THESAURUSDIRPATH:
3015 case LyXRC::RC_UIFILE:
3016 case LyXRC::RC_USER_EMAIL:
3017 case LyXRC::RC_USER_NAME:
3018 case LyXRC::RC_USE_CONVERTER_CACHE:
3019 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
3020 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
3021 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
3022 case LyXRC::RC_USE_SYSTEM_COLORS:
3023 case LyXRC::RC_USE_TOOLTIP:
3024 case LyXRC::RC_USE_PIXMAP_CACHE:
3025 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3026 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3027 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3028 case LyXRC::RC_SINGLE_INSTANCE:
3029 case LyXRC::RC_SORT_LAYOUTS:
3030 case LyXRC::RC_FULL_SCREEN_LIMIT:
3031 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3032 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3033 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3034 case LyXRC::RC_FULL_SCREEN_TABBAR:
3035 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3036 case LyXRC::RC_FULL_SCREEN_WIDTH:
3037 case LyXRC::RC_VISUAL_CURSOR:
3038 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3039 case LyXRC::RC_VIEWER:
3040 case LyXRC::RC_VIEWER_ALTERNATIVES:
3041 case LyXRC::RC_FORWARD_SEARCH_DVI:
3042 case LyXRC::RC_FORWARD_SEARCH_PDF:
3043 case LyXRC::RC_EXPORT_OVERWRITE:
3044 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3045 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3046 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3047 case LyXRC::RC_CURSOR_WIDTH:
3054 string const LyXRC::getDescription(LyXRCTags tag)
3059 case RC_ACCEPT_COMPOUND:
3060 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3064 str = _("Specify an alternate language. The default is to use the language of the document.");
3067 case RC_PLAINTEXT_LINELEN:
3068 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.");
3071 case RC_AUTOREGIONDELETE:
3072 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3075 case RC_AUTORESET_OPTIONS:
3076 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3080 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3083 case RC_AUTO_NUMBER:
3086 case RC_BACKUPDIR_PATH:
3087 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.");
3090 case RC_BIBTEX_COMMAND:
3091 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3094 case RC_JBIBTEX_COMMAND:
3095 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3099 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3102 case RC_CHECKLASTFILES:
3103 str = _("Select to check whether the lastfiles still exist.");
3106 case RC_CHKTEX_COMMAND:
3107 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3113 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3114 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3117 case RC_CONVERTER_NEEDAUTH:
3118 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3124 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3125 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.");
3128 case RC_CURSOR_WIDTH:
3129 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3132 case RC_SCROLL_BELOW_DOCUMENT:
3133 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");
3136 case RC_MAC_DONTSWAP_CTRL_META:
3137 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3140 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3141 str = _("Use the Mac OS X conventions for cursor movement");
3144 case RC_SHOW_MACRO_LABEL:
3145 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3148 case RC_DATE_INSERT_FORMAT:
3149 //xgettext:no-c-format
3150 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3154 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3157 case RC_DEFAULT_OTF_VIEW_FORMAT:
3158 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3161 case RC_DEFAULT_VIEW_FORMAT:
3162 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3165 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3166 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3169 case RC_DISPLAY_GRAPHICS:
3170 str = _("Select how LyX will display any graphics.");
3173 case RC_DOCUMENTPATH:
3174 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3178 str = _("Specify additional chars that can be part of a word.");
3181 case RC_EXAMPLEPATH:
3182 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
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)