3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
21 #include "BufferList.h"
23 #include "Converter.h"
24 #include "FontEnums.h"
30 #include "SpellChecker.h"
33 #include "graphics/GraphicsTypes.h"
35 #include "support/convert.h"
36 #include "support/debug.h"
37 #include "support/environment.h"
38 #include "support/FileName.h"
39 #include "support/filetools.h"
40 #include "support/gettext.h"
41 #include "support/lstrings.h"
42 #include "support/os.h"
43 #include "support/Package.h"
44 #include "support/TempFile.h"
45 #include "support/userinfo.h"
52 using namespace lyx::support;
56 namespace os = support::os;
60 // The format should also be updated in configure.py, and conversion code
61 // should be added to prefs2prefs_prefs.py.
62 static unsigned int const LYXRC_FILEFORMAT = 24; // spitz: rename collapsible
64 // when adding something to this array keep it sorted!
65 LexerKeyword lyxrcTags[] = {
66 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
67 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
68 { "\\alternate_language", LyXRC::RC_ALT_LANG },
69 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
70 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
71 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
72 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
73 { "\\autosave", LyXRC::RC_AUTOSAVE },
74 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
75 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
76 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
77 { "\\bind_file", LyXRC::RC_BINDFILE },
78 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
79 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
80 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
81 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
82 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
83 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
84 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
85 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
86 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
87 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
88 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
89 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
90 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
91 { "\\converter", LyXRC::RC_CONVERTER },
92 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
93 { "\\copier", LyXRC::RC_COPIER },
94 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
95 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
96 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
97 { "\\def_file", LyXRC::RC_DEFFILE },
98 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
99 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
100 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
101 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
102 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
103 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
104 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
105 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
106 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
107 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
108 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
109 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
110 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
111 { "\\format", LyXRC::RC_FILEFORMAT },
112 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
113 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
114 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
115 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
116 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
117 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
118 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
119 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
120 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
121 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
122 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
123 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
124 { "\\icon_set", LyXRC::RC_ICON_SET },
125 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
126 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
127 { "\\input", LyXRC::RC_INPUT },
128 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
129 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
130 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
131 { "\\kbmap", LyXRC::RC_KBMAP },
132 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
133 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
134 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
135 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
136 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
137 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
138 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
139 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
140 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
141 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
142 { "\\load_session", LyXRC::RC_LOADSESSION },
143 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
144 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
145 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
146 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
147 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
148 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
149 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
150 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
151 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
152 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
153 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
154 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
155 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
156 { "\\preview", LyXRC::RC_PREVIEW },
157 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
158 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
159 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
160 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
161 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
162 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
163 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
164 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
165 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
166 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
167 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
168 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
169 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
170 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
171 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
172 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
173 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
174 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
175 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
176 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
177 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
178 { "\\set_color", LyXRC::RC_SET_COLOR },
179 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
180 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
181 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
182 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
183 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
184 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
185 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
186 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
187 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
188 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
189 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
190 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
191 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
192 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
193 { "\\ui_file", LyXRC::RC_UIFILE },
194 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
195 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
196 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
197 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
198 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
199 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
200 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
201 // compatibility with versions older than 1.4.0 only
202 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
203 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
204 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
205 { "\\user_email", LyXRC::RC_USER_EMAIL },
206 { "\\user_name", LyXRC::RC_USER_NAME },
207 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
208 // compatibility with versions older than 1.4.0 only
209 { "\\viewer", LyXRC::RC_VIEWER},
210 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
211 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
212 { "format", LyXRC::RC_LYXRCFORMAT }
215 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
226 void LyXRC::setDefaults()
229 use_system_theme_icons = false;
231 def_file = "default";
233 // The current document directory
234 texinputs_prefix = ".";
235 print_landscape_flag = "-t landscape";
236 print_paper_flag = "-t";
237 print_paper_dimension_flag = "-T";
238 document_path.erase();
239 view_dvi_paper_option.erase();
240 default_view_format = "pdf2";
241 default_otf_view_format = "pdf4";
242 default_platex_view_format = "pdf3";
243 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
244 bibtex_command = "automatic";
246 index_command = "makeindex -c -q";
247 nomencl_command = "makeindex -s nomencl.ist";
248 pygmentize_command = string();
250 // Because a screen is typically wider than a piece of paper:
252 currentZoom = defaultZoom;
253 allow_geometry_session = true;
254 // Default LaTeX font size:
255 font_sizes[FONT_SIZE_TINY] = "5.0";
256 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
257 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
258 font_sizes[FONT_SIZE_SMALL] = "9.0";
259 font_sizes[FONT_SIZE_NORMAL] = "10.0";
260 font_sizes[FONT_SIZE_LARGE] = "12.0";
261 font_sizes[FONT_SIZE_LARGER] = "14.4";
262 font_sizes[FONT_SIZE_LARGEST] = "17.26";
263 font_sizes[FONT_SIZE_HUGE] = "20.74";
264 font_sizes[FONT_SIZE_HUGER] = "24.88";
265 use_scalable_fonts = true;
266 roman_font_name = "";
268 typewriter_font_name = "";
270 auto_region_delete = true;
271 auto_reset_options = false;
272 plaintext_linelen = 65;
273 mouse_wheel_speed = 1.0;
275 check_lastfiles = true;
276 use_lastfilepos = true;
277 use_native_filedialog = true;
278 load_session = false;
280 save_compressed = false;
282 backupdir_path.erase();
283 display_graphics = true;
284 // Spellchecker settings:
285 // FIXME: this check should test the target platform (darwin)
286 #if defined(USE_MACOSX_PACKAGING)
287 spellchecker = "native";
288 #elif defined(USE_ENCHANT)
289 spellchecker = "enchant";
290 #elif defined(USE_ASPELL)
291 spellchecker = "aspell";
292 #elif defined(USE_HUNSPELL)
293 spellchecker = "hunspell";
295 spellchecker = "aspell";
297 spellchecker_accept_compound = false;
298 spellcheck_continuously = false;
299 completion_minlength = 6;
300 spellcheck_notes = true;
302 visual_cursor = false;
304 mark_foreign_language = true;
305 language_auto_begin = true;
306 language_auto_end = true;
307 language_global_options = true;
308 language_package_selection = LP_AUTO;
309 language_custom_package = "\\usepackage{babel}";
310 language_command_begin = "\\selectlanguage{$$lang}";
311 language_command_local = "\\foreignlanguage{$$lang}{";
312 sort_layouts = false;
313 group_layouts = true;
314 gui_language = "auto";
316 windows_style_tex_paths = false;
317 tex_allows_spaces = false;
318 date_insert_format = "%x";
319 cursor_follows_scrollbar = false;
320 scroll_below_document = false;
321 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
322 paragraph_markers = false;
323 mac_dontswap_ctrl_meta = false;
324 mac_like_cursor_movement = false;
325 macro_edit_style = MACRO_EDIT_INLINE_BOX;
326 dialogs_iconify_with_main = false;
327 preview = PREVIEW_OFF;
328 preview_hashed_labels = false;
329 preview_scale_factor = 1.0;
330 use_converter_cache = true;
331 use_converter_needauth_forbidden = true;
332 use_converter_needauth = true;
333 use_system_colors = false;
335 use_pixmap_cache = false;
337 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
338 user_name = to_utf8(support::user_name());
339 user_email = to_utf8(support::user_email());
340 open_buffers_in_tabs = true;
341 single_close_tab_button = false;
342 single_instance = true;
343 forward_search_dvi = string();
344 forward_search_pdf = string();
345 export_overwrite = NO_FILES;
347 // Fullscreen settings
348 full_screen_limit = false;
349 full_screen_toolbars = true;
350 full_screen_tabbar = true;
351 full_screen_menubar = true;
352 full_screen_statusbar = true;
353 full_screen_scrollbar = true;
354 full_screen_width = 700;
356 completion_cursor_text = true;
357 completion_popup_math = true;
358 completion_popup_text = false;
359 completion_popup_delay = 2.0;
360 completion_popup_after_complete = true;
361 autocorrection_math = false;
362 completion_inline_math = true;
363 completion_inline_text = false;
364 completion_inline_dots = -1;
365 completion_inline_delay = 0.2;
366 default_decimal_point = ".";
367 default_length_unit = Length::CM;
369 close_buffer_with_last_view = "yes";
370 mouse_middlebutton_paste = true;
376 void oldFontFormat(string & family, string & foundry)
378 if (family.empty() || family[0] != '-')
380 foundry = token(family, '-', 1);
381 family = token(family, '-', 2);
389 bool LyXRC::read(FileName const & filename, bool check_format)
391 Lexer lexrc(lyxrcTags);
392 lexrc.setFile(filename);
393 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
394 ReturnValues retval = read(lexrc, check_format);
395 if (!check_format || retval != FormatMismatch)
396 return retval == ReadOK;
398 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
399 TempFile tmp("convert_lyxrc");
400 FileName const tempfile = tmp.name();
401 bool const success = prefs2prefs(filename, tempfile, false);
403 LYXERR0 ("Unable to convert " << filename.absFileName() <<
404 " to format " << LYXRC_FILEFORMAT);
407 // Keep this in the else branch, such that lexrc2 goes out
408 // of scope and releases the lock on tempfile before we
409 // attempt to remove it. This matters on Windows.
410 Lexer lexrc2(lyxrcTags);
411 lexrc2.setFile(tempfile);
412 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
413 retval = read(lexrc2, check_format);
414 if (retval == FormatMismatch)
415 LYXERR0("Conversion failed for " << filename.absFileName());
417 return retval == ReadOK;
421 // don't need to worry about conversion, because this is always
422 // from an internal source
423 bool LyXRC::read(istream & is)
425 Lexer lexrc(lyxrcTags);
427 LYXERR(Debug::LYXRC, "Reading istream...");
428 return read(lexrc, false) == ReadOK;
432 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
434 if (lyxerr.debugging(Debug::PARSER))
435 lexrc.printTable(lyxerr);
440 // format prior to 2.0 and introduction of format tag
441 unsigned int format = 0;
443 while (lexrc.isOK()) {
444 // By using two switches we take advantage of the compiler
445 // telling us if we have missed a LyXRCTags element in
446 // the second switch.
447 // Note that this also shows a problem with Lexer since it
448 // helps us avoid taking advantage of the strictness of the
451 int le = lexrc.lex();
453 case Lexer::LEX_UNDEF:
454 lexrc.printError("Unknown tag `$$Token'");
456 case Lexer::LEX_FEOF:
461 switch (static_cast<LyXRCTags>(le)) {
464 format = lexrc.getInteger();
466 case RC_INPUT: // Include file
469 libFileSearch(string(),
471 if (!read(tmp, check_format)) {
473 "Error reading included file: " + tmp.absFileName());
479 bind_file = os::internal_path(lexrc.getString());
484 def_file = os::internal_path(lexrc.getString());
489 ui_file = os::internal_path(lexrc.getString());
492 case RC_AUTORESET_OPTIONS:
493 lexrc >> auto_reset_options;
496 case RC_DISPLAY_GRAPHICS:
498 display_graphics = lexrc.getString() == "true";
501 case RC_TEX_EXPECTS_WINDOWS_PATHS:
502 lexrc >> windows_style_tex_paths;
505 case RC_TEX_ALLOWS_SPACES:
506 lexrc >> tex_allows_spaces;
509 case RC_TEXINPUTS_PREFIX:
510 lexrc >> texinputs_prefix;
517 case RC_KBMAP_PRIMARY:
519 string const kmap(os::internal_path(lexrc.getString()));
520 if (!libFileSearch("kbd", kmap, "kmap").empty()
522 primary_kbmap = kmap;
524 lexrc.printError("LyX: Keymap `$$Token' not found");
529 case RC_KBMAP_SECONDARY:
531 string const kmap(os::internal_path(lexrc.getString()));
532 if (!libFileSearch("kbd", kmap, "kmap").empty()
534 secondary_kbmap = kmap;
536 lexrc.printError("LyX: Keymap `$$Token' not found");
541 case RC_FONT_ENCODING:
545 case RC_PRINTLANDSCAPEFLAG:
546 lexrc >> print_landscape_flag;
549 case RC_PRINTPAPERDIMENSIONFLAG:
550 lexrc >> print_paper_dimension_flag;
553 case RC_PRINTPAPERFLAG:
554 lexrc >> print_paper_flag;
557 case RC_PYGMENTIZE_COMMAND:
558 if (lexrc.next(true)) {
559 pygmentize_command = lexrc.getString();
563 case RC_VIEWDVI_PAPEROPTION:
565 view_dvi_paper_option = lexrc.getString();
567 view_dvi_paper_option.erase();
570 case RC_CHKTEX_COMMAND:
571 if (lexrc.next(true)) {
572 chktex_command = lexrc.getString();
576 case RC_BIBTEX_ALTERNATIVES:
577 if (lexrc.next(true)) {
578 bibtex_alternatives.insert(lexrc.getString());
582 case RC_BIBTEX_COMMAND:
583 if (lexrc.next(true)) {
584 bibtex_command = lexrc.getString();
588 case RC_JBIBTEX_COMMAND:
589 if (lexrc.next(true)) {
590 jbibtex_command = lexrc.getString();
594 case RC_JBIBTEX_ALTERNATIVES:
595 if (lexrc.next(true)) {
596 jbibtex_alternatives.insert(lexrc.getString());
600 case RC_INDEX_ALTERNATIVES:
601 if (lexrc.next(true)) {
602 index_alternatives.insert(lexrc.getString());
606 case RC_INDEX_COMMAND:
607 if (lexrc.next(true)) {
608 index_command = lexrc.getString();
612 case RC_JINDEX_COMMAND:
613 if (lexrc.next(true)) {
614 jindex_command = lexrc.getString();
618 case RC_SPLITINDEX_COMMAND:
619 if (lexrc.next(true)) {
620 splitindex_command = lexrc.getString();
624 case RC_NOMENCL_COMMAND:
625 if (lexrc.next(true)) {
626 nomencl_command = lexrc.getString();
635 lexrc >> defaultZoom;
636 if (defaultZoom < 10)
640 case RC_GEOMETRY_SESSION:
641 lexrc >> allow_geometry_session;
644 case RC_SCREEN_FONT_SIZES:
645 lexrc >> font_sizes[FONT_SIZE_TINY];
646 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
647 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
648 lexrc >> font_sizes[FONT_SIZE_SMALL];
649 lexrc >> font_sizes[FONT_SIZE_NORMAL];
650 lexrc >> font_sizes[FONT_SIZE_LARGE];
651 lexrc >> font_sizes[FONT_SIZE_LARGER];
652 lexrc >> font_sizes[FONT_SIZE_LARGEST];
653 lexrc >> font_sizes[FONT_SIZE_HUGE];
654 lexrc >> font_sizes[FONT_SIZE_HUGER];
657 case RC_SCREEN_FONT_SCALABLE:
658 lexrc >> use_scalable_fonts;
665 case RC_DOCUMENTPATH:
667 document_path = os::internal_path(lexrc.getString());
672 example_path = os::internal_path(lexrc.getString());
675 case RC_TEMPLATEPATH:
677 template_path = os::internal_path(lexrc.getString());
682 tempdir_path = os::internal_path(lexrc.getString());
685 case RC_THESAURUSDIRPATH:
687 thesaurusdir_path = os::internal_path(lexrc.getString());
690 case RC_HUNSPELLDIR_PATH:
692 hunspelldir_path = os::internal_path(lexrc.getString());
695 case RC_USELASTFILEPOS:
696 lexrc >> use_lastfilepos;
700 lexrc >> load_session;
703 case RC_MOUSE_WHEEL_SPEED:
704 lexrc >> mouse_wheel_speed;
707 case RC_COMPLETION_INLINE_DELAY:
708 lexrc >> completion_inline_delay;
711 case RC_COMPLETION_INLINE_MATH:
712 lexrc >> completion_inline_math;
715 case RC_COMPLETION_INLINE_TEXT:
716 lexrc >> completion_inline_text;
719 case RC_COMPLETION_INLINE_DOTS:
720 lexrc >> completion_inline_dots;
723 case RC_AUTOCORRECTION_MATH:
724 lexrc >> autocorrection_math;
727 case RC_COMPLETION_POPUP_DELAY:
728 lexrc >> completion_popup_delay;
731 case RC_COMPLETION_POPUP_MATH:
732 lexrc >> completion_popup_math;
735 case RC_COMPLETION_POPUP_TEXT:
736 lexrc >> completion_popup_text;
739 case RC_COMPLETION_CURSOR_TEXT:
740 lexrc >> completion_cursor_text;
743 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
744 lexrc >> completion_popup_after_complete;
747 case RC_COMPLETION_MINLENGTH:
748 lexrc >> completion_minlength;
751 case RC_NUMLASTFILES:
752 lexrc >> num_lastfiles;
755 case RC_CHECKLASTFILES:
756 lexrc >> check_lastfiles;
763 case RC_USE_SYSTEM_THEME_ICONS:
764 lexrc >> use_system_theme_icons;
767 case RC_SCREEN_FONT_ROMAN:
769 roman_font_name = lexrc.getString();
770 oldFontFormat(roman_font_name,
775 case RC_SCREEN_FONT_SANS:
777 sans_font_name = lexrc.getString();
778 oldFontFormat(sans_font_name, sans_font_foundry);
782 case RC_SCREEN_FONT_TYPEWRITER:
784 typewriter_font_name = lexrc.getString();
785 oldFontFormat(typewriter_font_name,
786 typewriter_font_foundry);
790 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
791 lexrc >> roman_font_foundry;
794 case RC_SCREEN_FONT_SANS_FOUNDRY:
795 lexrc >> sans_font_foundry;
798 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
799 lexrc >> typewriter_font_foundry;
804 lexrc.printError("Missing color tag.");
807 string lyx_name = lexrc.getString();
810 lexrc.printError("Missing color name for color: `$$Token'");
813 string x11_name = lexrc.getString();
815 ColorCode const col =
816 lcolor.getFromLyXName(lyx_name);
817 if (col == Color_none ||
818 col == Color_inherit ||
822 if (!lcolor.setColor(col, x11_name))
823 LYXERR0("Bad lyxrc set_color for " << lyx_name);
827 case RC_AUTOREGIONDELETE:
828 // Auto region delete defaults to true
829 lexrc >> auto_region_delete;
834 lyxpipes = os::internal_path(lexrc.getString());
837 case RC_CURSOR_FOLLOWS_SCROLLBAR:
838 lexrc >> cursor_follows_scrollbar;
841 case RC_CURSOR_WIDTH:
842 lexrc >> cursor_width;
845 case RC_SCROLL_BELOW_DOCUMENT:
846 lexrc >> scroll_below_document;
849 case RC_PARAGRAPH_MARKERS:
850 lexrc >> paragraph_markers;
853 case RC_MAC_DONTSWAP_CTRL_META:
854 lexrc >> mac_dontswap_ctrl_meta;
857 case RC_MAC_LIKE_CURSOR_MOVEMENT:
858 lexrc >> mac_like_cursor_movement;
861 case RC_MACRO_EDIT_STYLE:
863 switch (lexrc.getInteger()) {
864 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
865 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
866 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
871 case RC_DIALOGS_ICONIFY_WITH_MAIN:
872 lexrc >> dialogs_iconify_with_main;
875 case RC_PLAINTEXT_LINELEN:
876 lexrc >> plaintext_linelen;
878 // Spellchecker settings:
879 case RC_ACCEPT_COMPOUND:
880 lexrc >> spellchecker_accept_compound;
882 case RC_USE_NATIVE_FILEDIALOG:
883 lexrc >> use_native_filedialog;
885 case RC_USE_SYSTEM_COLORS:
886 lexrc >> use_system_colors;
889 lexrc >> use_tooltip;
891 case RC_USE_PIXMAP_CACHE:
892 lexrc >> use_pixmap_cache;
897 case RC_SPELLCHECKER:
898 lexrc >> spellchecker;
901 lexrc >> spellchecker_alt_lang;
904 lexrc >> spellchecker_esc_chars;
906 case RC_SPELLCHECK_CONTINUOUSLY:
907 lexrc >> spellcheck_continuously;
909 case RC_SPELLCHECK_NOTES:
910 lexrc >> spellcheck_notes;
913 lexrc >> make_backup;
915 case RC_SAVE_COMPRESSED:
916 lexrc >> save_compressed;
919 lexrc >> save_origin;
921 case RC_BACKUPDIR_PATH:
923 backupdir_path = os::internal_path(lexrc.getString());
925 case RC_DEFAULT_DECIMAL_POINT:
926 lexrc >> default_decimal_point;
928 case RC_DEFAULT_LENGTH_UNIT:
930 default_length_unit = (Length::UNIT) lexrc.getInteger();
932 case RC_DATE_INSERT_FORMAT:
933 lexrc >> date_insert_format;
935 case RC_LANGUAGE_CUSTOM_PACKAGE:
936 lexrc >> language_custom_package;
938 case RC_LANGUAGE_AUTO_BEGIN:
939 lexrc >> language_auto_begin;
941 case RC_LANGUAGE_AUTO_END:
942 lexrc >> language_auto_end;
944 case RC_LANGUAGE_GLOBAL_OPTIONS:
945 lexrc >> language_global_options;
947 case RC_LANGUAGE_PACKAGE_SELECTION:
949 switch (lexrc.getInteger()) {
951 language_package_selection = LP_AUTO;
954 language_package_selection = LP_BABEL;
957 language_package_selection = LP_CUSTOM;
960 language_package_selection = LP_NONE;
965 case RC_LANGUAGE_COMMAND_BEGIN:
966 lexrc >> language_command_begin;
968 case RC_LANGUAGE_COMMAND_END:
969 lexrc >> language_command_end;
971 case RC_LANGUAGE_COMMAND_LOCAL:
972 lexrc >> language_command_local;
974 case RC_VISUAL_CURSOR:
975 lexrc >> visual_cursor;
977 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
978 lexrc >> close_buffer_with_last_view;
981 lexrc >> auto_number;
983 case RC_MARK_FOREIGN_LANGUAGE:
984 lexrc >> mark_foreign_language;
990 fmt = lexrc.getString();
991 if (lexrc.next(true))
992 command = lexrc.getString();
993 setMover(fmt, command);
998 string from, to, command, flags;
1000 from = lexrc.getString();
1002 to = lexrc.getString();
1003 if (lexrc.next(true))
1004 command = lexrc.getString();
1006 flags = lexrc.getString();
1007 if (command.empty())
1008 theConverters().erase(from, to);
1010 theConverters().add(from, to, command, flags);
1013 // compatibility with versions older than 1.4.0 only
1015 string format, command;
1016 lexrc >> format >> command;
1017 theFormats().setViewer(format, command);
1020 case RC_FILEFORMAT: {
1022 string format, extensions, shortcut;
1023 docstring prettyname;
1024 if (!(lexrc >> format >> extensions))
1026 if (ok && lexrc.next(true))
1027 prettyname = lexrc.getDocString();
1031 if(!(lexrc >> shortcut))
1033 string viewer, editor;
1034 if (ok && lexrc.next(true))
1035 viewer = lexrc.getString();
1038 if (ok && lexrc.next(true))
1039 editor = lexrc.getString();
1043 if (!(lexrc >> flags >> mime))
1045 int flgs = Format::none;
1046 while (!flags.empty()) {
1048 flags = split(flags, flag, ',');
1049 if (flag == "document")
1050 flgs |= Format::document;
1051 else if (flag == "vector")
1052 flgs |= Format::vector;
1053 else if (flag == "zipped=native")
1054 flgs |= Format::zipped_native;
1055 else if (flag == "menu=export")
1056 flgs |= Format::export_menu;
1058 LYXERR0("Ignoring unknown flag `"
1059 << flag << "' for format `"
1063 LYXERR0("Syntax error in format " << format);
1064 else if (prettyname.empty()) {
1065 if (theConverters().formatIsUsed(format))
1066 LYXERR0("Can't delete format " << format);
1068 theFormats().erase(format);
1070 theFormats().add(format, extensions, prettyname,
1071 shortcut, viewer, editor, mime, flgs);
1075 case RC_VIEWER_ALTERNATIVES: {
1076 string format, command;
1077 if ((lexrc >> format) && lexrc.next(true)) {
1078 command = lexrc.getString();
1079 viewer_alternatives[format].insert(command);
1083 case RC_EDITOR_ALTERNATIVES: {
1084 string format, command;
1085 if ((lexrc >> format) && lexrc.next(true)) {
1086 command = lexrc.getString();
1087 editor_alternatives[format].insert(command);
1092 case RC_DEFAULT_OTF_VIEW_FORMAT:
1093 lexrc >> default_otf_view_format;
1096 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
1097 lexrc >> default_platex_view_format;
1100 case RC_DEFAULT_VIEW_FORMAT:
1101 lexrc >> default_view_format;
1104 case RC_GUI_LANGUAGE:
1105 lexrc >> gui_language;
1108 case RC_SHOW_BANNER:
1109 lexrc >> show_banner;
1114 string const tmp = lexrc.getString();
1115 if (tmp == "true" || tmp == "on")
1116 preview = PREVIEW_ON;
1117 else if (tmp == "no_math")
1118 preview = PREVIEW_NO_MATH;
1120 preview = PREVIEW_OFF;
1121 if (tmp != "false" && tmp != "off")
1122 LYXERR0("Unrecognized preview status \""
1128 case RC_PREVIEW_HASHED_LABELS:
1129 lexrc >> preview_hashed_labels;
1132 case RC_PREVIEW_SCALE_FACTOR:
1133 lexrc >> preview_scale_factor;
1140 lexrc >> user_email;
1143 case RC_PATH_PREFIX:
1144 lexrc >> path_prefix;
1147 case RC_USE_CONVERTER_CACHE:
1148 lexrc >> use_converter_cache;
1150 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1151 lexrc >> use_converter_needauth_forbidden;
1153 case RC_USE_CONVERTER_NEEDAUTH:
1154 lexrc >> use_converter_needauth;
1156 case RC_CONVERTER_CACHE_MAXAGE:
1157 lexrc >> converter_cache_maxage;
1160 case RC_SORT_LAYOUTS:
1161 lexrc >> sort_layouts;
1163 case RC_GROUP_LAYOUTS:
1164 lexrc >> group_layouts;
1166 case RC_FULL_SCREEN_LIMIT:
1167 lexrc >> full_screen_limit;
1169 case RC_FULL_SCREEN_TOOLBARS:
1170 lexrc >> full_screen_toolbars;
1172 case RC_FULL_SCREEN_SCROLLBAR:
1173 lexrc >> full_screen_scrollbar;
1175 case RC_FULL_SCREEN_STATUSBAR:
1176 lexrc >> full_screen_statusbar;
1178 case RC_FULL_SCREEN_TABBAR:
1179 lexrc >> full_screen_tabbar;
1181 case RC_FULL_SCREEN_MENUBAR:
1182 lexrc >> full_screen_menubar;
1184 case RC_FULL_SCREEN_WIDTH:
1185 lexrc >> full_screen_width;
1187 case RC_OPEN_BUFFERS_IN_TABS:
1188 lexrc >> open_buffers_in_tabs;
1190 case RC_SINGLE_CLOSE_TAB_BUTTON:
1191 lexrc >> single_close_tab_button;
1193 case RC_SINGLE_INSTANCE:
1194 lexrc >> single_instance;
1195 if (run_mode == PREFERRED)
1196 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1198 case RC_FORWARD_SEARCH_DVI:
1199 if (lexrc.next(true))
1200 forward_search_dvi = lexrc.getString();
1202 case RC_FORWARD_SEARCH_PDF:
1203 if (lexrc.next(true))
1204 forward_search_pdf = lexrc.getString();
1206 case RC_EXPORT_OVERWRITE:
1208 string const tmp = lexrc.getString();
1209 if (tmp == "all" || tmp == "true")
1210 export_overwrite = ALL_FILES;
1211 else if (tmp == "main")
1212 export_overwrite = MAIN_FILE;
1214 export_overwrite = NO_FILES;
1215 if (tmp != "ask" && tmp != "false")
1216 LYXERR0("Unrecognized export_overwrite status \""
1221 case RC_SCROLL_WHEEL_ZOOM:
1223 string const tmp = lexrc.getString();
1225 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1226 else if (tmp == "shift")
1227 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1228 else if (tmp == "alt")
1229 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1231 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1232 if (tmp != "off" && tmp != "false")
1233 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1239 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1240 lexrc >> mouse_middlebutton_paste;
1244 break; // this is just a dummy
1247 // This is triggered the first time through the loop unless
1248 // we hit a format tag.
1249 if (check_format && format != LYXRC_FILEFORMAT)
1250 return FormatMismatch;
1253 /// Update converters data-structures
1254 theConverters().update(theFormats());
1255 theConverters().buildGraph();
1256 theBufferList().invalidateConverterCache();
1262 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1264 ofstream ofs(filename.toFilesystemEncoding().c_str());
1266 write(ofs, ignore_system_lyxrc);
1270 void LyXRC::print() const
1272 if (lyxerr.debugging())
1273 write(lyxerr, false);
1281 typedef pair<string, SpecialisedMover> Data;
1283 SameMover(Data const & comparison)
1284 : comparison_(comparison) {}
1286 bool operator()(Data const & data) const
1288 return data.first == comparison_.first &&
1289 data.second.command() == comparison_.second.command();
1299 // Escape \ and " so that LyXLex can read the string later
1300 string escapeCommand(string const & str) {
1301 return subst(subst(str , "\\", "\\\\"),
1308 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1310 LyXRCTags tag = RC_LAST;
1312 if (!name.empty()) {
1313 for (int i = 0; i != lyxrcCount; ++i)
1314 if ("\\" + name == lyxrcTags[i].tag)
1315 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1319 os << "# LyX " << lyx_version
1320 << " generated this file. If you want to make your own\n"
1321 << "# modifications you should do them from inside LyX and save.\n\n"
1322 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1324 // Why the switch you might ask. It is a trick to ensure that all
1325 // the elements in the LyXRCTags enum are handled. As you can see
1326 // there are no breaks at all. So it is just a huge fall-through.
1327 // The nice thing is that we will get a warning from the compiler
1328 // if we forget an element.
1332 // input/include files are not done here
1333 case RC_LYXRCFORMAT:
1335 if (ignore_system_lyxrc ||
1336 bind_file != system_lyxrc.bind_file) {
1337 string const path = os::external_path(bind_file);
1338 os << "\\bind_file \"" << path << "\"\n";
1344 if (ignore_system_lyxrc ||
1345 def_file != system_lyxrc.def_file) {
1346 string const path = os::external_path(def_file);
1347 os << "\\def_file \"" << path << "\"\n";
1356 << "# MISC SECTION ######################################\n"
1358 // bind files are not done here.
1360 case RC_PATH_PREFIX:
1361 if (ignore_system_lyxrc ||
1362 path_prefix != system_lyxrc.path_prefix) {
1363 os << "\\path_prefix \"" << path_prefix << "\"\n";
1369 if (ignore_system_lyxrc ||
1370 ui_file != system_lyxrc.ui_file) {
1371 string const path = os::external_path(ui_file);
1372 os << "\\ui_file \"" << path << "\"\n";
1377 case RC_AUTOREGIONDELETE:
1378 if (ignore_system_lyxrc ||
1379 auto_region_delete != system_lyxrc.auto_region_delete) {
1380 os << "# Set to false to inhibit automatic replacement of\n"
1381 << "# the current selection.\n"
1382 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1388 case RC_AUTORESET_OPTIONS:
1389 if (ignore_system_lyxrc ||
1390 auto_reset_options != system_lyxrc.auto_reset_options) {
1391 os << "# Set to false to inhibit automatic reset of\n"
1392 << "# the class options to defaults on class change.\n"
1393 << "\\auto_reset_options "
1394 << convert<string>(auto_reset_options)
1401 if (ignore_system_lyxrc ||
1402 autosave != system_lyxrc.autosave) {
1403 os << "# The time interval between auto-saves in seconds.\n"
1404 << "\\autosave " << autosave << '\n';
1409 case RC_DISPLAY_GRAPHICS:
1410 if (ignore_system_lyxrc ||
1411 display_graphics != system_lyxrc.display_graphics) {
1412 os << "# Display graphics within LyX\n"
1414 << "\\display_graphics "
1415 << (display_graphics ? "true" : "false")
1421 case RC_SORT_LAYOUTS:
1422 if (ignore_system_lyxrc ||
1423 sort_layouts != system_lyxrc.sort_layouts) {
1424 os << "# Sort layouts alphabetically.\n"
1425 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1430 case RC_GROUP_LAYOUTS:
1431 if (ignore_system_lyxrc ||
1432 group_layouts != system_lyxrc.group_layouts) {
1433 os << "# Group layouts by their category.\n"
1434 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1439 case RC_VIEWDVI_PAPEROPTION:
1440 if (ignore_system_lyxrc ||
1441 view_dvi_paper_option
1442 != system_lyxrc.view_dvi_paper_option) {
1443 os << "# Options used to specify paper size to the\n"
1444 << "# view_dvi_command (e.g. -paper)\n"
1445 << "\\view_dvi_paper_option \""
1446 << view_dvi_paper_option << "\"\n";
1451 case RC_CHKTEX_COMMAND:
1452 if (ignore_system_lyxrc ||
1453 chktex_command != system_lyxrc.chktex_command) {
1454 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1459 case RC_BIBTEX_ALTERNATIVES: {
1460 CommandSet::const_iterator it = bibtex_alternatives.begin();
1461 CommandSet::const_iterator end = bibtex_alternatives.end();
1462 for ( ; it != end; ++it) {
1463 if (ignore_system_lyxrc
1464 || !system_lyxrc.bibtex_alternatives.count(*it))
1465 os << "\\bibtex_alternatives \""
1472 case RC_BIBTEX_COMMAND:
1473 if (ignore_system_lyxrc ||
1474 bibtex_command != system_lyxrc.bibtex_command) {
1475 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1480 case RC_JBIBTEX_COMMAND:
1481 if (ignore_system_lyxrc ||
1482 jbibtex_command != system_lyxrc.jbibtex_command) {
1483 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1488 case RC_JBIBTEX_ALTERNATIVES: {
1489 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1490 CommandSet::const_iterator end = jbibtex_alternatives.end();
1491 for ( ; it != end; ++it) {
1492 if (ignore_system_lyxrc
1493 || !system_lyxrc.jbibtex_alternatives.count(*it))
1494 os << "\\jbibtex_alternatives \""
1501 case RC_INDEX_ALTERNATIVES: {
1502 CommandSet::const_iterator it = index_alternatives.begin();
1503 CommandSet::const_iterator end = index_alternatives.end();
1504 for ( ; it != end; ++it) {
1505 if (ignore_system_lyxrc
1506 || !system_lyxrc.index_alternatives.count(*it))
1507 os << "\\index_alternatives \""
1514 case RC_INDEX_COMMAND:
1515 if (ignore_system_lyxrc ||
1516 index_command != system_lyxrc.index_command) {
1517 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1522 case RC_JINDEX_COMMAND:
1523 if (ignore_system_lyxrc ||
1524 jindex_command != system_lyxrc.jindex_command) {
1525 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1530 case RC_SPLITINDEX_COMMAND:
1531 if (ignore_system_lyxrc ||
1532 splitindex_command != system_lyxrc.splitindex_command) {
1533 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1538 case RC_NOMENCL_COMMAND:
1539 if (ignore_system_lyxrc ||
1540 nomencl_command != system_lyxrc.nomencl_command) {
1541 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1546 case RC_PYGMENTIZE_COMMAND:
1547 if (ignore_system_lyxrc ||
1548 pygmentize_command != system_lyxrc.pygmentize_command) {
1549 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1554 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1555 // Don't write this setting to the preferences file,
1556 // but allow temporary changes (bug 7557).
1557 if (ignore_system_lyxrc) {
1558 os << "\\tex_expects_windows_paths "
1559 << convert<string>(windows_style_tex_paths) << '\n';
1564 case RC_TEX_ALLOWS_SPACES:
1565 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1566 os << "\\tex_allows_spaces "
1567 << convert<string>(tex_allows_spaces) << '\n';
1573 if (ignore_system_lyxrc ||
1574 use_kbmap != system_lyxrc.use_kbmap) {
1575 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1580 case RC_KBMAP_PRIMARY:
1581 if (ignore_system_lyxrc ||
1582 primary_kbmap != system_lyxrc.primary_kbmap) {
1583 string const path = os::external_path(primary_kbmap);
1584 os << "\\kbmap_primary \"" << path << "\"\n";
1589 case RC_KBMAP_SECONDARY:
1590 if (ignore_system_lyxrc ||
1591 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1592 string const path = os::external_path(secondary_kbmap);
1593 os << "\\kbmap_secondary \"" << path << "\"\n";
1599 if (ignore_system_lyxrc ||
1600 lyxpipes != system_lyxrc.lyxpipes) {
1601 string const path = os::external_path(lyxpipes);
1602 os << "\\serverpipe \"" << path << "\"\n";
1607 case RC_DATE_INSERT_FORMAT:
1608 if (ignore_system_lyxrc ||
1609 date_insert_format != system_lyxrc.date_insert_format) {
1610 os << "\\date_insert_format \"" << date_insert_format
1617 os << "\\user_name \"" << user_name << "\"\n";
1622 os << "\\user_email \"" << user_email << "\"\n";
1626 case RC_SHOW_BANNER:
1627 if (ignore_system_lyxrc ||
1628 show_banner != system_lyxrc.show_banner) {
1629 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1635 if (ignore_system_lyxrc ||
1636 preview != system_lyxrc.preview) {
1642 case PREVIEW_NO_MATH:
1649 os << "\\preview " << status << '\n';
1654 case RC_PREVIEW_HASHED_LABELS:
1655 if (ignore_system_lyxrc ||
1656 preview_hashed_labels !=
1657 system_lyxrc.preview_hashed_labels) {
1658 os << "\\preview_hashed_labels "
1659 << convert<string>(preview_hashed_labels) << '\n';
1664 case RC_PREVIEW_SCALE_FACTOR:
1665 if (ignore_system_lyxrc ||
1666 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1667 os << "\\preview_scale_factor "
1668 << preview_scale_factor << '\n';
1673 case RC_USE_CONVERTER_CACHE:
1674 if (ignore_system_lyxrc ||
1675 use_converter_cache != system_lyxrc.use_converter_cache) {
1676 os << "\\use_converter_cache "
1677 << convert<string>(use_converter_cache) << '\n';
1682 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1683 if (ignore_system_lyxrc ||
1684 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1685 os << "\\use_converter_needauth_forbidden "
1686 << convert<string>(use_converter_needauth_forbidden) << '\n';
1691 case RC_USE_CONVERTER_NEEDAUTH:
1692 if (ignore_system_lyxrc ||
1693 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1694 os << "\\use_converter_needauth "
1695 << convert<string>(use_converter_needauth) << '\n';
1700 case RC_CONVERTER_CACHE_MAXAGE:
1701 if (ignore_system_lyxrc ||
1702 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1703 os << "\\converter_cache_maxage "
1704 << converter_cache_maxage << '\n';
1710 << "# SCREEN & FONTS SECTION ############################\n"
1714 if (ignore_system_lyxrc ||
1715 icon_set != system_lyxrc.icon_set) {
1716 os << "\\icon_set \"" << icon_set
1722 case RC_USE_SYSTEM_THEME_ICONS:
1723 if (ignore_system_lyxrc ||
1724 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1725 os << "\\use_system_theme_icons "
1726 << convert<string>(use_system_theme_icons)
1733 if (ignore_system_lyxrc ||
1734 dpi != system_lyxrc.dpi) {
1735 os << "\\screen_dpi " << dpi << '\n';
1740 case RC_SCREEN_ZOOM:
1741 if (ignore_system_lyxrc ||
1742 defaultZoom != system_lyxrc.defaultZoom) {
1743 os << "\\screen_zoom " << defaultZoom << '\n';
1748 case RC_GEOMETRY_SESSION:
1749 if (ignore_system_lyxrc ||
1750 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1751 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1757 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1758 if (ignore_system_lyxrc ||
1759 cursor_follows_scrollbar
1760 != system_lyxrc.cursor_follows_scrollbar) {
1761 os << "\\cursor_follows_scrollbar "
1762 << convert<string>(cursor_follows_scrollbar) << '\n';
1767 case RC_CURSOR_WIDTH:
1768 if (ignore_system_lyxrc ||
1770 != system_lyxrc.cursor_width) {
1771 os << "\\cursor_width "
1772 << cursor_width << '\n';
1777 case RC_SCROLL_BELOW_DOCUMENT:
1778 if (ignore_system_lyxrc ||
1779 scroll_below_document
1780 != system_lyxrc.scroll_below_document) {
1781 os << "\\scroll_below_document "
1782 << convert<string>(scroll_below_document) << '\n';
1787 case RC_PARAGRAPH_MARKERS:
1788 if (ignore_system_lyxrc ||
1790 != system_lyxrc.paragraph_markers) {
1791 os << "\\paragraph_markers "
1792 << convert<string>(paragraph_markers) << '\n';
1797 case RC_MAC_DONTSWAP_CTRL_META:
1798 if (ignore_system_lyxrc ||
1799 mac_dontswap_ctrl_meta
1800 != system_lyxrc.mac_dontswap_ctrl_meta) {
1801 os << "\\mac_dontswap_ctrl_meta "
1802 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1807 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1808 if (ignore_system_lyxrc ||
1809 mac_like_cursor_movement
1810 != system_lyxrc.mac_like_cursor_movement) {
1811 os << "\\mac_like_cursor_movement "
1812 << convert<string>(mac_like_cursor_movement) << '\n';
1817 case RC_MACRO_EDIT_STYLE:
1818 if (ignore_system_lyxrc ||
1820 != system_lyxrc.macro_edit_style) {
1821 os << "\\macro_edit_style ";
1822 switch (macro_edit_style) {
1823 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1824 case MACRO_EDIT_INLINE: os << "1\n"; break;
1825 case MACRO_EDIT_LIST: os << "2\n"; break;
1831 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1832 if (ignore_system_lyxrc ||
1833 dialogs_iconify_with_main
1834 != system_lyxrc.dialogs_iconify_with_main) {
1835 os << "\\dialogs_iconify_with_main "
1836 << convert<string>(dialogs_iconify_with_main) << '\n';
1841 case RC_SCREEN_FONT_ROMAN:
1842 if (ignore_system_lyxrc ||
1843 roman_font_name != system_lyxrc.roman_font_name) {
1844 os << "\\screen_font_roman \"" << roman_font_name
1850 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1851 if (ignore_system_lyxrc ||
1852 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1853 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1859 case RC_SCREEN_FONT_SANS:
1860 if (ignore_system_lyxrc ||
1861 sans_font_name != system_lyxrc.sans_font_name) {
1862 os << "\\screen_font_sans \"" << sans_font_name
1868 case RC_SCREEN_FONT_SANS_FOUNDRY:
1869 if (ignore_system_lyxrc ||
1870 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1871 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1877 case RC_SCREEN_FONT_TYPEWRITER:
1878 if (ignore_system_lyxrc ||
1879 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1880 os << "\\screen_font_typewriter \""
1881 << typewriter_font_name << "\"\n";
1886 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1887 if (ignore_system_lyxrc ||
1888 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1889 os << "\\screen_font_typewriter_foundry \""
1890 << typewriter_font_foundry << "\"\n";
1895 case RC_SCREEN_FONT_SCALABLE:
1896 if (ignore_system_lyxrc ||
1897 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1898 os << "\\screen_font_scalable "
1899 << convert<string>(use_scalable_fonts)
1905 case RC_SCREEN_FONT_SIZES:
1906 if (ignore_system_lyxrc ||
1907 font_sizes[FONT_SIZE_TINY]
1908 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1909 font_sizes[FONT_SIZE_SCRIPT]
1910 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1911 font_sizes[FONT_SIZE_FOOTNOTE]
1912 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1913 font_sizes[FONT_SIZE_SMALL]
1914 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1915 font_sizes[FONT_SIZE_NORMAL]
1916 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1917 font_sizes[FONT_SIZE_LARGE]
1918 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1919 font_sizes[FONT_SIZE_LARGER]
1920 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1921 font_sizes[FONT_SIZE_LARGEST]
1922 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1923 font_sizes[FONT_SIZE_HUGE]
1924 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1925 font_sizes[FONT_SIZE_HUGER]
1926 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1927 streamsize old_prec = os.precision();
1928 os.setf(ios::fixed);
1930 os << "\\screen_font_sizes"
1931 << ' ' << font_sizes[FONT_SIZE_TINY]
1932 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1933 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1934 << ' ' << font_sizes[FONT_SIZE_SMALL]
1935 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1936 << ' ' << font_sizes[FONT_SIZE_LARGE]
1937 << ' ' << font_sizes[FONT_SIZE_LARGER]
1938 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1939 << ' ' << font_sizes[FONT_SIZE_HUGE]
1940 << ' ' << font_sizes[FONT_SIZE_HUGER]
1942 os.precision(old_prec);
1943 os.unsetf(ios::fixed);
1948 case RC_FULL_SCREEN_LIMIT:
1949 if (ignore_system_lyxrc ||
1950 full_screen_limit != system_lyxrc.full_screen_limit) {
1951 os << "\\fullscreen_limit "
1952 << convert<string>(full_screen_limit)
1958 case RC_FULL_SCREEN_TOOLBARS:
1959 if (ignore_system_lyxrc ||
1960 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1961 os << "\\fullscreen_toolbars "
1962 << convert<string>(full_screen_toolbars)
1968 case RC_FULL_SCREEN_SCROLLBAR:
1969 if (ignore_system_lyxrc ||
1970 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1971 os << "\\fullscreen_scrollbar "
1972 << convert<string>(full_screen_scrollbar)
1978 case RC_FULL_SCREEN_STATUSBAR:
1979 if (ignore_system_lyxrc ||
1980 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1981 os << "\\fullscreen_statusbar "
1982 << convert<string>(full_screen_statusbar)
1988 case RC_FULL_SCREEN_TABBAR:
1989 if (ignore_system_lyxrc ||
1990 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1991 os << "\\fullscreen_tabbar "
1992 << convert<string>(full_screen_tabbar)
1998 case RC_FULL_SCREEN_MENUBAR:
1999 if (ignore_system_lyxrc ||
2000 full_screen_menubar != system_lyxrc.full_screen_menubar) {
2001 os << "\\fullscreen_menubar "
2002 << convert<string>(full_screen_menubar)
2008 case RC_FULL_SCREEN_WIDTH:
2009 if (ignore_system_lyxrc ||
2010 full_screen_width != system_lyxrc.full_screen_width) {
2011 os << "\\fullscreen_width "
2012 << convert<string>(full_screen_width)
2018 case RC_OPEN_BUFFERS_IN_TABS:
2019 if (ignore_system_lyxrc ||
2020 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2021 os << "\\open_buffers_in_tabs "
2022 << convert<string>(open_buffers_in_tabs)
2028 case RC_SINGLE_CLOSE_TAB_BUTTON:
2029 if (ignore_system_lyxrc ||
2030 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2031 os << "\\single_close_tab_button "
2032 << convert<string>(single_close_tab_button)
2038 case RC_SINGLE_INSTANCE:
2039 if (ignore_system_lyxrc ||
2040 single_instance != system_lyxrc.single_instance) {
2041 os << "\\single_instance "
2042 << convert<string>(single_instance)
2048 case RC_FORWARD_SEARCH_DVI:
2049 if (ignore_system_lyxrc ||
2050 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2051 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2056 case RC_FORWARD_SEARCH_PDF:
2057 if (ignore_system_lyxrc ||
2058 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2059 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2065 << "# COLOR SECTION ###################################\n"
2070 for (int i = 0; i < Color_ignore; ++i) {
2071 ColorCode lc = static_cast<ColorCode>(i);
2072 string const col = lcolor.getX11Name(lc);
2073 if (ignore_system_lyxrc
2074 || col != system_lcolor.getX11Name(lc)) {
2075 os << "\\set_color \""
2076 << lcolor.getLyXName(lc) << "\" \""
2084 << "# PRINTER SECTION ###################################\n"
2088 case RC_PRINTLANDSCAPEFLAG:
2089 if (ignore_system_lyxrc ||
2090 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2091 os << "\\print_landscape_flag \"" << print_landscape_flag
2097 case RC_PRINTPAPERFLAG:
2098 if (ignore_system_lyxrc ||
2099 print_paper_flag != system_lyxrc.print_paper_flag) {
2100 os << "\\print_paper_flag \"" << print_paper_flag
2106 case RC_PRINTPAPERDIMENSIONFLAG:
2107 if (ignore_system_lyxrc ||
2108 print_paper_dimension_flag
2109 != system_lyxrc.print_paper_dimension_flag) {
2110 os << "\\print_paper_dimension_flag \""
2111 << print_paper_dimension_flag << "\"\n";
2117 << "# TEX SECTION #######################################\n"
2121 case RC_TEXINPUTS_PREFIX:
2122 if (ignore_system_lyxrc ||
2123 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2124 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2129 case RC_FONT_ENCODING:
2130 if (ignore_system_lyxrc ||
2131 fontenc != system_lyxrc.fontenc) {
2132 os << "\\font_encoding \"" << fontenc << "\"\n";
2138 << "# FILE SECTION ######################################\n"
2142 case RC_DOCUMENTPATH:
2143 if (ignore_system_lyxrc ||
2144 document_path != system_lyxrc.document_path) {
2145 string const path = os::external_path(document_path);
2146 os << "\\document_path \"" << path << "\"\n";
2151 case RC_USELASTFILEPOS:
2152 if (ignore_system_lyxrc ||
2153 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2154 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2160 case RC_LOADSESSION:
2161 if (ignore_system_lyxrc ||
2162 load_session != system_lyxrc.load_session) {
2163 os << "\\load_session " << convert<string>(load_session)
2169 case RC_MOUSE_WHEEL_SPEED:
2170 if (ignore_system_lyxrc ||
2171 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2172 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2177 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2178 if (ignore_system_lyxrc ||
2179 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2180 os << "\\mouse_middlebutton_paste "
2181 << convert<string>(mouse_middlebutton_paste) << '\n';
2186 case RC_COMPLETION_INLINE_DELAY:
2187 if (ignore_system_lyxrc ||
2188 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2189 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2194 case RC_COMPLETION_INLINE_MATH:
2195 if (ignore_system_lyxrc ||
2196 completion_inline_math != system_lyxrc.completion_inline_math) {
2197 os << "\\completion_inline_math "
2198 << convert<string>(completion_inline_math) << '\n';
2203 case RC_COMPLETION_INLINE_TEXT:
2204 if (ignore_system_lyxrc ||
2205 completion_inline_text != system_lyxrc.completion_inline_text) {
2206 os << "\\completion_inline_text "
2207 << convert<string>(completion_inline_text) << '\n';
2212 case RC_COMPLETION_INLINE_DOTS:
2213 if (ignore_system_lyxrc ||
2214 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2215 os << "\\completion_inline_dots "
2216 << convert<string>(completion_inline_dots) << '\n';
2221 case RC_AUTOCORRECTION_MATH:
2222 if (ignore_system_lyxrc ||
2223 autocorrection_math != system_lyxrc.autocorrection_math) {
2224 os << "\\autocorrection_math "
2225 << convert<string>(autocorrection_math) << '\n';
2230 case RC_COMPLETION_POPUP_DELAY:
2231 if (ignore_system_lyxrc ||
2232 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2233 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2238 case RC_COMPLETION_POPUP_MATH:
2239 if (ignore_system_lyxrc ||
2240 completion_popup_math != system_lyxrc.completion_popup_math) {
2241 os << "\\completion_popup_math "
2242 << convert<string>(completion_popup_math) << '\n';
2247 case RC_COMPLETION_POPUP_TEXT:
2248 if (ignore_system_lyxrc ||
2249 completion_popup_text != system_lyxrc.completion_popup_text) {
2250 os << "\\completion_popup_text "
2251 << convert<string>(completion_popup_text) << '\n';
2256 case RC_COMPLETION_CURSOR_TEXT:
2257 if (ignore_system_lyxrc ||
2258 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2259 os << "\\completion_cursor_text "
2260 << convert<string>(completion_cursor_text) << '\n';
2265 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2266 if (ignore_system_lyxrc ||
2267 completion_popup_after_complete
2268 != system_lyxrc.completion_popup_after_complete) {
2269 os << "\\completion_popup_after_complete "
2270 << convert<string>(completion_popup_after_complete) << '\n';
2275 case RC_COMPLETION_MINLENGTH:
2276 if (ignore_system_lyxrc ||
2277 completion_minlength != system_lyxrc.completion_minlength) {
2278 os << "\\completion_minlength " << convert<string>(completion_minlength)
2284 case RC_NUMLASTFILES:
2285 if (ignore_system_lyxrc ||
2286 num_lastfiles != system_lyxrc.num_lastfiles) {
2287 os << "\\num_lastfiles " << num_lastfiles << '\n';
2292 case RC_CHECKLASTFILES:
2293 if (ignore_system_lyxrc ||
2294 check_lastfiles != system_lyxrc.check_lastfiles) {
2295 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2301 case RC_EXAMPLEPATH:
2302 if (ignore_system_lyxrc ||
2303 example_path != system_lyxrc.example_path) {
2304 string const path = os::external_path(example_path);
2305 os << "\\example_path \"" << path << "\"\n";
2310 case RC_TEMPLATEPATH:
2311 if (ignore_system_lyxrc ||
2312 template_path != system_lyxrc.template_path) {
2313 string const path = os::external_path(template_path);
2314 os << "\\template_path \"" << path << "\"\n";
2319 case RC_TEMPDIRPATH:
2320 if (ignore_system_lyxrc ||
2321 tempdir_path != system_lyxrc.tempdir_path) {
2322 string const path = os::external_path(tempdir_path);
2323 os << "\\tempdir_path \"" << path << "\"\n";
2328 case RC_THESAURUSDIRPATH:
2329 if (ignore_system_lyxrc ||
2330 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2331 string const path = os::external_path(thesaurusdir_path);
2332 os << "\\thesaurusdir_path \"" << path << "\"\n";
2337 case RC_HUNSPELLDIR_PATH:
2338 if (ignore_system_lyxrc ||
2339 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2340 string const path = os::external_path(hunspelldir_path);
2341 os << "\\hunspelldir_path \"" << path << "\"\n";
2346 case RC_PLAINTEXT_LINELEN:
2347 if (ignore_system_lyxrc ||
2348 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2349 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2354 case RC_MAKE_BACKUP:
2355 if (ignore_system_lyxrc ||
2356 make_backup != system_lyxrc.make_backup) {
2357 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2362 case RC_SAVE_COMPRESSED:
2363 if (ignore_system_lyxrc ||
2364 save_compressed != system_lyxrc.save_compressed) {
2365 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2370 case RC_SAVE_ORIGIN:
2371 if (ignore_system_lyxrc ||
2372 save_origin != system_lyxrc.save_origin) {
2373 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2378 case RC_BACKUPDIR_PATH:
2379 if (ignore_system_lyxrc ||
2380 backupdir_path != system_lyxrc.backupdir_path) {
2381 string const path = os::external_path(backupdir_path);
2382 os << "\\backupdir_path \"" << path << "\"\n";
2388 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2392 << "# SPELLCHECKER SECTION ##############################\n"
2396 case RC_ACCEPT_COMPOUND:
2397 if (ignore_system_lyxrc ||
2398 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2399 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2406 if (ignore_system_lyxrc ||
2407 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2408 os << "\\alternate_language \"" << spellchecker_alt_lang
2415 if (ignore_system_lyxrc ||
2416 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2417 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2422 case RC_USE_NATIVE_FILEDIALOG:
2423 if (ignore_system_lyxrc ||
2424 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2425 os << "\\use_native_filedialog "
2426 << convert<string>(use_native_filedialog)
2432 case RC_USE_SYSTEM_COLORS:
2433 if (ignore_system_lyxrc ||
2434 use_system_colors != system_lyxrc.use_system_colors) {
2435 os << "\\use_system_colors "
2436 << convert<string>(use_system_colors)
2442 case RC_USE_TOOLTIP:
2443 if (ignore_system_lyxrc ||
2444 use_tooltip != system_lyxrc.use_tooltip) {
2445 os << "\\use_tooltip "
2446 << convert<string>(use_tooltip)
2452 case RC_USE_PIXMAP_CACHE:
2453 if (ignore_system_lyxrc ||
2454 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2455 os << "\\use_pixmap_cache "
2456 << convert<string>(use_pixmap_cache)
2463 if (ignore_system_lyxrc ||
2464 use_qimage != system_lyxrc.use_qimage) {
2465 os << "\\use_qimage "
2466 << convert<string>(use_qimage)
2473 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2477 case RC_DEFAULT_DECIMAL_POINT:
2478 if (ignore_system_lyxrc ||
2479 default_decimal_point != system_lyxrc.default_decimal_point) {
2480 os << "\\default_decimal_point " << default_decimal_point << '\n';
2485 case RC_DEFAULT_LENGTH_UNIT:
2486 if (ignore_system_lyxrc ||
2487 default_length_unit != system_lyxrc.default_length_unit) {
2488 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2493 case RC_SPELLCHECKER:
2494 if (ignore_system_lyxrc ||
2495 spellchecker != system_lyxrc.spellchecker) {
2496 os << "\\spellchecker " << spellchecker << '\n';
2501 case RC_SPELLCHECK_CONTINUOUSLY:
2502 if (ignore_system_lyxrc ||
2503 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2504 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2510 case RC_SPELLCHECK_NOTES:
2511 if (ignore_system_lyxrc ||
2512 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2513 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2519 case RC_VISUAL_CURSOR:
2520 if (ignore_system_lyxrc ||
2521 visual_cursor != system_lyxrc.visual_cursor) {
2522 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2527 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2528 if (ignore_system_lyxrc ||
2529 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2530 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2531 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2536 case RC_LANGUAGE_CUSTOM_PACKAGE:
2537 if (ignore_system_lyxrc ||
2538 language_custom_package != system_lyxrc.language_custom_package) {
2539 os << "\\language_custom_package \"" << language_custom_package
2545 case RC_LANGUAGE_GLOBAL_OPTIONS:
2546 if (ignore_system_lyxrc ||
2547 language_global_options
2548 != system_lyxrc.language_global_options) {
2549 os << "\\language_global_options \""
2550 << convert<string>(language_global_options)
2556 case RC_LANGUAGE_PACKAGE_SELECTION:
2557 if (ignore_system_lyxrc ||
2558 language_package_selection != system_lyxrc.language_package_selection) {
2559 os << "\\language_package_selection ";
2560 switch (language_package_selection) {
2578 case RC_LANGUAGE_COMMAND_BEGIN:
2579 if (ignore_system_lyxrc ||
2580 language_command_begin
2581 != system_lyxrc.language_command_begin) {
2582 os << "\\language_command_begin \""
2583 << language_command_begin
2589 case RC_LANGUAGE_COMMAND_END:
2590 if (ignore_system_lyxrc ||
2591 language_command_end
2592 != system_lyxrc.language_command_end) {
2593 os << "\\language_command_end \"" << language_command_end
2599 case RC_LANGUAGE_COMMAND_LOCAL:
2600 if (ignore_system_lyxrc ||
2601 language_command_local
2602 != system_lyxrc.language_command_local) {
2603 os << "\\language_command_local \""
2604 << language_command_local
2610 case RC_LANGUAGE_AUTO_BEGIN:
2611 if (ignore_system_lyxrc ||
2612 language_auto_begin != system_lyxrc.language_auto_begin) {
2613 os << "\\language_auto_begin "
2614 << convert<string>(language_auto_begin) << '\n';
2619 case RC_LANGUAGE_AUTO_END:
2620 if (ignore_system_lyxrc ||
2621 language_auto_end != system_lyxrc.language_auto_end) {
2622 os << "\\language_auto_end "
2623 << convert<string>(language_auto_end) << '\n';
2628 case RC_MARK_FOREIGN_LANGUAGE:
2629 if (ignore_system_lyxrc ||
2630 mark_foreign_language
2631 != system_lyxrc.mark_foreign_language) {
2632 os << "\\mark_foreign_language " <<
2633 convert<string>(mark_foreign_language) << '\n';
2639 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2643 case RC_AUTO_NUMBER:
2644 if (ignore_system_lyxrc ||
2645 auto_number != system_lyxrc.auto_number) {
2646 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2651 case RC_GUI_LANGUAGE:
2652 if (ignore_system_lyxrc ||
2653 gui_language != system_lyxrc.gui_language) {
2654 os << "\\gui_language " << gui_language << '\n';
2659 case RC_EXPORT_OVERWRITE:
2660 if (ignore_system_lyxrc ||
2661 export_overwrite != system_lyxrc.export_overwrite) {
2663 switch (export_overwrite) {
2674 os << "\\export_overwrite " << status << '\n';
2679 case RC_SCROLL_WHEEL_ZOOM:
2680 if (ignore_system_lyxrc ||
2681 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2683 switch (scroll_wheel_zoom) {
2684 case SCROLL_WHEEL_ZOOM_OFF:
2687 case SCROLL_WHEEL_ZOOM_CTRL:
2690 case SCROLL_WHEEL_ZOOM_SHIFT:
2693 case SCROLL_WHEEL_ZOOM_ALT:
2697 os << "\\scroll_wheel_zoom " << status << '\n';
2703 << "# FORMATS SECTION ##########################\n"
2708 // New/modified formats
2709 for (Formats::const_iterator cit = theFormats().begin();
2710 cit != theFormats().end(); ++cit) {
2711 Format const * format =
2712 theSystemFormats().getFormat(cit->name());
2714 format->extensions() != cit->extensions() ||
2715 format->prettyname() != cit->prettyname() ||
2716 format->shortcut() != cit->shortcut() ||
2717 format->viewer() != cit->viewer() ||
2718 format->editor() != cit->editor() ||
2719 format->documentFormat() != cit->documentFormat() ||
2720 format->vectorFormat() != cit->vectorFormat() ||
2721 format->inExportMenu() != cit->inExportMenu() ||
2722 format->mime() != cit->mime()) {
2723 os << "\\format \"" << cit->name() << "\" \""
2724 << cit->extensions() << "\" \""
2725 << to_utf8(cit->prettyname()) << "\" \""
2726 << cit->shortcut() << "\" \""
2727 << escapeCommand(cit->viewer()) << "\" \""
2728 << escapeCommand(cit->editor()) << "\" \"";
2729 vector<string> flags;
2730 if (cit->documentFormat())
2731 flags.push_back("document");
2732 if (cit->vectorFormat())
2733 flags.push_back("vector");
2734 if (cit->zippedNative())
2735 flags.push_back("zipped=native");
2736 if (cit->inExportMenu())
2737 flags.push_back("menu=export");
2739 os << getStringFromVector(flags);
2740 os << "\" \"" << cit->mime() << "\"\n";
2744 // Look for deleted formats
2745 for (Formats::const_iterator cit = theSystemFormats().begin();
2746 cit != theSystemFormats().end(); ++cit)
2747 if (!theFormats().getFormat(cit->name()))
2748 os << "\\format \"" << cit->name()
2749 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2753 case RC_VIEWER_ALTERNATIVES: {
2754 Alternatives::const_iterator it = viewer_alternatives.begin();
2755 Alternatives::const_iterator const en = viewer_alternatives.end();
2756 Alternatives::const_iterator const sysend =
2757 system_lyxrc.viewer_alternatives.end();
2758 for (; it != en; ++it) {
2759 string const & fmt = it->first;
2760 CommandSet const & cmd = it->second;
2761 CommandSet::const_iterator sit = cmd.begin();
2762 CommandSet::const_iterator const sen = cmd.end();
2763 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2764 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2765 system_lyxrc.viewer_alternatives.find(fmt);
2766 for (; sit != sen; ++sit) {
2767 string const & cmd = *sit;
2768 if (ignore_system_lyxrc
2769 || sysfmt == sysend // format not found
2770 || sysfmt->second.count(cmd) == 0 // this command not found
2772 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2779 case RC_EDITOR_ALTERNATIVES: {
2780 Alternatives::const_iterator it = editor_alternatives.begin();
2781 Alternatives::const_iterator const en = editor_alternatives.end();
2782 Alternatives::const_iterator const sysend =
2783 system_lyxrc.editor_alternatives.end();
2784 for (; it != en; ++it) {
2785 string const & fmt = it->first;
2786 CommandSet const & cmd = it->second;
2787 CommandSet::const_iterator sit = cmd.begin();
2788 CommandSet::const_iterator const sen = cmd.end();
2789 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2790 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2791 system_lyxrc.editor_alternatives.find(fmt);
2792 for (; sit != sen; ++sit) {
2793 string const & cmd = *sit;
2794 if (ignore_system_lyxrc
2795 || sysfmt == sysend // format not found
2796 || sysfmt->second.count(cmd) == 0 // this command not found
2798 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2805 case RC_DEFAULT_OTF_VIEW_FORMAT:
2806 if ((ignore_system_lyxrc ||
2807 default_otf_view_format != system_lyxrc.default_otf_view_format)
2808 && !default_otf_view_format.empty()) {
2809 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2814 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2815 if ((ignore_system_lyxrc ||
2816 default_platex_view_format != system_lyxrc.default_platex_view_format)
2817 && !default_platex_view_format.empty()) {
2818 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2823 case RC_DEFAULT_VIEW_FORMAT:
2824 if (ignore_system_lyxrc ||
2825 default_view_format != system_lyxrc.default_view_format) {
2826 os << "\\default_view_format " << default_view_format << '\n';
2837 << "# CONVERTERS SECTION ##########################\n"
2842 // Look for new converters
2843 for (Converters::const_iterator cit = theConverters().begin();
2844 cit != theConverters().end(); ++cit) {
2845 Converter const * converter =
2846 theSystemConverters().getConverter(cit->from(),
2849 converter->command() != cit->command() ||
2850 converter->flags() != cit->flags())
2851 os << "\\converter \"" << cit->from() << "\" \""
2852 << cit->to() << "\" \""
2853 << escapeCommand(cit->command()) << "\" \""
2854 << cit->flags() << "\"\n";
2857 // New/modifed converters
2858 for (Converters::const_iterator cit = theSystemConverters().begin();
2859 cit != theSystemConverters().end(); ++cit)
2860 if (!theConverters().getConverter(cit->from(), cit->to()))
2861 os << "\\converter \"" << cit->from()
2862 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2869 << "# COPIERS SECTION ##########################\n"
2872 // Look for new movers
2873 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2874 Movers::const_iterator const sysend = theSystemMovers().end();
2875 Movers::const_iterator it = theMovers().begin();
2876 Movers::const_iterator end = theMovers().end();
2878 for (; it != end; ++it) {
2879 Movers::const_iterator const sysit =
2880 find_if(sysbegin, sysend, SameMover(*it));
2881 if (sysit == sysend) {
2882 string const & fmt = it->first;
2883 string const & command =
2884 it->second.command();
2886 os << "\\copier " << fmt
2887 << " \"" << escapeCommand(command) << "\"\n";
2893 // We don't actually delete SpecialisedMover(s) from the
2894 // map, just clear their 'command', so there's no need
2895 // to test for anything else.
2902 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2904 // Why the switch you might ask. It is a trick to ensure that all
2905 // the elements in the LyXRCTags enum is handled. As you can see
2906 // there are no breaks at all. So it is just a huge fall-through.
2907 // The nice thing is that we will get a warning from the compiler
2908 // if we forget an element.
2909 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2911 case LyXRC::RC_LAST:
2912 case LyXRC::RC_ACCEPT_COMPOUND:
2913 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2914 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2916 case LyXRC::RC_ALT_LANG:
2917 case LyXRC::RC_PLAINTEXT_LINELEN:
2918 case LyXRC::RC_AUTOCORRECTION_MATH:
2919 case LyXRC::RC_AUTOREGIONDELETE:
2920 case LyXRC::RC_AUTORESET_OPTIONS:
2921 case LyXRC::RC_AUTOSAVE:
2922 case LyXRC::RC_AUTO_NUMBER:
2923 case LyXRC::RC_BACKUPDIR_PATH:
2924 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2925 case LyXRC::RC_BIBTEX_COMMAND:
2926 case LyXRC::RC_BINDFILE:
2927 case LyXRC::RC_CHECKLASTFILES:
2928 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2929 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2930 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2931 case LyXRC::RC_COMPLETION_INLINE_MATH:
2932 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2933 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2934 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2935 case LyXRC::RC_COMPLETION_POPUP_MATH:
2936 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2937 case LyXRC::RC_COMPLETION_MINLENGTH:
2938 case LyXRC::RC_USELASTFILEPOS:
2939 case LyXRC::RC_LOADSESSION:
2940 case LyXRC::RC_CHKTEX_COMMAND:
2941 case LyXRC::RC_CONVERTER:
2942 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2943 case LyXRC::RC_COPIER:
2944 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2945 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2946 case LyXRC::RC_DATE_INSERT_FORMAT:
2947 case LyXRC::RC_GUI_LANGUAGE:
2948 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2949 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2950 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2951 case LyXRC::RC_DEFFILE:
2952 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2953 case LyXRC::RC_DISPLAY_GRAPHICS:
2954 case LyXRC::RC_DOCUMENTPATH:
2955 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2956 FileName path(lyxrc_new.document_path);
2957 if (path.exists() && path.isDirectory())
2958 package().document_dir() = FileName(lyxrc.document_path);
2961 case LyXRC::RC_EDITOR_ALTERNATIVES:
2962 case LyXRC::RC_ESC_CHARS:
2963 case LyXRC::RC_EXAMPLEPATH:
2964 case LyXRC::RC_FONT_ENCODING:
2965 case LyXRC::RC_FILEFORMAT:
2966 case LyXRC::RC_GROUP_LAYOUTS:
2967 case LyXRC::RC_HUNSPELLDIR_PATH:
2968 case LyXRC::RC_ICON_SET:
2969 case LyXRC::RC_INDEX_ALTERNATIVES:
2970 case LyXRC::RC_INDEX_COMMAND:
2971 case LyXRC::RC_JBIBTEX_COMMAND:
2972 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2973 case LyXRC::RC_JINDEX_COMMAND:
2974 case LyXRC::RC_NOMENCL_COMMAND:
2975 case LyXRC::RC_PYGMENTIZE_COMMAND:
2976 case LyXRC::RC_INPUT:
2977 case LyXRC::RC_KBMAP:
2978 case LyXRC::RC_KBMAP_PRIMARY:
2979 case LyXRC::RC_KBMAP_SECONDARY:
2980 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2981 case LyXRC::RC_LANGUAGE_AUTO_END:
2982 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2983 case LyXRC::RC_LANGUAGE_COMMAND_END:
2984 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2985 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2986 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2987 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2988 case LyXRC::RC_LYXRCFORMAT:
2989 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2990 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2991 case LyXRC::RC_MACRO_EDIT_STYLE:
2992 case LyXRC::RC_MAKE_BACKUP:
2993 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2994 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2995 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2996 case LyXRC::RC_NUMLASTFILES:
2997 case LyXRC::RC_PARAGRAPH_MARKERS:
2998 case LyXRC::RC_PATH_PREFIX:
2999 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
3000 prependEnvPath("PATH", lyxrc_new.path_prefix);
3001 // Resets python path
3002 support::os::python(true);
3005 case LyXRC::RC_PREVIEW:
3006 case LyXRC::RC_PREVIEW_HASHED_LABELS:
3007 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
3008 case LyXRC::RC_PRINTLANDSCAPEFLAG:
3009 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
3010 case LyXRC::RC_PRINTPAPERFLAG:
3011 case LyXRC::RC_SAVE_COMPRESSED:
3012 case LyXRC::RC_SAVE_ORIGIN:
3013 case LyXRC::RC_SCREEN_DPI:
3014 case LyXRC::RC_SCREEN_FONT_ROMAN:
3015 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3016 case LyXRC::RC_SCREEN_FONT_SANS:
3017 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3018 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3019 case LyXRC::RC_SCREEN_FONT_SIZES:
3020 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3021 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3022 case LyXRC::RC_GEOMETRY_SESSION:
3023 case LyXRC::RC_SCREEN_ZOOM:
3024 case LyXRC::RC_SERVERPIPE:
3025 case LyXRC::RC_SET_COLOR:
3026 case LyXRC::RC_SHOW_BANNER:
3027 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3028 case LyXRC::RC_SPELLCHECKER:
3029 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3032 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3033 case LyXRC::RC_SPELLCHECK_NOTES:
3034 case LyXRC::RC_SPLITINDEX_COMMAND:
3035 case LyXRC::RC_TEMPDIRPATH:
3036 case LyXRC::RC_TEMPLATEPATH:
3037 case LyXRC::RC_TEX_ALLOWS_SPACES:
3038 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3039 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3040 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3043 case LyXRC::RC_TEXINPUTS_PREFIX:
3044 case LyXRC::RC_THESAURUSDIRPATH:
3045 case LyXRC::RC_UIFILE:
3046 case LyXRC::RC_USER_EMAIL:
3047 case LyXRC::RC_USER_NAME:
3048 case LyXRC::RC_USE_CONVERTER_CACHE:
3049 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
3050 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
3051 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
3052 case LyXRC::RC_USE_SYSTEM_COLORS:
3053 case LyXRC::RC_USE_TOOLTIP:
3054 case LyXRC::RC_USE_PIXMAP_CACHE:
3055 case LyXRC::RC_USE_QIMAGE:
3056 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3057 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3058 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3059 case LyXRC::RC_SINGLE_INSTANCE:
3060 case LyXRC::RC_SORT_LAYOUTS:
3061 case LyXRC::RC_FULL_SCREEN_LIMIT:
3062 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3063 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3064 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3065 case LyXRC::RC_FULL_SCREEN_TABBAR:
3066 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3067 case LyXRC::RC_FULL_SCREEN_WIDTH:
3068 case LyXRC::RC_VISUAL_CURSOR:
3069 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3070 case LyXRC::RC_VIEWER:
3071 case LyXRC::RC_VIEWER_ALTERNATIVES:
3072 case LyXRC::RC_FORWARD_SEARCH_DVI:
3073 case LyXRC::RC_FORWARD_SEARCH_PDF:
3074 case LyXRC::RC_EXPORT_OVERWRITE:
3075 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3076 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3077 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3078 case LyXRC::RC_CURSOR_WIDTH:
3085 string const LyXRC::getDescription(LyXRCTags tag)
3090 case RC_ACCEPT_COMPOUND:
3091 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3095 str = _("Specify an alternate language. The default is to use the language of the document.");
3098 case RC_PLAINTEXT_LINELEN:
3099 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.");
3102 case RC_AUTOREGIONDELETE:
3103 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3106 case RC_AUTORESET_OPTIONS:
3107 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3111 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3114 case RC_AUTO_NUMBER:
3117 case RC_BACKUPDIR_PATH:
3118 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.");
3121 case RC_BIBTEX_COMMAND:
3122 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3125 case RC_JBIBTEX_COMMAND:
3126 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3130 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3133 case RC_CHECKLASTFILES:
3134 str = _("Select to check whether the lastfiles still exist.");
3137 case RC_CHKTEX_COMMAND:
3138 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3144 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3145 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3148 case RC_CONVERTER_NEEDAUTH:
3149 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3155 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3156 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.");
3159 case RC_CURSOR_WIDTH:
3160 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3163 case RC_SCROLL_BELOW_DOCUMENT:
3164 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");
3167 case RC_MAC_DONTSWAP_CTRL_META:
3168 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3171 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3172 str = _("Use the Mac OS X conventions for cursor movement");
3175 case RC_SHOW_MACRO_LABEL:
3176 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3179 case RC_DATE_INSERT_FORMAT:
3180 //xgettext:no-c-format
3181 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3185 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3188 case RC_DEFAULT_OTF_VIEW_FORMAT:
3189 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3192 case RC_DEFAULT_VIEW_FORMAT:
3193 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3196 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3197 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3200 case RC_DISPLAY_GRAPHICS:
3201 str = _("Select how LyX will display any graphics.");
3204 case RC_DOCUMENTPATH:
3205 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3209 str = _("Specify additional chars that can be part of a word.");
3212 case RC_EXAMPLEPATH:
3213 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3216 case RC_FONT_ENCODING:
3217 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3223 case RC_INDEX_COMMAND:
3224 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\".");
3227 case RC_JINDEX_COMMAND:
3228 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3231 case RC_NOMENCL_COMMAND:
3232 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3235 case RC_PYGMENTIZE_COMMAND:
3236 str = _("The command to run the python pygments syntax highlighter.");
3243 case RC_KBMAP_PRIMARY:
3244 case RC_KBMAP_SECONDARY:
3245 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.");
3248 case RC_LANGUAGE_AUTO_BEGIN:
3249 str = _("Select if a language switching command is needed at the beginning of the document.");
3252 case RC_LANGUAGE_AUTO_END:
3253 str = _("Select if a language switching command is needed at the end of the document.");
3256 case RC_LANGUAGE_COMMAND_BEGIN:
3257 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.");
3260 case RC_LANGUAGE_COMMAND_END:
3261 str = _("The LaTeX command for changing back to the language of the document.");
3264 case RC_LANGUAGE_COMMAND_LOCAL:
3265 str = _("The LaTeX command for local changing of the language.");
3268 case RC_LANGUAGE_GLOBAL_OPTIONS:
3269 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3272 case RC_LANGUAGE_CUSTOM_PACKAGE:
3273 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3276 case RC_LANGUAGE_PACKAGE_SELECTION:
3277 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3280 case RC_USELASTFILEPOS:
3281 str = _("De-select if you do not want LyX to scroll to saved position.");
3284 case RC_LOADSESSION:
3285 str = _("De-select to prevent loading files opened from the last LyX session.");
3288 case RC_MAKE_BACKUP:
3289 str = _("De-select if you don't want LyX to create backup files.");
3292 case RC_MARK_FOREIGN_LANGUAGE:
3293 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3296 case RC_MOUSE_WHEEL_SPEED:
3297 str = _("The scrolling speed of the mouse wheel.");
3300 case RC_COMPLETION_POPUP_DELAY:
3301 str = _("The completion popup delay.");
3304 case RC_COMPLETION_POPUP_MATH:
3305 str = _("Select to display the completion popup in math mode.");
3308 case RC_COMPLETION_POPUP_TEXT:
3309 str = _("Select to display the completion popup in text mode.");
3312 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3313 str = _("Show the completion popup without delay after non-unique completion attempt.");
3316 case RC_COMPLETION_POPUP_TEXT:
3317 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3320 case RC_COMPLETION_POPUP_DELAY:
3321 str = _("The inline completion delay.");
3324 case RC_COMPLETION_INLINE_MATH:
3325 str = _("Select to display the inline completion in math mode.");
3328 case RC_COMPLETION_INLINE_TEXT:
3329 str = _("Select to display the inline completion in text mode.");
3332 case RC_COMPLETION_INLINE_DOTS:
3333 str = _("Use \"...\" to shorten long completions.");
3336 case RC_AUTOCORRECTION_MATH:
3337 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3340 case RC_NUMLASTFILES:
3341 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3345 case RC_PATH_PREFIX:
3346 str = _("Specify those directories which should be "
3347 "prepended to the PATH environment variable.\n"
3348 "Use the OS native format.");
3352 str = _("Shows a typeset preview of things such as math");
3355 case RC_PREVIEW_HASHED_LABELS:
3356 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3359 case RC_PREVIEW_SCALE_FACTOR:
3360 str = _("Scale the preview size to suit.");
3363 case RC_PRINTLANDSCAPEFLAG:
3364 str = _("The option to print out in landscape.");
3367 case RC_PRINTPAPERDIMENSIONFLAG:
3368 str = _("Option to specify the dimensions of the print paper.");
3371 case RC_PRINTPAPERFLAG:
3372 str = _("The option to specify paper type.");
3375 case RC_VISUAL_CURSOR:
3376 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3379 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3380 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).");
3384 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3387 case RC_SCREEN_FONT_ROMAN:
3388 case RC_SCREEN_FONT_SANS:
3389 case RC_SCREEN_FONT_TYPEWRITER:
3390 str = _("The screen fonts used to display the text while editing.");
3393 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3394 case RC_SCREEN_FONT_SANS_FOUNDRY:
3395 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3398 case RC_SCREEN_FONT_SCALABLE:
3399 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.");
3402 case RC_SCREEN_FONT_SIZES:
3403 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3406 case RC_SCREEN_ZOOM:
3407 //xgettext:no-c-format
3408 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3411 case RC_GEOMETRY_SESSION:
3412 str = _("Allow session manager to save and restore windows geometry.");
3416 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3422 case RC_SHOW_BANNER:
3423 str = _("De-select if you don't want the startup banner.");
3426 case RC_TEMPDIRPATH:
3427 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3430 case RC_THESAURUSDIRPATH:
3431 str = _("This is the place where the files of the thesaurus library reside.");
3434 case RC_TEMPLATEPATH:
3435 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3438 case RC_TEX_ALLOWS_SPACES:
3441 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3444 case RC_TEXINPUTS_PREFIX:
3445 str = _("Specify those directories which should be "
3446 "prepended to the TEXINPUTS environment variable.\n"
3447 "A '.' represents the current document directory. "
3448 "Use the OS native format.");
3452 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3461 case RC_USE_USE_SYSTEM_COLORS:
3462 str = _("Enable use the system colors for some things like main window background and selection.");
3465 case RC_USE_TOOLTIP:
3466 str = _("Enable the automatic appearance of tool tips in the work area.");
3469 case RC_USE_PIXMAP_CACHE:
3470 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3473 case RC_VIEWDVI_PAPEROPTION:
3474 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3489 // The global instance
3492 // The global copy of the system lyxrc entries (everything except preferences)