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);
415 return retval == ReadOK;
419 // don't need to worry about conversion, because this is always
420 // from an internal source
421 bool LyXRC::read(istream & is)
423 Lexer lexrc(lyxrcTags);
425 LYXERR(Debug::LYXRC, "Reading istream...");
426 return read(lexrc, false) == ReadOK;
430 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
432 if (lyxerr.debugging(Debug::PARSER))
433 lexrc.printTable(lyxerr);
438 // format prior to 2.0 and introduction of format tag
439 unsigned int format = 0;
441 while (lexrc.isOK()) {
442 // By using two switches we take advantage of the compiler
443 // telling us if we have missed a LyXRCTags element in
444 // the second switch.
445 // Note that this also shows a problem with Lexer since it
446 // helps us avoid taking advantage of the strictness of the
449 int le = lexrc.lex();
451 case Lexer::LEX_UNDEF:
452 lexrc.printError("Unknown tag `$$Token'");
454 case Lexer::LEX_FEOF:
459 switch (static_cast<LyXRCTags>(le)) {
462 format = lexrc.getInteger();
464 case RC_INPUT: // Include file
467 libFileSearch(string(),
469 if (!read(tmp, check_format)) {
471 "Error reading included file: " + tmp.absFileName());
477 bind_file = os::internal_path(lexrc.getString());
482 def_file = os::internal_path(lexrc.getString());
487 ui_file = os::internal_path(lexrc.getString());
490 case RC_AUTORESET_OPTIONS:
491 lexrc >> auto_reset_options;
494 case RC_DISPLAY_GRAPHICS:
496 display_graphics = lexrc.getString() == "true";
499 case RC_TEX_EXPECTS_WINDOWS_PATHS:
500 lexrc >> windows_style_tex_paths;
503 case RC_TEX_ALLOWS_SPACES:
504 lexrc >> tex_allows_spaces;
507 case RC_TEXINPUTS_PREFIX:
508 lexrc >> texinputs_prefix;
515 case RC_KBMAP_PRIMARY:
517 string const kmap(os::internal_path(lexrc.getString()));
518 if (!libFileSearch("kbd", kmap, "kmap").empty()
520 primary_kbmap = kmap;
522 lexrc.printError("LyX: Keymap `$$Token' not found");
527 case RC_KBMAP_SECONDARY:
529 string const kmap(os::internal_path(lexrc.getString()));
530 if (!libFileSearch("kbd", kmap, "kmap").empty()
532 secondary_kbmap = kmap;
534 lexrc.printError("LyX: Keymap `$$Token' not found");
539 case RC_FONT_ENCODING:
543 case RC_PRINTLANDSCAPEFLAG:
544 lexrc >> print_landscape_flag;
547 case RC_PRINTPAPERDIMENSIONFLAG:
548 lexrc >> print_paper_dimension_flag;
551 case RC_PRINTPAPERFLAG:
552 lexrc >> print_paper_flag;
555 case RC_PYGMENTIZE_COMMAND:
556 if (lexrc.next(true)) {
557 pygmentize_command = lexrc.getString();
561 case RC_VIEWDVI_PAPEROPTION:
563 view_dvi_paper_option = lexrc.getString();
565 view_dvi_paper_option.erase();
568 case RC_CHKTEX_COMMAND:
569 if (lexrc.next(true)) {
570 chktex_command = lexrc.getString();
574 case RC_BIBTEX_ALTERNATIVES:
575 if (lexrc.next(true)) {
576 bibtex_alternatives.insert(lexrc.getString());
580 case RC_BIBTEX_COMMAND:
581 if (lexrc.next(true)) {
582 bibtex_command = lexrc.getString();
586 case RC_JBIBTEX_COMMAND:
587 if (lexrc.next(true)) {
588 jbibtex_command = lexrc.getString();
592 case RC_JBIBTEX_ALTERNATIVES:
593 if (lexrc.next(true)) {
594 jbibtex_alternatives.insert(lexrc.getString());
598 case RC_INDEX_ALTERNATIVES:
599 if (lexrc.next(true)) {
600 index_alternatives.insert(lexrc.getString());
604 case RC_INDEX_COMMAND:
605 if (lexrc.next(true)) {
606 index_command = lexrc.getString();
610 case RC_JINDEX_COMMAND:
611 if (lexrc.next(true)) {
612 jindex_command = lexrc.getString();
616 case RC_SPLITINDEX_COMMAND:
617 if (lexrc.next(true)) {
618 splitindex_command = lexrc.getString();
622 case RC_NOMENCL_COMMAND:
623 if (lexrc.next(true)) {
624 nomencl_command = lexrc.getString();
633 lexrc >> defaultZoom;
634 if (defaultZoom < 10)
638 case RC_GEOMETRY_SESSION:
639 lexrc >> allow_geometry_session;
642 case RC_SCREEN_FONT_SIZES:
643 lexrc >> font_sizes[FONT_SIZE_TINY];
644 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
645 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
646 lexrc >> font_sizes[FONT_SIZE_SMALL];
647 lexrc >> font_sizes[FONT_SIZE_NORMAL];
648 lexrc >> font_sizes[FONT_SIZE_LARGE];
649 lexrc >> font_sizes[FONT_SIZE_LARGER];
650 lexrc >> font_sizes[FONT_SIZE_LARGEST];
651 lexrc >> font_sizes[FONT_SIZE_HUGE];
652 lexrc >> font_sizes[FONT_SIZE_HUGER];
655 case RC_SCREEN_FONT_SCALABLE:
656 lexrc >> use_scalable_fonts;
663 case RC_DOCUMENTPATH:
665 document_path = os::internal_path(lexrc.getString());
670 example_path = os::internal_path(lexrc.getString());
673 case RC_TEMPLATEPATH:
675 template_path = os::internal_path(lexrc.getString());
680 tempdir_path = os::internal_path(lexrc.getString());
683 case RC_THESAURUSDIRPATH:
685 thesaurusdir_path = os::internal_path(lexrc.getString());
688 case RC_HUNSPELLDIR_PATH:
690 hunspelldir_path = os::internal_path(lexrc.getString());
693 case RC_USELASTFILEPOS:
694 lexrc >> use_lastfilepos;
698 lexrc >> load_session;
701 case RC_MOUSE_WHEEL_SPEED:
702 lexrc >> mouse_wheel_speed;
705 case RC_COMPLETION_INLINE_DELAY:
706 lexrc >> completion_inline_delay;
709 case RC_COMPLETION_INLINE_MATH:
710 lexrc >> completion_inline_math;
713 case RC_COMPLETION_INLINE_TEXT:
714 lexrc >> completion_inline_text;
717 case RC_COMPLETION_INLINE_DOTS:
718 lexrc >> completion_inline_dots;
721 case RC_AUTOCORRECTION_MATH:
722 lexrc >> autocorrection_math;
725 case RC_COMPLETION_POPUP_DELAY:
726 lexrc >> completion_popup_delay;
729 case RC_COMPLETION_POPUP_MATH:
730 lexrc >> completion_popup_math;
733 case RC_COMPLETION_POPUP_TEXT:
734 lexrc >> completion_popup_text;
737 case RC_COMPLETION_CURSOR_TEXT:
738 lexrc >> completion_cursor_text;
741 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
742 lexrc >> completion_popup_after_complete;
745 case RC_COMPLETION_MINLENGTH:
746 lexrc >> completion_minlength;
749 case RC_NUMLASTFILES:
750 lexrc >> num_lastfiles;
753 case RC_CHECKLASTFILES:
754 lexrc >> check_lastfiles;
761 case RC_USE_SYSTEM_THEME_ICONS:
762 lexrc >> use_system_theme_icons;
765 case RC_SCREEN_FONT_ROMAN:
767 roman_font_name = lexrc.getString();
768 oldFontFormat(roman_font_name,
773 case RC_SCREEN_FONT_SANS:
775 sans_font_name = lexrc.getString();
776 oldFontFormat(sans_font_name, sans_font_foundry);
780 case RC_SCREEN_FONT_TYPEWRITER:
782 typewriter_font_name = lexrc.getString();
783 oldFontFormat(typewriter_font_name,
784 typewriter_font_foundry);
788 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
789 lexrc >> roman_font_foundry;
792 case RC_SCREEN_FONT_SANS_FOUNDRY:
793 lexrc >> sans_font_foundry;
796 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
797 lexrc >> typewriter_font_foundry;
802 lexrc.printError("Missing color tag.");
805 string lyx_name = lexrc.getString();
808 lexrc.printError("Missing color name for color: `$$Token'");
811 string x11_name = lexrc.getString();
813 ColorCode const col =
814 lcolor.getFromLyXName(lyx_name);
815 if (col == Color_none ||
816 col == Color_inherit ||
820 if (!lcolor.setColor(col, x11_name))
821 LYXERR0("Bad lyxrc set_color for " << lyx_name);
825 case RC_AUTOREGIONDELETE:
826 // Auto region delete defaults to true
827 lexrc >> auto_region_delete;
832 lyxpipes = os::internal_path(lexrc.getString());
835 case RC_CURSOR_FOLLOWS_SCROLLBAR:
836 lexrc >> cursor_follows_scrollbar;
839 case RC_CURSOR_WIDTH:
840 lexrc >> cursor_width;
843 case RC_SCROLL_BELOW_DOCUMENT:
844 lexrc >> scroll_below_document;
847 case RC_PARAGRAPH_MARKERS:
848 lexrc >> paragraph_markers;
851 case RC_MAC_DONTSWAP_CTRL_META:
852 lexrc >> mac_dontswap_ctrl_meta;
855 case RC_MAC_LIKE_CURSOR_MOVEMENT:
856 lexrc >> mac_like_cursor_movement;
859 case RC_MACRO_EDIT_STYLE:
861 switch (lexrc.getInteger()) {
862 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
863 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
864 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
869 case RC_DIALOGS_ICONIFY_WITH_MAIN:
870 lexrc >> dialogs_iconify_with_main;
873 case RC_PLAINTEXT_LINELEN:
874 lexrc >> plaintext_linelen;
876 // Spellchecker settings:
877 case RC_ACCEPT_COMPOUND:
878 lexrc >> spellchecker_accept_compound;
880 case RC_USE_NATIVE_FILEDIALOG:
881 lexrc >> use_native_filedialog;
883 case RC_USE_SYSTEM_COLORS:
884 lexrc >> use_system_colors;
887 lexrc >> use_tooltip;
889 case RC_USE_PIXMAP_CACHE:
890 lexrc >> use_pixmap_cache;
895 case RC_SPELLCHECKER:
896 lexrc >> spellchecker;
899 lexrc >> spellchecker_alt_lang;
902 lexrc >> spellchecker_esc_chars;
904 case RC_SPELLCHECK_CONTINUOUSLY:
905 lexrc >> spellcheck_continuously;
907 case RC_SPELLCHECK_NOTES:
908 lexrc >> spellcheck_notes;
911 lexrc >> make_backup;
913 case RC_SAVE_COMPRESSED:
914 lexrc >> save_compressed;
917 lexrc >> save_origin;
919 case RC_BACKUPDIR_PATH:
921 backupdir_path = os::internal_path(lexrc.getString());
923 case RC_DEFAULT_DECIMAL_POINT:
924 lexrc >> default_decimal_point;
926 case RC_DEFAULT_LENGTH_UNIT:
928 default_length_unit = (Length::UNIT) lexrc.getInteger();
930 case RC_DATE_INSERT_FORMAT:
931 lexrc >> date_insert_format;
933 case RC_LANGUAGE_CUSTOM_PACKAGE:
934 lexrc >> language_custom_package;
936 case RC_LANGUAGE_AUTO_BEGIN:
937 lexrc >> language_auto_begin;
939 case RC_LANGUAGE_AUTO_END:
940 lexrc >> language_auto_end;
942 case RC_LANGUAGE_GLOBAL_OPTIONS:
943 lexrc >> language_global_options;
945 case RC_LANGUAGE_PACKAGE_SELECTION:
947 switch (lexrc.getInteger()) {
949 language_package_selection = LP_AUTO;
952 language_package_selection = LP_BABEL;
955 language_package_selection = LP_CUSTOM;
958 language_package_selection = LP_NONE;
963 case RC_LANGUAGE_COMMAND_BEGIN:
964 lexrc >> language_command_begin;
966 case RC_LANGUAGE_COMMAND_END:
967 lexrc >> language_command_end;
969 case RC_LANGUAGE_COMMAND_LOCAL:
970 lexrc >> language_command_local;
972 case RC_VISUAL_CURSOR:
973 lexrc >> visual_cursor;
975 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
976 lexrc >> close_buffer_with_last_view;
979 lexrc >> auto_number;
981 case RC_MARK_FOREIGN_LANGUAGE:
982 lexrc >> mark_foreign_language;
988 fmt = lexrc.getString();
989 if (lexrc.next(true))
990 command = lexrc.getString();
991 setMover(fmt, command);
996 string from, to, command, flags;
998 from = lexrc.getString();
1000 to = lexrc.getString();
1001 if (lexrc.next(true))
1002 command = lexrc.getString();
1004 flags = lexrc.getString();
1005 if (command.empty())
1006 theConverters().erase(from, to);
1008 theConverters().add(from, to, command, flags);
1011 // compatibility with versions older than 1.4.0 only
1013 string format, command;
1014 lexrc >> format >> command;
1015 theFormats().setViewer(format, command);
1018 case RC_FILEFORMAT: {
1020 string format, extensions, shortcut;
1021 docstring prettyname;
1022 if (!(lexrc >> format >> extensions))
1024 if (ok && lexrc.next(true))
1025 prettyname = lexrc.getDocString();
1029 if(!(lexrc >> shortcut))
1031 string viewer, editor;
1032 if (ok && lexrc.next(true))
1033 viewer = lexrc.getString();
1036 if (ok && lexrc.next(true))
1037 editor = lexrc.getString();
1041 if (!(lexrc >> flags >> mime))
1043 int flgs = Format::none;
1044 while (!flags.empty()) {
1046 flags = split(flags, flag, ',');
1047 if (flag == "document")
1048 flgs |= Format::document;
1049 else if (flag == "vector")
1050 flgs |= Format::vector;
1051 else if (flag == "zipped=native")
1052 flgs |= Format::zipped_native;
1053 else if (flag == "menu=export")
1054 flgs |= Format::export_menu;
1056 LYXERR0("Ignoring unknown flag `"
1057 << flag << "' for format `"
1061 LYXERR0("Syntax error in format " << format);
1062 else if (prettyname.empty()) {
1063 if (theConverters().formatIsUsed(format))
1064 LYXERR0("Can't delete format " << format);
1066 theFormats().erase(format);
1068 theFormats().add(format, extensions, prettyname,
1069 shortcut, viewer, editor, mime, flgs);
1073 case RC_VIEWER_ALTERNATIVES: {
1074 string format, command;
1075 if ((lexrc >> format) && lexrc.next(true)) {
1076 command = lexrc.getString();
1077 viewer_alternatives[format].insert(command);
1081 case RC_EDITOR_ALTERNATIVES: {
1082 string format, command;
1083 if ((lexrc >> format) && lexrc.next(true)) {
1084 command = lexrc.getString();
1085 editor_alternatives[format].insert(command);
1090 case RC_DEFAULT_OTF_VIEW_FORMAT:
1091 lexrc >> default_otf_view_format;
1094 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
1095 lexrc >> default_platex_view_format;
1098 case RC_DEFAULT_VIEW_FORMAT:
1099 lexrc >> default_view_format;
1102 case RC_GUI_LANGUAGE:
1103 lexrc >> gui_language;
1106 case RC_SHOW_BANNER:
1107 lexrc >> show_banner;
1112 string const tmp = lexrc.getString();
1113 if (tmp == "true" || tmp == "on")
1114 preview = PREVIEW_ON;
1115 else if (tmp == "no_math")
1116 preview = PREVIEW_NO_MATH;
1118 preview = PREVIEW_OFF;
1119 if (tmp != "false" && tmp != "off")
1120 LYXERR0("Unrecognized preview status \""
1126 case RC_PREVIEW_HASHED_LABELS:
1127 lexrc >> preview_hashed_labels;
1130 case RC_PREVIEW_SCALE_FACTOR:
1131 lexrc >> preview_scale_factor;
1138 lexrc >> user_email;
1141 case RC_PATH_PREFIX:
1142 lexrc >> path_prefix;
1145 case RC_USE_CONVERTER_CACHE:
1146 lexrc >> use_converter_cache;
1148 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1149 lexrc >> use_converter_needauth_forbidden;
1151 case RC_USE_CONVERTER_NEEDAUTH:
1152 lexrc >> use_converter_needauth;
1154 case RC_CONVERTER_CACHE_MAXAGE:
1155 lexrc >> converter_cache_maxage;
1158 case RC_SORT_LAYOUTS:
1159 lexrc >> sort_layouts;
1161 case RC_GROUP_LAYOUTS:
1162 lexrc >> group_layouts;
1164 case RC_FULL_SCREEN_LIMIT:
1165 lexrc >> full_screen_limit;
1167 case RC_FULL_SCREEN_TOOLBARS:
1168 lexrc >> full_screen_toolbars;
1170 case RC_FULL_SCREEN_SCROLLBAR:
1171 lexrc >> full_screen_scrollbar;
1173 case RC_FULL_SCREEN_STATUSBAR:
1174 lexrc >> full_screen_statusbar;
1176 case RC_FULL_SCREEN_TABBAR:
1177 lexrc >> full_screen_tabbar;
1179 case RC_FULL_SCREEN_MENUBAR:
1180 lexrc >> full_screen_menubar;
1182 case RC_FULL_SCREEN_WIDTH:
1183 lexrc >> full_screen_width;
1185 case RC_OPEN_BUFFERS_IN_TABS:
1186 lexrc >> open_buffers_in_tabs;
1188 case RC_SINGLE_CLOSE_TAB_BUTTON:
1189 lexrc >> single_close_tab_button;
1191 case RC_SINGLE_INSTANCE:
1192 lexrc >> single_instance;
1193 if (run_mode == PREFERRED)
1194 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1196 case RC_FORWARD_SEARCH_DVI:
1197 if (lexrc.next(true))
1198 forward_search_dvi = lexrc.getString();
1200 case RC_FORWARD_SEARCH_PDF:
1201 if (lexrc.next(true))
1202 forward_search_pdf = lexrc.getString();
1204 case RC_EXPORT_OVERWRITE:
1206 string const tmp = lexrc.getString();
1207 if (tmp == "all" || tmp == "true")
1208 export_overwrite = ALL_FILES;
1209 else if (tmp == "main")
1210 export_overwrite = MAIN_FILE;
1212 export_overwrite = NO_FILES;
1213 if (tmp != "ask" && tmp != "false")
1214 LYXERR0("Unrecognized export_overwrite status \""
1219 case RC_SCROLL_WHEEL_ZOOM:
1221 string const tmp = lexrc.getString();
1223 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1224 else if (tmp == "shift")
1225 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1226 else if (tmp == "alt")
1227 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1229 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1230 if (tmp != "off" && tmp != "false")
1231 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1237 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1238 lexrc >> mouse_middlebutton_paste;
1242 break; // this is just a dummy
1245 // This is triggered the first time through the loop unless
1246 // we hit a format tag.
1247 if (check_format && format != LYXRC_FILEFORMAT)
1248 return FormatMismatch;
1251 /// Update converters data-structures
1252 theConverters().update(theFormats());
1253 theConverters().buildGraph();
1254 theBufferList().invalidateConverterCache();
1260 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1262 ofstream ofs(filename.toFilesystemEncoding().c_str());
1264 write(ofs, ignore_system_lyxrc);
1268 void LyXRC::print() const
1270 if (lyxerr.debugging())
1271 write(lyxerr, false);
1279 typedef pair<string, SpecialisedMover> Data;
1281 SameMover(Data const & comparison)
1282 : comparison_(comparison) {}
1284 bool operator()(Data const & data) const
1286 return data.first == comparison_.first &&
1287 data.second.command() == comparison_.second.command();
1297 // Escape \ and " so that LyXLex can read the string later
1298 string escapeCommand(string const & str) {
1299 return subst(subst(str , "\\", "\\\\"),
1306 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1308 LyXRCTags tag = RC_LAST;
1310 if (!name.empty()) {
1311 for (int i = 0; i != lyxrcCount; ++i)
1312 if ("\\" + name == lyxrcTags[i].tag)
1313 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1317 os << "# LyX " << lyx_version
1318 << " generated this file. If you want to make your own\n"
1319 << "# modifications you should do them from inside LyX and save.\n\n"
1320 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1322 // Why the switch you might ask. It is a trick to ensure that all
1323 // the elements in the LyXRCTags enum are handled. As you can see
1324 // there are no breaks at all. So it is just a huge fall-through.
1325 // The nice thing is that we will get a warning from the compiler
1326 // if we forget an element.
1330 // input/include files are not done here
1331 case RC_LYXRCFORMAT:
1333 if (ignore_system_lyxrc ||
1334 bind_file != system_lyxrc.bind_file) {
1335 string const path = os::external_path(bind_file);
1336 os << "\\bind_file \"" << path << "\"\n";
1342 if (ignore_system_lyxrc ||
1343 def_file != system_lyxrc.def_file) {
1344 string const path = os::external_path(def_file);
1345 os << "\\def_file \"" << path << "\"\n";
1354 << "# MISC SECTION ######################################\n"
1356 // bind files are not done here.
1358 case RC_PATH_PREFIX:
1359 if (ignore_system_lyxrc ||
1360 path_prefix != system_lyxrc.path_prefix) {
1361 os << "\\path_prefix \"" << path_prefix << "\"\n";
1367 if (ignore_system_lyxrc ||
1368 ui_file != system_lyxrc.ui_file) {
1369 string const path = os::external_path(ui_file);
1370 os << "\\ui_file \"" << path << "\"\n";
1375 case RC_AUTOREGIONDELETE:
1376 if (ignore_system_lyxrc ||
1377 auto_region_delete != system_lyxrc.auto_region_delete) {
1378 os << "# Set to false to inhibit automatic replacement of\n"
1379 << "# the current selection.\n"
1380 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1386 case RC_AUTORESET_OPTIONS:
1387 if (ignore_system_lyxrc ||
1388 auto_reset_options != system_lyxrc.auto_reset_options) {
1389 os << "# Set to false to inhibit automatic reset of\n"
1390 << "# the class options to defaults on class change.\n"
1391 << "\\auto_reset_options "
1392 << convert<string>(auto_reset_options)
1399 if (ignore_system_lyxrc ||
1400 autosave != system_lyxrc.autosave) {
1401 os << "# The time interval between auto-saves in seconds.\n"
1402 << "\\autosave " << autosave << '\n';
1407 case RC_DISPLAY_GRAPHICS:
1408 if (ignore_system_lyxrc ||
1409 display_graphics != system_lyxrc.display_graphics) {
1410 os << "# Display graphics within LyX\n"
1412 << "\\display_graphics "
1413 << (display_graphics ? "true" : "false")
1419 case RC_SORT_LAYOUTS:
1420 if (ignore_system_lyxrc ||
1421 sort_layouts != system_lyxrc.sort_layouts) {
1422 os << "# Sort layouts alphabetically.\n"
1423 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1428 case RC_GROUP_LAYOUTS:
1429 if (ignore_system_lyxrc ||
1430 group_layouts != system_lyxrc.group_layouts) {
1431 os << "# Group layouts by their category.\n"
1432 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1437 case RC_VIEWDVI_PAPEROPTION:
1438 if (ignore_system_lyxrc ||
1439 view_dvi_paper_option
1440 != system_lyxrc.view_dvi_paper_option) {
1441 os << "# Options used to specify paper size to the\n"
1442 << "# view_dvi_command (e.g. -paper)\n"
1443 << "\\view_dvi_paper_option \""
1444 << view_dvi_paper_option << "\"\n";
1449 case RC_CHKTEX_COMMAND:
1450 if (ignore_system_lyxrc ||
1451 chktex_command != system_lyxrc.chktex_command) {
1452 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1457 case RC_BIBTEX_ALTERNATIVES: {
1458 CommandSet::const_iterator it = bibtex_alternatives.begin();
1459 CommandSet::const_iterator end = bibtex_alternatives.end();
1460 for ( ; it != end; ++it) {
1461 if (ignore_system_lyxrc
1462 || !system_lyxrc.bibtex_alternatives.count(*it))
1463 os << "\\bibtex_alternatives \""
1470 case RC_BIBTEX_COMMAND:
1471 if (ignore_system_lyxrc ||
1472 bibtex_command != system_lyxrc.bibtex_command) {
1473 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1478 case RC_JBIBTEX_COMMAND:
1479 if (ignore_system_lyxrc ||
1480 jbibtex_command != system_lyxrc.jbibtex_command) {
1481 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1486 case RC_JBIBTEX_ALTERNATIVES: {
1487 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1488 CommandSet::const_iterator end = jbibtex_alternatives.end();
1489 for ( ; it != end; ++it) {
1490 if (ignore_system_lyxrc
1491 || !system_lyxrc.jbibtex_alternatives.count(*it))
1492 os << "\\jbibtex_alternatives \""
1499 case RC_INDEX_ALTERNATIVES: {
1500 CommandSet::const_iterator it = index_alternatives.begin();
1501 CommandSet::const_iterator end = index_alternatives.end();
1502 for ( ; it != end; ++it) {
1503 if (ignore_system_lyxrc
1504 || !system_lyxrc.index_alternatives.count(*it))
1505 os << "\\index_alternatives \""
1512 case RC_INDEX_COMMAND:
1513 if (ignore_system_lyxrc ||
1514 index_command != system_lyxrc.index_command) {
1515 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1520 case RC_JINDEX_COMMAND:
1521 if (ignore_system_lyxrc ||
1522 jindex_command != system_lyxrc.jindex_command) {
1523 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1528 case RC_SPLITINDEX_COMMAND:
1529 if (ignore_system_lyxrc ||
1530 splitindex_command != system_lyxrc.splitindex_command) {
1531 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1536 case RC_NOMENCL_COMMAND:
1537 if (ignore_system_lyxrc ||
1538 nomencl_command != system_lyxrc.nomencl_command) {
1539 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1544 case RC_PYGMENTIZE_COMMAND:
1545 if (ignore_system_lyxrc ||
1546 pygmentize_command != system_lyxrc.pygmentize_command) {
1547 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1552 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1553 // Don't write this setting to the preferences file,
1554 // but allow temporary changes (bug 7557).
1555 if (ignore_system_lyxrc) {
1556 os << "\\tex_expects_windows_paths "
1557 << convert<string>(windows_style_tex_paths) << '\n';
1562 case RC_TEX_ALLOWS_SPACES:
1563 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1564 os << "\\tex_allows_spaces "
1565 << convert<string>(tex_allows_spaces) << '\n';
1571 if (ignore_system_lyxrc ||
1572 use_kbmap != system_lyxrc.use_kbmap) {
1573 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1578 case RC_KBMAP_PRIMARY:
1579 if (ignore_system_lyxrc ||
1580 primary_kbmap != system_lyxrc.primary_kbmap) {
1581 string const path = os::external_path(primary_kbmap);
1582 os << "\\kbmap_primary \"" << path << "\"\n";
1587 case RC_KBMAP_SECONDARY:
1588 if (ignore_system_lyxrc ||
1589 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1590 string const path = os::external_path(secondary_kbmap);
1591 os << "\\kbmap_secondary \"" << path << "\"\n";
1597 if (ignore_system_lyxrc ||
1598 lyxpipes != system_lyxrc.lyxpipes) {
1599 string const path = os::external_path(lyxpipes);
1600 os << "\\serverpipe \"" << path << "\"\n";
1605 case RC_DATE_INSERT_FORMAT:
1606 if (ignore_system_lyxrc ||
1607 date_insert_format != system_lyxrc.date_insert_format) {
1608 os << "\\date_insert_format \"" << date_insert_format
1615 os << "\\user_name \"" << user_name << "\"\n";
1620 os << "\\user_email \"" << user_email << "\"\n";
1624 case RC_SHOW_BANNER:
1625 if (ignore_system_lyxrc ||
1626 show_banner != system_lyxrc.show_banner) {
1627 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1633 if (ignore_system_lyxrc ||
1634 preview != system_lyxrc.preview) {
1640 case PREVIEW_NO_MATH:
1647 os << "\\preview " << status << '\n';
1652 case RC_PREVIEW_HASHED_LABELS:
1653 if (ignore_system_lyxrc ||
1654 preview_hashed_labels !=
1655 system_lyxrc.preview_hashed_labels) {
1656 os << "\\preview_hashed_labels "
1657 << convert<string>(preview_hashed_labels) << '\n';
1662 case RC_PREVIEW_SCALE_FACTOR:
1663 if (ignore_system_lyxrc ||
1664 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1665 os << "\\preview_scale_factor "
1666 << preview_scale_factor << '\n';
1671 case RC_USE_CONVERTER_CACHE:
1672 if (ignore_system_lyxrc ||
1673 use_converter_cache != system_lyxrc.use_converter_cache) {
1674 os << "\\use_converter_cache "
1675 << convert<string>(use_converter_cache) << '\n';
1680 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1681 if (ignore_system_lyxrc ||
1682 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1683 os << "\\use_converter_needauth_forbidden "
1684 << convert<string>(use_converter_needauth_forbidden) << '\n';
1689 case RC_USE_CONVERTER_NEEDAUTH:
1690 if (ignore_system_lyxrc ||
1691 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1692 os << "\\use_converter_needauth "
1693 << convert<string>(use_converter_needauth) << '\n';
1698 case RC_CONVERTER_CACHE_MAXAGE:
1699 if (ignore_system_lyxrc ||
1700 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1701 os << "\\converter_cache_maxage "
1702 << converter_cache_maxage << '\n';
1708 << "# SCREEN & FONTS SECTION ############################\n"
1712 if (ignore_system_lyxrc ||
1713 icon_set != system_lyxrc.icon_set) {
1714 os << "\\icon_set \"" << icon_set
1720 case RC_USE_SYSTEM_THEME_ICONS:
1721 if (ignore_system_lyxrc ||
1722 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1723 os << "\\use_system_theme_icons "
1724 << convert<string>(use_system_theme_icons)
1731 if (ignore_system_lyxrc ||
1732 dpi != system_lyxrc.dpi) {
1733 os << "\\screen_dpi " << dpi << '\n';
1738 case RC_SCREEN_ZOOM:
1739 if (ignore_system_lyxrc ||
1740 defaultZoom != system_lyxrc.defaultZoom) {
1741 os << "\\screen_zoom " << defaultZoom << '\n';
1746 case RC_GEOMETRY_SESSION:
1747 if (ignore_system_lyxrc ||
1748 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1749 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1755 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1756 if (ignore_system_lyxrc ||
1757 cursor_follows_scrollbar
1758 != system_lyxrc.cursor_follows_scrollbar) {
1759 os << "\\cursor_follows_scrollbar "
1760 << convert<string>(cursor_follows_scrollbar) << '\n';
1765 case RC_CURSOR_WIDTH:
1766 if (ignore_system_lyxrc ||
1768 != system_lyxrc.cursor_width) {
1769 os << "\\cursor_width "
1770 << cursor_width << '\n';
1775 case RC_SCROLL_BELOW_DOCUMENT:
1776 if (ignore_system_lyxrc ||
1777 scroll_below_document
1778 != system_lyxrc.scroll_below_document) {
1779 os << "\\scroll_below_document "
1780 << convert<string>(scroll_below_document) << '\n';
1785 case RC_PARAGRAPH_MARKERS:
1786 if (ignore_system_lyxrc ||
1788 != system_lyxrc.paragraph_markers) {
1789 os << "\\paragraph_markers "
1790 << convert<string>(paragraph_markers) << '\n';
1795 case RC_MAC_DONTSWAP_CTRL_META:
1796 if (ignore_system_lyxrc ||
1797 mac_dontswap_ctrl_meta
1798 != system_lyxrc.mac_dontswap_ctrl_meta) {
1799 os << "\\mac_dontswap_ctrl_meta "
1800 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1805 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1806 if (ignore_system_lyxrc ||
1807 mac_like_cursor_movement
1808 != system_lyxrc.mac_like_cursor_movement) {
1809 os << "\\mac_like_cursor_movement "
1810 << convert<string>(mac_like_cursor_movement) << '\n';
1815 case RC_MACRO_EDIT_STYLE:
1816 if (ignore_system_lyxrc ||
1818 != system_lyxrc.macro_edit_style) {
1819 os << "\\macro_edit_style ";
1820 switch (macro_edit_style) {
1821 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1822 case MACRO_EDIT_INLINE: os << "1\n"; break;
1823 case MACRO_EDIT_LIST: os << "2\n"; break;
1829 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1830 if (ignore_system_lyxrc ||
1831 dialogs_iconify_with_main
1832 != system_lyxrc.dialogs_iconify_with_main) {
1833 os << "\\dialogs_iconify_with_main "
1834 << convert<string>(dialogs_iconify_with_main) << '\n';
1839 case RC_SCREEN_FONT_ROMAN:
1840 if (ignore_system_lyxrc ||
1841 roman_font_name != system_lyxrc.roman_font_name) {
1842 os << "\\screen_font_roman \"" << roman_font_name
1848 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1849 if (ignore_system_lyxrc ||
1850 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1851 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1857 case RC_SCREEN_FONT_SANS:
1858 if (ignore_system_lyxrc ||
1859 sans_font_name != system_lyxrc.sans_font_name) {
1860 os << "\\screen_font_sans \"" << sans_font_name
1866 case RC_SCREEN_FONT_SANS_FOUNDRY:
1867 if (ignore_system_lyxrc ||
1868 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1869 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1875 case RC_SCREEN_FONT_TYPEWRITER:
1876 if (ignore_system_lyxrc ||
1877 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1878 os << "\\screen_font_typewriter \""
1879 << typewriter_font_name << "\"\n";
1884 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1885 if (ignore_system_lyxrc ||
1886 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1887 os << "\\screen_font_typewriter_foundry \""
1888 << typewriter_font_foundry << "\"\n";
1893 case RC_SCREEN_FONT_SCALABLE:
1894 if (ignore_system_lyxrc ||
1895 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1896 os << "\\screen_font_scalable "
1897 << convert<string>(use_scalable_fonts)
1903 case RC_SCREEN_FONT_SIZES:
1904 if (ignore_system_lyxrc ||
1905 font_sizes[FONT_SIZE_TINY]
1906 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1907 font_sizes[FONT_SIZE_SCRIPT]
1908 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1909 font_sizes[FONT_SIZE_FOOTNOTE]
1910 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1911 font_sizes[FONT_SIZE_SMALL]
1912 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1913 font_sizes[FONT_SIZE_NORMAL]
1914 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1915 font_sizes[FONT_SIZE_LARGE]
1916 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1917 font_sizes[FONT_SIZE_LARGER]
1918 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1919 font_sizes[FONT_SIZE_LARGEST]
1920 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1921 font_sizes[FONT_SIZE_HUGE]
1922 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1923 font_sizes[FONT_SIZE_HUGER]
1924 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1925 streamsize old_prec = os.precision();
1926 os.setf(ios::fixed);
1928 os << "\\screen_font_sizes"
1929 << ' ' << font_sizes[FONT_SIZE_TINY]
1930 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1931 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1932 << ' ' << font_sizes[FONT_SIZE_SMALL]
1933 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1934 << ' ' << font_sizes[FONT_SIZE_LARGE]
1935 << ' ' << font_sizes[FONT_SIZE_LARGER]
1936 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1937 << ' ' << font_sizes[FONT_SIZE_HUGE]
1938 << ' ' << font_sizes[FONT_SIZE_HUGER]
1940 os.precision(old_prec);
1941 os.unsetf(ios::fixed);
1946 case RC_FULL_SCREEN_LIMIT:
1947 if (ignore_system_lyxrc ||
1948 full_screen_limit != system_lyxrc.full_screen_limit) {
1949 os << "\\fullscreen_limit "
1950 << convert<string>(full_screen_limit)
1956 case RC_FULL_SCREEN_TOOLBARS:
1957 if (ignore_system_lyxrc ||
1958 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1959 os << "\\fullscreen_toolbars "
1960 << convert<string>(full_screen_toolbars)
1966 case RC_FULL_SCREEN_SCROLLBAR:
1967 if (ignore_system_lyxrc ||
1968 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1969 os << "\\fullscreen_scrollbar "
1970 << convert<string>(full_screen_scrollbar)
1976 case RC_FULL_SCREEN_STATUSBAR:
1977 if (ignore_system_lyxrc ||
1978 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1979 os << "\\fullscreen_statusbar "
1980 << convert<string>(full_screen_statusbar)
1986 case RC_FULL_SCREEN_TABBAR:
1987 if (ignore_system_lyxrc ||
1988 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1989 os << "\\fullscreen_tabbar "
1990 << convert<string>(full_screen_tabbar)
1996 case RC_FULL_SCREEN_MENUBAR:
1997 if (ignore_system_lyxrc ||
1998 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1999 os << "\\fullscreen_menubar "
2000 << convert<string>(full_screen_menubar)
2006 case RC_FULL_SCREEN_WIDTH:
2007 if (ignore_system_lyxrc ||
2008 full_screen_width != system_lyxrc.full_screen_width) {
2009 os << "\\fullscreen_width "
2010 << convert<string>(full_screen_width)
2016 case RC_OPEN_BUFFERS_IN_TABS:
2017 if (ignore_system_lyxrc ||
2018 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2019 os << "\\open_buffers_in_tabs "
2020 << convert<string>(open_buffers_in_tabs)
2026 case RC_SINGLE_CLOSE_TAB_BUTTON:
2027 if (ignore_system_lyxrc ||
2028 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2029 os << "\\single_close_tab_button "
2030 << convert<string>(single_close_tab_button)
2036 case RC_SINGLE_INSTANCE:
2037 if (ignore_system_lyxrc ||
2038 single_instance != system_lyxrc.single_instance) {
2039 os << "\\single_instance "
2040 << convert<string>(single_instance)
2046 case RC_FORWARD_SEARCH_DVI:
2047 if (ignore_system_lyxrc ||
2048 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2049 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2054 case RC_FORWARD_SEARCH_PDF:
2055 if (ignore_system_lyxrc ||
2056 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2057 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2063 << "# COLOR SECTION ###################################\n"
2068 for (int i = 0; i < Color_ignore; ++i) {
2069 ColorCode lc = static_cast<ColorCode>(i);
2070 string const col = lcolor.getX11Name(lc);
2071 if (ignore_system_lyxrc
2072 || col != system_lcolor.getX11Name(lc)) {
2073 os << "\\set_color \""
2074 << lcolor.getLyXName(lc) << "\" \""
2082 << "# PRINTER SECTION ###################################\n"
2086 case RC_PRINTLANDSCAPEFLAG:
2087 if (ignore_system_lyxrc ||
2088 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2089 os << "\\print_landscape_flag \"" << print_landscape_flag
2095 case RC_PRINTPAPERFLAG:
2096 if (ignore_system_lyxrc ||
2097 print_paper_flag != system_lyxrc.print_paper_flag) {
2098 os << "\\print_paper_flag \"" << print_paper_flag
2104 case RC_PRINTPAPERDIMENSIONFLAG:
2105 if (ignore_system_lyxrc ||
2106 print_paper_dimension_flag
2107 != system_lyxrc.print_paper_dimension_flag) {
2108 os << "\\print_paper_dimension_flag \""
2109 << print_paper_dimension_flag << "\"\n";
2115 << "# TEX SECTION #######################################\n"
2119 case RC_TEXINPUTS_PREFIX:
2120 if (ignore_system_lyxrc ||
2121 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2122 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2127 case RC_FONT_ENCODING:
2128 if (ignore_system_lyxrc ||
2129 fontenc != system_lyxrc.fontenc) {
2130 os << "\\font_encoding \"" << fontenc << "\"\n";
2136 << "# FILE SECTION ######################################\n"
2140 case RC_DOCUMENTPATH:
2141 if (ignore_system_lyxrc ||
2142 document_path != system_lyxrc.document_path) {
2143 string const path = os::external_path(document_path);
2144 os << "\\document_path \"" << path << "\"\n";
2149 case RC_USELASTFILEPOS:
2150 if (ignore_system_lyxrc ||
2151 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2152 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2158 case RC_LOADSESSION:
2159 if (ignore_system_lyxrc ||
2160 load_session != system_lyxrc.load_session) {
2161 os << "\\load_session " << convert<string>(load_session)
2167 case RC_MOUSE_WHEEL_SPEED:
2168 if (ignore_system_lyxrc ||
2169 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2170 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2175 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2176 if (ignore_system_lyxrc ||
2177 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2178 os << "\\mouse_middlebutton_paste "
2179 << convert<string>(mouse_middlebutton_paste) << '\n';
2184 case RC_COMPLETION_INLINE_DELAY:
2185 if (ignore_system_lyxrc ||
2186 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2187 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2192 case RC_COMPLETION_INLINE_MATH:
2193 if (ignore_system_lyxrc ||
2194 completion_inline_math != system_lyxrc.completion_inline_math) {
2195 os << "\\completion_inline_math "
2196 << convert<string>(completion_inline_math) << '\n';
2201 case RC_COMPLETION_INLINE_TEXT:
2202 if (ignore_system_lyxrc ||
2203 completion_inline_text != system_lyxrc.completion_inline_text) {
2204 os << "\\completion_inline_text "
2205 << convert<string>(completion_inline_text) << '\n';
2210 case RC_COMPLETION_INLINE_DOTS:
2211 if (ignore_system_lyxrc ||
2212 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2213 os << "\\completion_inline_dots "
2214 << convert<string>(completion_inline_dots) << '\n';
2219 case RC_AUTOCORRECTION_MATH:
2220 if (ignore_system_lyxrc ||
2221 autocorrection_math != system_lyxrc.autocorrection_math) {
2222 os << "\\autocorrection_math "
2223 << convert<string>(autocorrection_math) << '\n';
2228 case RC_COMPLETION_POPUP_DELAY:
2229 if (ignore_system_lyxrc ||
2230 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2231 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2236 case RC_COMPLETION_POPUP_MATH:
2237 if (ignore_system_lyxrc ||
2238 completion_popup_math != system_lyxrc.completion_popup_math) {
2239 os << "\\completion_popup_math "
2240 << convert<string>(completion_popup_math) << '\n';
2245 case RC_COMPLETION_POPUP_TEXT:
2246 if (ignore_system_lyxrc ||
2247 completion_popup_text != system_lyxrc.completion_popup_text) {
2248 os << "\\completion_popup_text "
2249 << convert<string>(completion_popup_text) << '\n';
2254 case RC_COMPLETION_CURSOR_TEXT:
2255 if (ignore_system_lyxrc ||
2256 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2257 os << "\\completion_cursor_text "
2258 << convert<string>(completion_cursor_text) << '\n';
2263 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2264 if (ignore_system_lyxrc ||
2265 completion_popup_after_complete
2266 != system_lyxrc.completion_popup_after_complete) {
2267 os << "\\completion_popup_after_complete "
2268 << convert<string>(completion_popup_after_complete) << '\n';
2273 case RC_COMPLETION_MINLENGTH:
2274 if (ignore_system_lyxrc ||
2275 completion_minlength != system_lyxrc.completion_minlength) {
2276 os << "\\completion_minlength " << convert<string>(completion_minlength)
2282 case RC_NUMLASTFILES:
2283 if (ignore_system_lyxrc ||
2284 num_lastfiles != system_lyxrc.num_lastfiles) {
2285 os << "\\num_lastfiles " << num_lastfiles << '\n';
2290 case RC_CHECKLASTFILES:
2291 if (ignore_system_lyxrc ||
2292 check_lastfiles != system_lyxrc.check_lastfiles) {
2293 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2299 case RC_EXAMPLEPATH:
2300 if (ignore_system_lyxrc ||
2301 example_path != system_lyxrc.example_path) {
2302 string const path = os::external_path(example_path);
2303 os << "\\example_path \"" << path << "\"\n";
2308 case RC_TEMPLATEPATH:
2309 if (ignore_system_lyxrc ||
2310 template_path != system_lyxrc.template_path) {
2311 string const path = os::external_path(template_path);
2312 os << "\\template_path \"" << path << "\"\n";
2317 case RC_TEMPDIRPATH:
2318 if (ignore_system_lyxrc ||
2319 tempdir_path != system_lyxrc.tempdir_path) {
2320 string const path = os::external_path(tempdir_path);
2321 os << "\\tempdir_path \"" << path << "\"\n";
2326 case RC_THESAURUSDIRPATH:
2327 if (ignore_system_lyxrc ||
2328 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2329 string const path = os::external_path(thesaurusdir_path);
2330 os << "\\thesaurusdir_path \"" << path << "\"\n";
2335 case RC_HUNSPELLDIR_PATH:
2336 if (ignore_system_lyxrc ||
2337 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2338 string const path = os::external_path(hunspelldir_path);
2339 os << "\\hunspelldir_path \"" << path << "\"\n";
2344 case RC_PLAINTEXT_LINELEN:
2345 if (ignore_system_lyxrc ||
2346 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2347 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2352 case RC_MAKE_BACKUP:
2353 if (ignore_system_lyxrc ||
2354 make_backup != system_lyxrc.make_backup) {
2355 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2360 case RC_SAVE_COMPRESSED:
2361 if (ignore_system_lyxrc ||
2362 save_compressed != system_lyxrc.save_compressed) {
2363 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2368 case RC_SAVE_ORIGIN:
2369 if (ignore_system_lyxrc ||
2370 save_origin != system_lyxrc.save_origin) {
2371 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2376 case RC_BACKUPDIR_PATH:
2377 if (ignore_system_lyxrc ||
2378 backupdir_path != system_lyxrc.backupdir_path) {
2379 string const path = os::external_path(backupdir_path);
2380 os << "\\backupdir_path \"" << path << "\"\n";
2386 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2390 << "# SPELLCHECKER SECTION ##############################\n"
2394 case RC_ACCEPT_COMPOUND:
2395 if (ignore_system_lyxrc ||
2396 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2397 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2404 if (ignore_system_lyxrc ||
2405 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2406 os << "\\alternate_language \"" << spellchecker_alt_lang
2413 if (ignore_system_lyxrc ||
2414 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2415 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2420 case RC_USE_NATIVE_FILEDIALOG:
2421 if (ignore_system_lyxrc ||
2422 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2423 os << "\\use_native_filedialog "
2424 << convert<string>(use_native_filedialog)
2430 case RC_USE_SYSTEM_COLORS:
2431 if (ignore_system_lyxrc ||
2432 use_system_colors != system_lyxrc.use_system_colors) {
2433 os << "\\use_system_colors "
2434 << convert<string>(use_system_colors)
2440 case RC_USE_TOOLTIP:
2441 if (ignore_system_lyxrc ||
2442 use_tooltip != system_lyxrc.use_tooltip) {
2443 os << "\\use_tooltip "
2444 << convert<string>(use_tooltip)
2450 case RC_USE_PIXMAP_CACHE:
2451 if (ignore_system_lyxrc ||
2452 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2453 os << "\\use_pixmap_cache "
2454 << convert<string>(use_pixmap_cache)
2461 if (ignore_system_lyxrc ||
2462 use_qimage != system_lyxrc.use_qimage) {
2463 os << "\\use_qimage "
2464 << convert<string>(use_qimage)
2471 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2475 case RC_DEFAULT_DECIMAL_POINT:
2476 if (ignore_system_lyxrc ||
2477 default_decimal_point != system_lyxrc.default_decimal_point) {
2478 os << "\\default_decimal_point " << default_decimal_point << '\n';
2483 case RC_DEFAULT_LENGTH_UNIT:
2484 if (ignore_system_lyxrc ||
2485 default_length_unit != system_lyxrc.default_length_unit) {
2486 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2491 case RC_SPELLCHECKER:
2492 if (ignore_system_lyxrc ||
2493 spellchecker != system_lyxrc.spellchecker) {
2494 os << "\\spellchecker " << spellchecker << '\n';
2499 case RC_SPELLCHECK_CONTINUOUSLY:
2500 if (ignore_system_lyxrc ||
2501 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2502 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2508 case RC_SPELLCHECK_NOTES:
2509 if (ignore_system_lyxrc ||
2510 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2511 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2517 case RC_VISUAL_CURSOR:
2518 if (ignore_system_lyxrc ||
2519 visual_cursor != system_lyxrc.visual_cursor) {
2520 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2525 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2526 if (ignore_system_lyxrc ||
2527 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2528 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2529 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2534 case RC_LANGUAGE_CUSTOM_PACKAGE:
2535 if (ignore_system_lyxrc ||
2536 language_custom_package != system_lyxrc.language_custom_package) {
2537 os << "\\language_custom_package \"" << language_custom_package
2543 case RC_LANGUAGE_GLOBAL_OPTIONS:
2544 if (ignore_system_lyxrc ||
2545 language_global_options
2546 != system_lyxrc.language_global_options) {
2547 os << "\\language_global_options \""
2548 << convert<string>(language_global_options)
2554 case RC_LANGUAGE_PACKAGE_SELECTION:
2555 if (ignore_system_lyxrc ||
2556 language_package_selection != system_lyxrc.language_package_selection) {
2557 os << "\\language_package_selection ";
2558 switch (language_package_selection) {
2576 case RC_LANGUAGE_COMMAND_BEGIN:
2577 if (ignore_system_lyxrc ||
2578 language_command_begin
2579 != system_lyxrc.language_command_begin) {
2580 os << "\\language_command_begin \""
2581 << language_command_begin
2587 case RC_LANGUAGE_COMMAND_END:
2588 if (ignore_system_lyxrc ||
2589 language_command_end
2590 != system_lyxrc.language_command_end) {
2591 os << "\\language_command_end \"" << language_command_end
2597 case RC_LANGUAGE_COMMAND_LOCAL:
2598 if (ignore_system_lyxrc ||
2599 language_command_local
2600 != system_lyxrc.language_command_local) {
2601 os << "\\language_command_local \""
2602 << language_command_local
2608 case RC_LANGUAGE_AUTO_BEGIN:
2609 if (ignore_system_lyxrc ||
2610 language_auto_begin != system_lyxrc.language_auto_begin) {
2611 os << "\\language_auto_begin "
2612 << convert<string>(language_auto_begin) << '\n';
2617 case RC_LANGUAGE_AUTO_END:
2618 if (ignore_system_lyxrc ||
2619 language_auto_end != system_lyxrc.language_auto_end) {
2620 os << "\\language_auto_end "
2621 << convert<string>(language_auto_end) << '\n';
2626 case RC_MARK_FOREIGN_LANGUAGE:
2627 if (ignore_system_lyxrc ||
2628 mark_foreign_language
2629 != system_lyxrc.mark_foreign_language) {
2630 os << "\\mark_foreign_language " <<
2631 convert<string>(mark_foreign_language) << '\n';
2637 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2641 case RC_AUTO_NUMBER:
2642 if (ignore_system_lyxrc ||
2643 auto_number != system_lyxrc.auto_number) {
2644 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2649 case RC_GUI_LANGUAGE:
2650 if (ignore_system_lyxrc ||
2651 gui_language != system_lyxrc.gui_language) {
2652 os << "\\gui_language " << gui_language << '\n';
2657 case RC_EXPORT_OVERWRITE:
2658 if (ignore_system_lyxrc ||
2659 export_overwrite != system_lyxrc.export_overwrite) {
2661 switch (export_overwrite) {
2672 os << "\\export_overwrite " << status << '\n';
2677 case RC_SCROLL_WHEEL_ZOOM:
2678 if (ignore_system_lyxrc ||
2679 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2681 switch (scroll_wheel_zoom) {
2682 case SCROLL_WHEEL_ZOOM_OFF:
2685 case SCROLL_WHEEL_ZOOM_CTRL:
2688 case SCROLL_WHEEL_ZOOM_SHIFT:
2691 case SCROLL_WHEEL_ZOOM_ALT:
2695 os << "\\scroll_wheel_zoom " << status << '\n';
2701 << "# FORMATS SECTION ##########################\n"
2706 // New/modified formats
2707 for (Formats::const_iterator cit = theFormats().begin();
2708 cit != theFormats().end(); ++cit) {
2709 Format const * format =
2710 theSystemFormats().getFormat(cit->name());
2712 format->extensions() != cit->extensions() ||
2713 format->prettyname() != cit->prettyname() ||
2714 format->shortcut() != cit->shortcut() ||
2715 format->viewer() != cit->viewer() ||
2716 format->editor() != cit->editor() ||
2717 format->documentFormat() != cit->documentFormat() ||
2718 format->vectorFormat() != cit->vectorFormat() ||
2719 format->inExportMenu() != cit->inExportMenu() ||
2720 format->mime() != cit->mime()) {
2721 os << "\\format \"" << cit->name() << "\" \""
2722 << cit->extensions() << "\" \""
2723 << to_utf8(cit->prettyname()) << "\" \""
2724 << cit->shortcut() << "\" \""
2725 << escapeCommand(cit->viewer()) << "\" \""
2726 << escapeCommand(cit->editor()) << "\" \"";
2727 vector<string> flags;
2728 if (cit->documentFormat())
2729 flags.push_back("document");
2730 if (cit->vectorFormat())
2731 flags.push_back("vector");
2732 if (cit->zippedNative())
2733 flags.push_back("zipped=native");
2734 if (cit->inExportMenu())
2735 flags.push_back("menu=export");
2737 os << getStringFromVector(flags);
2738 os << "\" \"" << cit->mime() << "\"\n";
2742 // Look for deleted formats
2743 for (Formats::const_iterator cit = theSystemFormats().begin();
2744 cit != theSystemFormats().end(); ++cit)
2745 if (!theFormats().getFormat(cit->name()))
2746 os << "\\format \"" << cit->name()
2747 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2751 case RC_VIEWER_ALTERNATIVES: {
2752 Alternatives::const_iterator it = viewer_alternatives.begin();
2753 Alternatives::const_iterator const en = viewer_alternatives.end();
2754 Alternatives::const_iterator const sysend =
2755 system_lyxrc.viewer_alternatives.end();
2756 for (; it != en; ++it) {
2757 string const & fmt = it->first;
2758 CommandSet const & cmd = it->second;
2759 CommandSet::const_iterator sit = cmd.begin();
2760 CommandSet::const_iterator const sen = cmd.end();
2761 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2762 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2763 system_lyxrc.viewer_alternatives.find(fmt);
2764 for (; sit != sen; ++sit) {
2765 string const & cmd = *sit;
2766 if (ignore_system_lyxrc
2767 || sysfmt == sysend // format not found
2768 || sysfmt->second.count(cmd) == 0 // this command not found
2770 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2777 case RC_EDITOR_ALTERNATIVES: {
2778 Alternatives::const_iterator it = editor_alternatives.begin();
2779 Alternatives::const_iterator const en = editor_alternatives.end();
2780 Alternatives::const_iterator const sysend =
2781 system_lyxrc.editor_alternatives.end();
2782 for (; it != en; ++it) {
2783 string const & fmt = it->first;
2784 CommandSet const & cmd = it->second;
2785 CommandSet::const_iterator sit = cmd.begin();
2786 CommandSet::const_iterator const sen = cmd.end();
2787 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2788 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2789 system_lyxrc.editor_alternatives.find(fmt);
2790 for (; sit != sen; ++sit) {
2791 string const & cmd = *sit;
2792 if (ignore_system_lyxrc
2793 || sysfmt == sysend // format not found
2794 || sysfmt->second.count(cmd) == 0 // this command not found
2796 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2803 case RC_DEFAULT_OTF_VIEW_FORMAT:
2804 if ((ignore_system_lyxrc ||
2805 default_otf_view_format != system_lyxrc.default_otf_view_format)
2806 && !default_otf_view_format.empty()) {
2807 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2812 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2813 if ((ignore_system_lyxrc ||
2814 default_platex_view_format != system_lyxrc.default_platex_view_format)
2815 && !default_platex_view_format.empty()) {
2816 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2821 case RC_DEFAULT_VIEW_FORMAT:
2822 if (ignore_system_lyxrc ||
2823 default_view_format != system_lyxrc.default_view_format) {
2824 os << "\\default_view_format " << default_view_format << '\n';
2835 << "# CONVERTERS SECTION ##########################\n"
2840 // Look for new converters
2841 for (Converters::const_iterator cit = theConverters().begin();
2842 cit != theConverters().end(); ++cit) {
2843 Converter const * converter =
2844 theSystemConverters().getConverter(cit->from(),
2847 converter->command() != cit->command() ||
2848 converter->flags() != cit->flags())
2849 os << "\\converter \"" << cit->from() << "\" \""
2850 << cit->to() << "\" \""
2851 << escapeCommand(cit->command()) << "\" \""
2852 << cit->flags() << "\"\n";
2855 // New/modifed converters
2856 for (Converters::const_iterator cit = theSystemConverters().begin();
2857 cit != theSystemConverters().end(); ++cit)
2858 if (!theConverters().getConverter(cit->from(), cit->to()))
2859 os << "\\converter \"" << cit->from()
2860 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2867 << "# COPIERS SECTION ##########################\n"
2870 // Look for new movers
2871 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2872 Movers::const_iterator const sysend = theSystemMovers().end();
2873 Movers::const_iterator it = theMovers().begin();
2874 Movers::const_iterator end = theMovers().end();
2876 for (; it != end; ++it) {
2877 Movers::const_iterator const sysit =
2878 find_if(sysbegin, sysend, SameMover(*it));
2879 if (sysit == sysend) {
2880 string const & fmt = it->first;
2881 string const & command =
2882 it->second.command();
2884 os << "\\copier " << fmt
2885 << " \"" << escapeCommand(command) << "\"\n";
2891 // We don't actually delete SpecialisedMover(s) from the
2892 // map, just clear their 'command', so there's no need
2893 // to test for anything else.
2900 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2902 // Why the switch you might ask. It is a trick to ensure that all
2903 // the elements in the LyXRCTags enum is handled. As you can see
2904 // there are no breaks at all. So it is just a huge fall-through.
2905 // The nice thing is that we will get a warning from the compiler
2906 // if we forget an element.
2907 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2909 case LyXRC::RC_LAST:
2910 case LyXRC::RC_ACCEPT_COMPOUND:
2911 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2912 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2914 case LyXRC::RC_ALT_LANG:
2915 case LyXRC::RC_PLAINTEXT_LINELEN:
2916 case LyXRC::RC_AUTOCORRECTION_MATH:
2917 case LyXRC::RC_AUTOREGIONDELETE:
2918 case LyXRC::RC_AUTORESET_OPTIONS:
2919 case LyXRC::RC_AUTOSAVE:
2920 case LyXRC::RC_AUTO_NUMBER:
2921 case LyXRC::RC_BACKUPDIR_PATH:
2922 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2923 case LyXRC::RC_BIBTEX_COMMAND:
2924 case LyXRC::RC_BINDFILE:
2925 case LyXRC::RC_CHECKLASTFILES:
2926 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2927 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2928 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2929 case LyXRC::RC_COMPLETION_INLINE_MATH:
2930 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2931 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2932 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2933 case LyXRC::RC_COMPLETION_POPUP_MATH:
2934 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2935 case LyXRC::RC_COMPLETION_MINLENGTH:
2936 case LyXRC::RC_USELASTFILEPOS:
2937 case LyXRC::RC_LOADSESSION:
2938 case LyXRC::RC_CHKTEX_COMMAND:
2939 case LyXRC::RC_CONVERTER:
2940 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2941 case LyXRC::RC_COPIER:
2942 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2943 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2944 case LyXRC::RC_DATE_INSERT_FORMAT:
2945 case LyXRC::RC_GUI_LANGUAGE:
2946 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2947 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2948 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2949 case LyXRC::RC_DEFFILE:
2950 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2951 case LyXRC::RC_DISPLAY_GRAPHICS:
2952 case LyXRC::RC_DOCUMENTPATH:
2953 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2954 FileName path(lyxrc_new.document_path);
2955 if (path.exists() && path.isDirectory())
2956 package().document_dir() = FileName(lyxrc.document_path);
2959 case LyXRC::RC_EDITOR_ALTERNATIVES:
2960 case LyXRC::RC_ESC_CHARS:
2961 case LyXRC::RC_EXAMPLEPATH:
2962 case LyXRC::RC_FONT_ENCODING:
2963 case LyXRC::RC_FILEFORMAT:
2964 case LyXRC::RC_GROUP_LAYOUTS:
2965 case LyXRC::RC_HUNSPELLDIR_PATH:
2966 case LyXRC::RC_ICON_SET:
2967 case LyXRC::RC_INDEX_ALTERNATIVES:
2968 case LyXRC::RC_INDEX_COMMAND:
2969 case LyXRC::RC_JBIBTEX_COMMAND:
2970 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2971 case LyXRC::RC_JINDEX_COMMAND:
2972 case LyXRC::RC_NOMENCL_COMMAND:
2973 case LyXRC::RC_PYGMENTIZE_COMMAND:
2974 case LyXRC::RC_INPUT:
2975 case LyXRC::RC_KBMAP:
2976 case LyXRC::RC_KBMAP_PRIMARY:
2977 case LyXRC::RC_KBMAP_SECONDARY:
2978 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2979 case LyXRC::RC_LANGUAGE_AUTO_END:
2980 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2981 case LyXRC::RC_LANGUAGE_COMMAND_END:
2982 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2983 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2984 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2985 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2986 case LyXRC::RC_LYXRCFORMAT:
2987 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2988 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2989 case LyXRC::RC_MACRO_EDIT_STYLE:
2990 case LyXRC::RC_MAKE_BACKUP:
2991 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2992 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2993 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2994 case LyXRC::RC_NUMLASTFILES:
2995 case LyXRC::RC_PARAGRAPH_MARKERS:
2996 case LyXRC::RC_PATH_PREFIX:
2997 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2998 prependEnvPath("PATH", lyxrc_new.path_prefix);
2999 // Resets python path
3000 support::os::python(true);
3003 case LyXRC::RC_PREVIEW:
3004 case LyXRC::RC_PREVIEW_HASHED_LABELS:
3005 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
3006 case LyXRC::RC_PRINTLANDSCAPEFLAG:
3007 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
3008 case LyXRC::RC_PRINTPAPERFLAG:
3009 case LyXRC::RC_SAVE_COMPRESSED:
3010 case LyXRC::RC_SAVE_ORIGIN:
3011 case LyXRC::RC_SCREEN_DPI:
3012 case LyXRC::RC_SCREEN_FONT_ROMAN:
3013 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3014 case LyXRC::RC_SCREEN_FONT_SANS:
3015 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3016 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3017 case LyXRC::RC_SCREEN_FONT_SIZES:
3018 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3019 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3020 case LyXRC::RC_GEOMETRY_SESSION:
3021 case LyXRC::RC_SCREEN_ZOOM:
3022 case LyXRC::RC_SERVERPIPE:
3023 case LyXRC::RC_SET_COLOR:
3024 case LyXRC::RC_SHOW_BANNER:
3025 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3026 case LyXRC::RC_SPELLCHECKER:
3027 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3030 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3031 case LyXRC::RC_SPELLCHECK_NOTES:
3032 case LyXRC::RC_SPLITINDEX_COMMAND:
3033 case LyXRC::RC_TEMPDIRPATH:
3034 case LyXRC::RC_TEMPLATEPATH:
3035 case LyXRC::RC_TEX_ALLOWS_SPACES:
3036 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3037 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3038 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3041 case LyXRC::RC_TEXINPUTS_PREFIX:
3042 case LyXRC::RC_THESAURUSDIRPATH:
3043 case LyXRC::RC_UIFILE:
3044 case LyXRC::RC_USER_EMAIL:
3045 case LyXRC::RC_USER_NAME:
3046 case LyXRC::RC_USE_CONVERTER_CACHE:
3047 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
3048 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
3049 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
3050 case LyXRC::RC_USE_SYSTEM_COLORS:
3051 case LyXRC::RC_USE_TOOLTIP:
3052 case LyXRC::RC_USE_PIXMAP_CACHE:
3053 case LyXRC::RC_USE_QIMAGE:
3054 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3055 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3056 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3057 case LyXRC::RC_SINGLE_INSTANCE:
3058 case LyXRC::RC_SORT_LAYOUTS:
3059 case LyXRC::RC_FULL_SCREEN_LIMIT:
3060 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3061 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3062 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3063 case LyXRC::RC_FULL_SCREEN_TABBAR:
3064 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3065 case LyXRC::RC_FULL_SCREEN_WIDTH:
3066 case LyXRC::RC_VISUAL_CURSOR:
3067 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3068 case LyXRC::RC_VIEWER:
3069 case LyXRC::RC_VIEWER_ALTERNATIVES:
3070 case LyXRC::RC_FORWARD_SEARCH_DVI:
3071 case LyXRC::RC_FORWARD_SEARCH_PDF:
3072 case LyXRC::RC_EXPORT_OVERWRITE:
3073 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3074 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3075 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3076 case LyXRC::RC_CURSOR_WIDTH:
3083 string const LyXRC::getDescription(LyXRCTags tag)
3088 case RC_ACCEPT_COMPOUND:
3089 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3093 str = _("Specify an alternate language. The default is to use the language of the document.");
3096 case RC_PLAINTEXT_LINELEN:
3097 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.");
3100 case RC_AUTOREGIONDELETE:
3101 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3104 case RC_AUTORESET_OPTIONS:
3105 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3109 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3112 case RC_AUTO_NUMBER:
3115 case RC_BACKUPDIR_PATH:
3116 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.");
3119 case RC_BIBTEX_COMMAND:
3120 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3123 case RC_JBIBTEX_COMMAND:
3124 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3128 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3131 case RC_CHECKLASTFILES:
3132 str = _("Select to check whether the lastfiles still exist.");
3135 case RC_CHKTEX_COMMAND:
3136 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3142 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3143 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3146 case RC_CONVERTER_NEEDAUTH:
3147 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3153 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3154 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.");
3157 case RC_CURSOR_WIDTH:
3158 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3161 case RC_SCROLL_BELOW_DOCUMENT:
3162 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");
3165 case RC_MAC_DONTSWAP_CTRL_META:
3166 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3169 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3170 str = _("Use the Mac OS X conventions for cursor movement");
3173 case RC_SHOW_MACRO_LABEL:
3174 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3177 case RC_DATE_INSERT_FORMAT:
3178 //xgettext:no-c-format
3179 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3183 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3186 case RC_DEFAULT_OTF_VIEW_FORMAT:
3187 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3190 case RC_DEFAULT_VIEW_FORMAT:
3191 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3194 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3195 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3198 case RC_DISPLAY_GRAPHICS:
3199 str = _("Select how LyX will display any graphics.");
3202 case RC_DOCUMENTPATH:
3203 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3207 str = _("Specify additional chars that can be part of a word.");
3210 case RC_EXAMPLEPATH:
3211 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3214 case RC_FONT_ENCODING:
3215 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3221 case RC_INDEX_COMMAND:
3222 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\".");
3225 case RC_JINDEX_COMMAND:
3226 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3229 case RC_NOMENCL_COMMAND:
3230 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3233 case RC_PYGMENTIZE_COMMAND:
3234 str = _("The command to run the python pygments syntax highlighter.");
3241 case RC_KBMAP_PRIMARY:
3242 case RC_KBMAP_SECONDARY:
3243 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.");
3246 case RC_LANGUAGE_AUTO_BEGIN:
3247 str = _("Select if a language switching command is needed at the beginning of the document.");
3250 case RC_LANGUAGE_AUTO_END:
3251 str = _("Select if a language switching command is needed at the end of the document.");
3254 case RC_LANGUAGE_COMMAND_BEGIN:
3255 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.");
3258 case RC_LANGUAGE_COMMAND_END:
3259 str = _("The LaTeX command for changing back to the language of the document.");
3262 case RC_LANGUAGE_COMMAND_LOCAL:
3263 str = _("The LaTeX command for local changing of the language.");
3266 case RC_LANGUAGE_GLOBAL_OPTIONS:
3267 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3270 case RC_LANGUAGE_CUSTOM_PACKAGE:
3271 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3274 case RC_LANGUAGE_PACKAGE_SELECTION:
3275 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3278 case RC_USELASTFILEPOS:
3279 str = _("De-select if you do not want LyX to scroll to saved position.");
3282 case RC_LOADSESSION:
3283 str = _("De-select to prevent loading files opened from the last LyX session.");
3286 case RC_MAKE_BACKUP:
3287 str = _("De-select if you don't want LyX to create backup files.");
3290 case RC_MARK_FOREIGN_LANGUAGE:
3291 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3294 case RC_MOUSE_WHEEL_SPEED:
3295 str = _("The scrolling speed of the mouse wheel.");
3298 case RC_COMPLETION_POPUP_DELAY:
3299 str = _("The completion popup delay.");
3302 case RC_COMPLETION_POPUP_MATH:
3303 str = _("Select to display the completion popup in math mode.");
3306 case RC_COMPLETION_POPUP_TEXT:
3307 str = _("Select to display the completion popup in text mode.");
3310 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3311 str = _("Show the completion popup without delay after non-unique completion attempt.");
3314 case RC_COMPLETION_POPUP_TEXT:
3315 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3318 case RC_COMPLETION_POPUP_DELAY:
3319 str = _("The inline completion delay.");
3322 case RC_COMPLETION_INLINE_MATH:
3323 str = _("Select to display the inline completion in math mode.");
3326 case RC_COMPLETION_INLINE_TEXT:
3327 str = _("Select to display the inline completion in text mode.");
3330 case RC_COMPLETION_INLINE_DOTS:
3331 str = _("Use \"...\" to shorten long completions.");
3334 case RC_AUTOCORRECTION_MATH:
3335 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3338 case RC_NUMLASTFILES:
3339 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3343 case RC_PATH_PREFIX:
3344 str = _("Specify those directories which should be "
3345 "prepended to the PATH environment variable.\n"
3346 "Use the OS native format.");
3350 str = _("Shows a typeset preview of things such as math");
3353 case RC_PREVIEW_HASHED_LABELS:
3354 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3357 case RC_PREVIEW_SCALE_FACTOR:
3358 str = _("Scale the preview size to suit.");
3361 case RC_PRINTLANDSCAPEFLAG:
3362 str = _("The option to print out in landscape.");
3365 case RC_PRINTPAPERDIMENSIONFLAG:
3366 str = _("Option to specify the dimensions of the print paper.");
3369 case RC_PRINTPAPERFLAG:
3370 str = _("The option to specify paper type.");
3373 case RC_VISUAL_CURSOR:
3374 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3377 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3378 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).");
3382 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3385 case RC_SCREEN_FONT_ROMAN:
3386 case RC_SCREEN_FONT_SANS:
3387 case RC_SCREEN_FONT_TYPEWRITER:
3388 str = _("The screen fonts used to display the text while editing.");
3391 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3392 case RC_SCREEN_FONT_SANS_FOUNDRY:
3393 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3396 case RC_SCREEN_FONT_SCALABLE:
3397 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.");
3400 case RC_SCREEN_FONT_SIZES:
3401 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3404 case RC_SCREEN_ZOOM:
3405 //xgettext:no-c-format
3406 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3409 case RC_GEOMETRY_SESSION:
3410 str = _("Allow session manager to save and restore windows geometry.");
3414 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3420 case RC_SHOW_BANNER:
3421 str = _("De-select if you don't want the startup banner.");
3424 case RC_TEMPDIRPATH:
3425 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3428 case RC_THESAURUSDIRPATH:
3429 str = _("This is the place where the files of the thesaurus library reside.");
3432 case RC_TEMPLATEPATH:
3433 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3436 case RC_TEX_ALLOWS_SPACES:
3439 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3442 case RC_TEXINPUTS_PREFIX:
3443 str = _("Specify those directories which should be "
3444 "prepended to the TEXINPUTS environment variable.\n"
3445 "A '.' represents the current document directory. "
3446 "Use the OS native format.");
3450 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3459 case RC_USE_USE_SYSTEM_COLORS:
3460 str = _("Enable use the system colors for some things like main window background and selection.");
3463 case RC_USE_TOOLTIP:
3464 str = _("Enable the automatic appearance of tool tips in the work area.");
3467 case RC_USE_PIXMAP_CACHE:
3468 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3471 case RC_VIEWDVI_PAPEROPTION:
3472 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3487 // The global instance
3490 // The global copy of the system lyxrc entries (everything except preferences)