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