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"
27 #include "FuncRequest.h"
32 #include "SpellChecker.h"
35 #include "graphics/GraphicsTypes.h"
37 #include "support/convert.h"
38 #include "support/debug.h"
39 #include "support/environment.h"
40 #include "support/FileName.h"
41 #include "support/filetools.h"
42 #include "support/gettext.h"
43 #include "support/lstrings.h"
44 #include "support/os.h"
45 #include "support/Package.h"
46 #include "support/TempFile.h"
47 #include "support/userinfo.h"
54 using namespace lyx::support;
58 namespace os = support::os;
62 // The format should also be updated in configure.py, and conversion code
63 // should be added to prefs2prefs_prefs.py.
64 static unsigned int const LYXRC_FILEFORMAT = 24; // spitz: rename collapsible
66 // when adding something to this array keep it sorted!
67 LexerKeyword lyxrcTags[] = {
68 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
69 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
70 { "\\alternate_language", LyXRC::RC_ALT_LANG },
71 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
72 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
73 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
74 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
75 { "\\autosave", LyXRC::RC_AUTOSAVE },
76 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
77 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
78 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
79 { "\\bind_file", LyXRC::RC_BINDFILE },
80 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
81 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
82 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
83 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
84 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
85 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
86 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
87 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
88 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
89 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
90 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
91 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
92 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
93 { "\\converter", LyXRC::RC_CONVERTER },
94 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
95 { "\\copier", LyXRC::RC_COPIER },
96 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
97 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
98 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
99 { "\\def_file", LyXRC::RC_DEFFILE },
100 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
101 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
102 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
103 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
104 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
105 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
106 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
107 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
108 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
109 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
110 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
111 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
112 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
113 { "\\format", LyXRC::RC_FILEFORMAT },
114 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
115 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
116 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
117 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
118 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
119 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
120 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
121 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
122 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
123 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
124 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
125 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
126 { "\\icon_set", LyXRC::RC_ICON_SET },
127 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
128 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
129 { "\\input", LyXRC::RC_INPUT },
130 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
131 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
132 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
133 { "\\kbmap", LyXRC::RC_KBMAP },
134 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
135 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
136 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
137 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
138 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
139 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
140 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
141 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
142 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
143 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
144 { "\\load_session", LyXRC::RC_LOADSESSION },
145 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
146 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
147 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
148 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
149 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
150 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
151 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
152 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
153 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
154 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
155 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
156 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
157 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
158 { "\\preview", LyXRC::RC_PREVIEW },
159 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
160 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
161 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
162 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
163 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
164 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
165 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
166 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
167 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
168 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
169 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
170 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
171 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
172 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
173 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
174 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
175 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
176 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
177 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
178 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
179 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
180 { "\\set_color", LyXRC::RC_SET_COLOR },
181 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
182 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
183 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
184 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
185 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
186 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
187 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
188 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
189 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
190 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
191 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
192 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
193 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
194 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
195 { "\\ui_file", LyXRC::RC_UIFILE },
196 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
197 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
198 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
199 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
200 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
201 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
202 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
203 // compatibility with versions older than 1.4.0 only
204 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
205 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
206 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
207 { "\\user_email", LyXRC::RC_USER_EMAIL },
208 { "\\user_name", LyXRC::RC_USER_NAME },
209 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
210 // compatibility with versions older than 1.4.0 only
211 { "\\viewer", LyXRC::RC_VIEWER},
212 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
213 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
214 { "format", LyXRC::RC_LYXRCFORMAT }
217 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
228 void LyXRC::setDefaults()
231 use_system_theme_icons = false;
233 def_file = "default";
235 // The current document directory
236 texinputs_prefix = ".";
237 print_landscape_flag = "-t landscape";
238 print_paper_flag = "-t";
239 print_paper_dimension_flag = "-T";
240 document_path.erase();
241 view_dvi_paper_option.erase();
242 default_view_format = "pdf2";
243 default_otf_view_format = "pdf4";
244 default_platex_view_format = "pdf3";
245 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
246 bibtex_command = "automatic";
248 index_command = "makeindex -c -q";
249 nomencl_command = "makeindex -s nomencl.ist";
250 pygmentize_command = string();
252 // Because a screen is typically wider than a piece of paper:
254 currentZoom = defaultZoom;
255 allow_geometry_session = true;
256 // Default LaTeX font size:
257 font_sizes[FONT_SIZE_TINY] = "5.0";
258 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
259 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
260 font_sizes[FONT_SIZE_SMALL] = "9.0";
261 font_sizes[FONT_SIZE_NORMAL] = "10.0";
262 font_sizes[FONT_SIZE_LARGE] = "12.0";
263 font_sizes[FONT_SIZE_LARGER] = "14.4";
264 font_sizes[FONT_SIZE_LARGEST] = "17.26";
265 font_sizes[FONT_SIZE_HUGE] = "20.74";
266 font_sizes[FONT_SIZE_HUGER] = "24.88";
267 use_scalable_fonts = true;
268 roman_font_name = "";
270 typewriter_font_name = "";
272 auto_region_delete = true;
273 auto_reset_options = false;
274 plaintext_linelen = 65;
275 mouse_wheel_speed = 1.0;
277 check_lastfiles = true;
278 use_lastfilepos = true;
279 use_native_filedialog = true;
280 load_session = false;
282 save_compressed = false;
284 backupdir_path.erase();
285 display_graphics = true;
286 // Spellchecker settings:
287 // FIXME: this check should test the target platform (darwin)
288 #if defined(USE_MACOSX_PACKAGING)
289 spellchecker = "native";
290 #elif defined(USE_ENCHANT)
291 spellchecker = "enchant";
292 #elif defined(USE_ASPELL)
293 spellchecker = "aspell";
294 #elif defined(USE_HUNSPELL)
295 spellchecker = "hunspell";
297 spellchecker = "aspell";
299 spellchecker_accept_compound = false;
300 spellcheck_continuously = false;
301 completion_minlength = 6;
302 spellcheck_notes = true;
304 visual_cursor = false;
306 mark_foreign_language = true;
307 language_auto_begin = true;
308 language_auto_end = true;
309 language_global_options = true;
310 language_package_selection = LP_AUTO;
311 language_custom_package = "\\usepackage{babel}";
312 language_command_begin = "\\selectlanguage{$$lang}";
313 language_command_local = "\\foreignlanguage{$$lang}{";
314 sort_layouts = false;
315 group_layouts = true;
316 gui_language = "auto";
318 windows_style_tex_paths = false;
319 tex_allows_spaces = false;
320 date_insert_format = "%x";
321 cursor_follows_scrollbar = false;
322 scroll_below_document = false;
323 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
324 paragraph_markers = false;
325 mac_dontswap_ctrl_meta = false;
326 mac_like_cursor_movement = false;
327 macro_edit_style = MACRO_EDIT_INLINE_BOX;
328 dialogs_iconify_with_main = false;
329 preview = PREVIEW_OFF;
330 preview_hashed_labels = false;
331 preview_scale_factor = 1.0;
332 use_converter_cache = true;
333 use_converter_needauth_forbidden = true;
334 use_converter_needauth = true;
335 use_system_colors = false;
337 use_pixmap_cache = false;
339 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
340 user_name = to_utf8(support::user_name());
341 user_email = to_utf8(support::user_email());
342 open_buffers_in_tabs = true;
343 single_close_tab_button = false;
344 single_instance = true;
345 forward_search_dvi = string();
346 forward_search_pdf = string();
347 export_overwrite = NO_FILES;
349 // Fullscreen settings
350 full_screen_limit = false;
351 full_screen_toolbars = true;
352 full_screen_tabbar = true;
353 full_screen_menubar = true;
354 full_screen_statusbar = true;
355 full_screen_scrollbar = true;
356 full_screen_width = 700;
358 completion_cursor_text = true;
359 completion_popup_math = true;
360 completion_popup_text = false;
361 completion_popup_delay = 2.0;
362 completion_popup_after_complete = true;
363 autocorrection_math = false;
364 completion_inline_math = true;
365 completion_inline_text = false;
366 completion_inline_dots = -1;
367 completion_inline_delay = 0.2;
368 default_decimal_point = ".";
369 default_length_unit = Length::CM;
371 close_buffer_with_last_view = "yes";
372 mouse_middlebutton_paste = true;
378 void oldFontFormat(string & family, string & foundry)
380 if (family.empty() || family[0] != '-')
382 foundry = token(family, '-', 1);
383 family = token(family, '-', 2);
391 bool LyXRC::read(FileName const & filename, bool check_format)
393 Lexer lexrc(lyxrcTags);
394 lexrc.setFile(filename);
395 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
396 ReturnValues retval = read(lexrc, check_format);
397 if (!check_format || retval != FormatMismatch)
398 return retval == ReadOK;
400 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
401 TempFile tmp("convert_lyxrc");
402 FileName const tempfile = tmp.name();
403 bool const success = prefs2prefs(filename, tempfile, false);
405 LYXERR0 ("Unable to convert " << filename.absFileName() <<
406 " to format " << LYXRC_FILEFORMAT);
409 // Keep this in the else branch, such that lexrc2 goes out
410 // of scope and releases the lock on tempfile before we
411 // attempt to remove it. This matters on Windows.
412 Lexer lexrc2(lyxrcTags);
413 lexrc2.setFile(tempfile);
414 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
415 retval = read(lexrc2, check_format);
416 if (retval == FormatMismatch)
417 LYXERR0("Conversion failed for " << filename.absFileName());
419 return retval == ReadOK;
423 // don't need to worry about conversion, because this is always
424 // from an internal source
425 bool LyXRC::read(istream & is)
427 Lexer lexrc(lyxrcTags);
429 LYXERR(Debug::LYXRC, "Reading istream...");
430 return read(lexrc, false) == ReadOK;
434 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
436 if (lyxerr.debugging(Debug::PARSER))
437 lexrc.printTable(lyxerr);
442 // format prior to 2.0 and introduction of format tag
443 unsigned int format = 0;
445 while (lexrc.isOK()) {
446 // By using two switches we take advantage of the compiler
447 // telling us if we have missed a LyXRCTags element in
448 // the second switch.
449 // Note that this also shows a problem with Lexer since it
450 // helps us avoid taking advantage of the strictness of the
453 int le = lexrc.lex();
455 case Lexer::LEX_UNDEF:
456 lexrc.printError("Unknown tag `$$Token'");
458 case Lexer::LEX_FEOF:
463 switch (static_cast<LyXRCTags>(le)) {
466 format = lexrc.getInteger();
468 case RC_INPUT: // Include file
471 libFileSearch(string(),
473 if (!read(tmp, check_format)) {
475 "Error reading included file: " + tmp.absFileName());
481 bind_file = os::internal_path(lexrc.getString());
486 def_file = os::internal_path(lexrc.getString());
491 ui_file = os::internal_path(lexrc.getString());
494 case RC_AUTORESET_OPTIONS:
495 lexrc >> auto_reset_options;
498 case RC_DISPLAY_GRAPHICS:
500 display_graphics = lexrc.getString() == "true";
503 case RC_TEX_EXPECTS_WINDOWS_PATHS:
504 lexrc >> windows_style_tex_paths;
507 case RC_TEX_ALLOWS_SPACES:
508 lexrc >> tex_allows_spaces;
511 case RC_TEXINPUTS_PREFIX:
512 lexrc >> texinputs_prefix;
519 case RC_KBMAP_PRIMARY:
521 string const kmap(os::internal_path(lexrc.getString()));
522 if (!libFileSearch("kbd", kmap, "kmap").empty()
524 primary_kbmap = kmap;
526 lexrc.printError("LyX: Keymap `$$Token' not found");
531 case RC_KBMAP_SECONDARY:
533 string const kmap(os::internal_path(lexrc.getString()));
534 if (!libFileSearch("kbd", kmap, "kmap").empty()
536 secondary_kbmap = kmap;
538 lexrc.printError("LyX: Keymap `$$Token' not found");
543 case RC_FONT_ENCODING:
547 case RC_PRINTLANDSCAPEFLAG:
548 lexrc >> print_landscape_flag;
551 case RC_PRINTPAPERDIMENSIONFLAG:
552 lexrc >> print_paper_dimension_flag;
555 case RC_PRINTPAPERFLAG:
556 lexrc >> print_paper_flag;
559 case RC_PYGMENTIZE_COMMAND:
560 if (lexrc.next(true)) {
561 pygmentize_command = lexrc.getString();
565 case RC_VIEWDVI_PAPEROPTION:
567 view_dvi_paper_option = lexrc.getString();
569 view_dvi_paper_option.erase();
572 case RC_CHKTEX_COMMAND:
573 if (lexrc.next(true)) {
574 chktex_command = lexrc.getString();
578 case RC_BIBTEX_ALTERNATIVES:
579 if (lexrc.next(true)) {
580 bibtex_alternatives.insert(lexrc.getString());
584 case RC_BIBTEX_COMMAND:
585 if (lexrc.next(true)) {
586 bibtex_command = lexrc.getString();
590 case RC_JBIBTEX_COMMAND:
591 if (lexrc.next(true)) {
592 jbibtex_command = lexrc.getString();
596 case RC_JBIBTEX_ALTERNATIVES:
597 if (lexrc.next(true)) {
598 jbibtex_alternatives.insert(lexrc.getString());
602 case RC_INDEX_ALTERNATIVES:
603 if (lexrc.next(true)) {
604 index_alternatives.insert(lexrc.getString());
608 case RC_INDEX_COMMAND:
609 if (lexrc.next(true)) {
610 index_command = lexrc.getString();
614 case RC_JINDEX_COMMAND:
615 if (lexrc.next(true)) {
616 jindex_command = lexrc.getString();
620 case RC_SPLITINDEX_COMMAND:
621 if (lexrc.next(true)) {
622 splitindex_command = lexrc.getString();
626 case RC_NOMENCL_COMMAND:
627 if (lexrc.next(true)) {
628 nomencl_command = lexrc.getString();
637 lexrc >> defaultZoom;
638 if (defaultZoom < 10)
642 case RC_GEOMETRY_SESSION:
643 lexrc >> allow_geometry_session;
646 case RC_SCREEN_FONT_SIZES:
647 lexrc >> font_sizes[FONT_SIZE_TINY];
648 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
649 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
650 lexrc >> font_sizes[FONT_SIZE_SMALL];
651 lexrc >> font_sizes[FONT_SIZE_NORMAL];
652 lexrc >> font_sizes[FONT_SIZE_LARGE];
653 lexrc >> font_sizes[FONT_SIZE_LARGER];
654 lexrc >> font_sizes[FONT_SIZE_LARGEST];
655 lexrc >> font_sizes[FONT_SIZE_HUGE];
656 lexrc >> font_sizes[FONT_SIZE_HUGER];
659 case RC_SCREEN_FONT_SCALABLE:
660 lexrc >> use_scalable_fonts;
667 case RC_DOCUMENTPATH:
669 document_path = os::internal_path(lexrc.getString());
674 example_path = os::internal_path(lexrc.getString());
677 case RC_TEMPLATEPATH:
679 template_path = os::internal_path(lexrc.getString());
684 tempdir_path = os::internal_path(lexrc.getString());
687 case RC_THESAURUSDIRPATH:
689 thesaurusdir_path = os::internal_path(lexrc.getString());
692 case RC_HUNSPELLDIR_PATH:
694 hunspelldir_path = os::internal_path(lexrc.getString());
697 case RC_USELASTFILEPOS:
698 lexrc >> use_lastfilepos;
702 lexrc >> load_session;
705 case RC_MOUSE_WHEEL_SPEED:
706 lexrc >> mouse_wheel_speed;
709 case RC_COMPLETION_INLINE_DELAY:
710 lexrc >> completion_inline_delay;
713 case RC_COMPLETION_INLINE_MATH:
714 lexrc >> completion_inline_math;
717 case RC_COMPLETION_INLINE_TEXT:
718 lexrc >> completion_inline_text;
721 case RC_COMPLETION_INLINE_DOTS:
722 lexrc >> completion_inline_dots;
725 case RC_AUTOCORRECTION_MATH:
726 lexrc >> autocorrection_math;
729 case RC_COMPLETION_POPUP_DELAY:
730 lexrc >> completion_popup_delay;
733 case RC_COMPLETION_POPUP_MATH:
734 lexrc >> completion_popup_math;
737 case RC_COMPLETION_POPUP_TEXT:
738 lexrc >> completion_popup_text;
741 case RC_COMPLETION_CURSOR_TEXT:
742 lexrc >> completion_cursor_text;
745 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
746 lexrc >> completion_popup_after_complete;
749 case RC_COMPLETION_MINLENGTH:
750 lexrc >> completion_minlength;
753 case RC_NUMLASTFILES:
754 lexrc >> num_lastfiles;
757 case RC_CHECKLASTFILES:
758 lexrc >> check_lastfiles;
765 case RC_USE_SYSTEM_THEME_ICONS:
766 lexrc >> use_system_theme_icons;
769 case RC_SCREEN_FONT_ROMAN:
771 roman_font_name = lexrc.getString();
772 oldFontFormat(roman_font_name,
777 case RC_SCREEN_FONT_SANS:
779 sans_font_name = lexrc.getString();
780 oldFontFormat(sans_font_name, sans_font_foundry);
784 case RC_SCREEN_FONT_TYPEWRITER:
786 typewriter_font_name = lexrc.getString();
787 oldFontFormat(typewriter_font_name,
788 typewriter_font_foundry);
792 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
793 lexrc >> roman_font_foundry;
796 case RC_SCREEN_FONT_SANS_FOUNDRY:
797 lexrc >> sans_font_foundry;
800 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
801 lexrc >> typewriter_font_foundry;
806 lexrc.printError("Missing color tag.");
809 string lyx_name = lexrc.getString();
812 lexrc.printError("Missing color name for color: `$$Token'");
815 string x11_name = lexrc.getString();
817 ColorCode const col =
818 lcolor.getFromLyXName(lyx_name);
819 if (col == Color_none ||
820 col == Color_inherit ||
824 if (!lcolor.setColor(col, x11_name))
825 LYXERR0("Bad lyxrc set_color for " << lyx_name);
829 case RC_AUTOREGIONDELETE:
830 // Auto region delete defaults to true
831 lexrc >> auto_region_delete;
836 lyxpipes = os::internal_path(lexrc.getString());
839 case RC_CURSOR_FOLLOWS_SCROLLBAR:
840 lexrc >> cursor_follows_scrollbar;
843 case RC_CURSOR_WIDTH:
844 lexrc >> cursor_width;
847 case RC_SCROLL_BELOW_DOCUMENT:
848 lexrc >> scroll_below_document;
851 case RC_PARAGRAPH_MARKERS:
852 lexrc >> paragraph_markers;
855 case RC_MAC_DONTSWAP_CTRL_META:
856 lexrc >> mac_dontswap_ctrl_meta;
859 case RC_MAC_LIKE_CURSOR_MOVEMENT:
860 lexrc >> mac_like_cursor_movement;
863 case RC_MACRO_EDIT_STYLE:
865 switch (lexrc.getInteger()) {
866 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
867 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
868 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
873 case RC_DIALOGS_ICONIFY_WITH_MAIN:
874 lexrc >> dialogs_iconify_with_main;
877 case RC_PLAINTEXT_LINELEN:
878 lexrc >> plaintext_linelen;
880 // Spellchecker settings:
881 case RC_ACCEPT_COMPOUND:
882 lexrc >> spellchecker_accept_compound;
884 case RC_USE_NATIVE_FILEDIALOG:
885 lexrc >> use_native_filedialog;
887 case RC_USE_SYSTEM_COLORS:
888 lexrc >> use_system_colors;
891 lexrc >> use_tooltip;
893 case RC_USE_PIXMAP_CACHE:
894 lexrc >> use_pixmap_cache;
899 case RC_SPELLCHECKER:
900 lexrc >> spellchecker;
903 lexrc >> spellchecker_alt_lang;
906 lexrc >> spellchecker_esc_chars;
908 case RC_SPELLCHECK_CONTINUOUSLY:
909 lexrc >> spellcheck_continuously;
911 case RC_SPELLCHECK_NOTES:
912 lexrc >> spellcheck_notes;
915 lexrc >> make_backup;
917 case RC_SAVE_COMPRESSED:
918 lexrc >> save_compressed;
921 lexrc >> save_origin;
923 case RC_BACKUPDIR_PATH:
925 backupdir_path = os::internal_path(lexrc.getString());
927 case RC_DEFAULT_DECIMAL_POINT:
928 lexrc >> default_decimal_point;
930 case RC_DEFAULT_LENGTH_UNIT:
932 default_length_unit = (Length::UNIT) lexrc.getInteger();
934 case RC_DATE_INSERT_FORMAT:
935 lexrc >> date_insert_format;
937 case RC_LANGUAGE_CUSTOM_PACKAGE:
938 lexrc >> language_custom_package;
940 case RC_LANGUAGE_AUTO_BEGIN:
941 lexrc >> language_auto_begin;
943 case RC_LANGUAGE_AUTO_END:
944 lexrc >> language_auto_end;
946 case RC_LANGUAGE_GLOBAL_OPTIONS:
947 lexrc >> language_global_options;
949 case RC_LANGUAGE_PACKAGE_SELECTION:
951 switch (lexrc.getInteger()) {
953 language_package_selection = LP_AUTO;
956 language_package_selection = LP_BABEL;
959 language_package_selection = LP_CUSTOM;
962 language_package_selection = LP_NONE;
967 case RC_LANGUAGE_COMMAND_BEGIN:
968 lexrc >> language_command_begin;
970 case RC_LANGUAGE_COMMAND_END:
971 lexrc >> language_command_end;
973 case RC_LANGUAGE_COMMAND_LOCAL:
974 lexrc >> language_command_local;
976 case RC_VISUAL_CURSOR:
977 lexrc >> visual_cursor;
979 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
980 lexrc >> close_buffer_with_last_view;
983 lexrc >> auto_number;
985 case RC_MARK_FOREIGN_LANGUAGE:
986 lexrc >> mark_foreign_language;
992 fmt = lexrc.getString();
993 if (lexrc.next(true))
994 command = lexrc.getString();
995 setMover(fmt, command);
1000 string from, to, command, flags;
1002 from = lexrc.getString();
1004 to = lexrc.getString();
1005 if (lexrc.next(true))
1006 command = lexrc.getString();
1008 flags = lexrc.getString();
1009 if (command.empty())
1010 theConverters().erase(from, to);
1012 theConverters().add(from, to, command, flags);
1015 // compatibility with versions older than 1.4.0 only
1017 string format, command;
1018 lexrc >> format >> command;
1019 theFormats().setViewer(format, command);
1022 case RC_FILEFORMAT: {
1024 string format, extensions, shortcut;
1025 docstring prettyname;
1026 if (!(lexrc >> format >> extensions))
1028 if (ok && lexrc.next(true))
1029 prettyname = lexrc.getDocString();
1033 if(!(lexrc >> shortcut))
1035 string viewer, editor;
1036 if (ok && lexrc.next(true))
1037 viewer = lexrc.getString();
1040 if (ok && lexrc.next(true))
1041 editor = lexrc.getString();
1045 if (!(lexrc >> flags >> mime))
1047 int flgs = Format::none;
1048 while (!flags.empty()) {
1050 flags = split(flags, flag, ',');
1051 if (flag == "document")
1052 flgs |= Format::document;
1053 else if (flag == "vector")
1054 flgs |= Format::vector;
1055 else if (flag == "zipped=native")
1056 flgs |= Format::zipped_native;
1057 else if (flag == "menu=export")
1058 flgs |= Format::export_menu;
1060 LYXERR0("Ignoring unknown flag `"
1061 << flag << "' for format `"
1065 LYXERR0("Syntax error in format " << format);
1066 else if (prettyname.empty()) {
1067 if (theConverters().formatIsUsed(format))
1068 LYXERR0("Can't delete format " << format);
1070 theFormats().erase(format);
1072 theFormats().add(format, extensions, prettyname,
1073 shortcut, viewer, editor, mime, flgs);
1077 case RC_VIEWER_ALTERNATIVES: {
1078 string format, command;
1079 if ((lexrc >> format) && lexrc.next(true)) {
1080 command = lexrc.getString();
1081 viewer_alternatives[format].insert(command);
1085 case RC_EDITOR_ALTERNATIVES: {
1086 string format, command;
1087 if ((lexrc >> format) && lexrc.next(true)) {
1088 command = lexrc.getString();
1089 editor_alternatives[format].insert(command);
1094 case RC_DEFAULT_OTF_VIEW_FORMAT:
1095 lexrc >> default_otf_view_format;
1098 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
1099 lexrc >> default_platex_view_format;
1102 case RC_DEFAULT_VIEW_FORMAT:
1103 lexrc >> default_view_format;
1106 case RC_GUI_LANGUAGE:
1107 lexrc >> gui_language;
1110 case RC_SHOW_BANNER:
1111 lexrc >> show_banner;
1116 string const tmp = lexrc.getString();
1117 if (tmp == "true" || tmp == "on")
1118 preview = PREVIEW_ON;
1119 else if (tmp == "no_math")
1120 preview = PREVIEW_NO_MATH;
1122 preview = PREVIEW_OFF;
1123 if (tmp != "false" && tmp != "off")
1124 LYXERR0("Unrecognized preview status \""
1130 case RC_PREVIEW_HASHED_LABELS:
1131 lexrc >> preview_hashed_labels;
1134 case RC_PREVIEW_SCALE_FACTOR:
1135 lexrc >> preview_scale_factor;
1142 lexrc >> user_email;
1145 case RC_PATH_PREFIX:
1146 lexrc >> path_prefix;
1149 case RC_USE_CONVERTER_CACHE:
1150 lexrc >> use_converter_cache;
1152 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1153 lexrc >> use_converter_needauth_forbidden;
1155 case RC_USE_CONVERTER_NEEDAUTH:
1156 lexrc >> use_converter_needauth;
1158 case RC_CONVERTER_CACHE_MAXAGE:
1159 lexrc >> converter_cache_maxage;
1162 case RC_SORT_LAYOUTS:
1163 lexrc >> sort_layouts;
1165 case RC_GROUP_LAYOUTS:
1166 lexrc >> group_layouts;
1168 case RC_FULL_SCREEN_LIMIT:
1169 lexrc >> full_screen_limit;
1171 case RC_FULL_SCREEN_TOOLBARS:
1172 lexrc >> full_screen_toolbars;
1174 case RC_FULL_SCREEN_SCROLLBAR:
1175 lexrc >> full_screen_scrollbar;
1177 case RC_FULL_SCREEN_STATUSBAR:
1178 lexrc >> full_screen_statusbar;
1180 case RC_FULL_SCREEN_TABBAR:
1181 lexrc >> full_screen_tabbar;
1183 case RC_FULL_SCREEN_MENUBAR:
1184 lexrc >> full_screen_menubar;
1186 case RC_FULL_SCREEN_WIDTH:
1187 lexrc >> full_screen_width;
1189 case RC_OPEN_BUFFERS_IN_TABS:
1190 lexrc >> open_buffers_in_tabs;
1192 case RC_SINGLE_CLOSE_TAB_BUTTON:
1193 lexrc >> single_close_tab_button;
1195 case RC_SINGLE_INSTANCE:
1196 lexrc >> single_instance;
1197 if (run_mode == PREFERRED)
1198 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1200 case RC_FORWARD_SEARCH_DVI:
1201 if (lexrc.next(true))
1202 forward_search_dvi = lexrc.getString();
1204 case RC_FORWARD_SEARCH_PDF:
1205 if (lexrc.next(true))
1206 forward_search_pdf = lexrc.getString();
1208 case RC_EXPORT_OVERWRITE:
1210 string const tmp = lexrc.getString();
1211 if (tmp == "all" || tmp == "true")
1212 export_overwrite = ALL_FILES;
1213 else if (tmp == "main")
1214 export_overwrite = MAIN_FILE;
1216 export_overwrite = NO_FILES;
1217 if (tmp != "ask" && tmp != "false")
1218 LYXERR0("Unrecognized export_overwrite status \""
1223 case RC_SCROLL_WHEEL_ZOOM:
1225 string const tmp = lexrc.getString();
1227 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1228 else if (tmp == "shift")
1229 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1230 else if (tmp == "alt")
1231 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1233 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1234 if (tmp != "off" && tmp != "false")
1235 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1241 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1242 lexrc >> mouse_middlebutton_paste;
1246 break; // this is just a dummy
1249 // This is triggered the first time through the loop unless
1250 // we hit a format tag.
1251 if (check_format && format != LYXRC_FILEFORMAT)
1252 return FormatMismatch;
1255 /// Update converters data-structures
1256 theConverters().update(theFormats());
1257 theConverters().buildGraph();
1258 theBufferList().invalidateConverterCache();
1264 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1266 ofstream ofs(filename.toFilesystemEncoding().c_str());
1268 write(ofs, ignore_system_lyxrc);
1272 void LyXRC::print() const
1274 if (lyxerr.debugging())
1275 write(lyxerr, false);
1283 typedef pair<string, SpecialisedMover> Data;
1285 SameMover(Data const & comparison)
1286 : comparison_(comparison) {}
1288 bool operator()(Data const & data) const
1290 return data.first == comparison_.first &&
1291 data.second.command() == comparison_.second.command();
1301 // Escape \ and " so that LyXLex can read the string later
1302 string escapeCommand(string const & str) {
1303 return subst(subst(str , "\\", "\\\\"),
1310 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1312 LyXRCTags tag = RC_LAST;
1314 if (!name.empty()) {
1315 for (int i = 0; i != lyxrcCount; ++i)
1316 if ("\\" + name == lyxrcTags[i].tag)
1317 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1321 os << "# LyX " << lyx_version
1322 << " generated this file. If you want to make your own\n"
1323 << "# modifications you should do them from inside LyX and save.\n\n"
1324 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1326 // Why the switch you might ask. It is a trick to ensure that all
1327 // the elements in the LyXRCTags enum are handled. As you can see
1328 // there are no breaks at all. So it is just a huge fall-through.
1329 // The nice thing is that we will get a warning from the compiler
1330 // if we forget an element.
1334 // input/include files are not done here
1335 case RC_LYXRCFORMAT:
1337 if (ignore_system_lyxrc ||
1338 bind_file != system_lyxrc.bind_file) {
1339 string const path = os::external_path(bind_file);
1340 os << "\\bind_file \"" << path << "\"\n";
1346 if (ignore_system_lyxrc ||
1347 def_file != system_lyxrc.def_file) {
1348 string const path = os::external_path(def_file);
1349 os << "\\def_file \"" << path << "\"\n";
1358 << "# MISC SECTION ######################################\n"
1360 // bind files are not done here.
1362 case RC_PATH_PREFIX:
1363 if (ignore_system_lyxrc ||
1364 path_prefix != system_lyxrc.path_prefix) {
1365 os << "\\path_prefix \"" << path_prefix << "\"\n";
1371 if (ignore_system_lyxrc ||
1372 ui_file != system_lyxrc.ui_file) {
1373 string const path = os::external_path(ui_file);
1374 os << "\\ui_file \"" << path << "\"\n";
1379 case RC_AUTOREGIONDELETE:
1380 if (ignore_system_lyxrc ||
1381 auto_region_delete != system_lyxrc.auto_region_delete) {
1382 os << "# Set to false to inhibit automatic replacement of\n"
1383 << "# the current selection.\n"
1384 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1390 case RC_AUTORESET_OPTIONS:
1391 if (ignore_system_lyxrc ||
1392 auto_reset_options != system_lyxrc.auto_reset_options) {
1393 os << "# Set to false to inhibit automatic reset of\n"
1394 << "# the class options to defaults on class change.\n"
1395 << "\\auto_reset_options "
1396 << convert<string>(auto_reset_options)
1403 if (ignore_system_lyxrc ||
1404 autosave != system_lyxrc.autosave) {
1405 os << "# The time interval between auto-saves in seconds.\n"
1406 << "\\autosave " << autosave << '\n';
1411 case RC_DISPLAY_GRAPHICS:
1412 if (ignore_system_lyxrc ||
1413 display_graphics != system_lyxrc.display_graphics) {
1414 os << "# Display graphics within LyX\n"
1416 << "\\display_graphics "
1417 << (display_graphics ? "true" : "false")
1423 case RC_SORT_LAYOUTS:
1424 if (ignore_system_lyxrc ||
1425 sort_layouts != system_lyxrc.sort_layouts) {
1426 os << "# Sort layouts alphabetically.\n"
1427 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1432 case RC_GROUP_LAYOUTS:
1433 if (ignore_system_lyxrc ||
1434 group_layouts != system_lyxrc.group_layouts) {
1435 os << "# Group layouts by their category.\n"
1436 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1441 case RC_VIEWDVI_PAPEROPTION:
1442 if (ignore_system_lyxrc ||
1443 view_dvi_paper_option
1444 != system_lyxrc.view_dvi_paper_option) {
1445 os << "# Options used to specify paper size to the\n"
1446 << "# view_dvi_command (e.g. -paper)\n"
1447 << "\\view_dvi_paper_option \""
1448 << view_dvi_paper_option << "\"\n";
1453 case RC_CHKTEX_COMMAND:
1454 if (ignore_system_lyxrc ||
1455 chktex_command != system_lyxrc.chktex_command) {
1456 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1461 case RC_BIBTEX_ALTERNATIVES: {
1462 CommandSet::const_iterator it = bibtex_alternatives.begin();
1463 CommandSet::const_iterator end = bibtex_alternatives.end();
1464 for ( ; it != end; ++it) {
1465 if (ignore_system_lyxrc
1466 || !system_lyxrc.bibtex_alternatives.count(*it))
1467 os << "\\bibtex_alternatives \""
1474 case RC_BIBTEX_COMMAND:
1475 if (ignore_system_lyxrc ||
1476 bibtex_command != system_lyxrc.bibtex_command) {
1477 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1482 case RC_JBIBTEX_COMMAND:
1483 if (ignore_system_lyxrc ||
1484 jbibtex_command != system_lyxrc.jbibtex_command) {
1485 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1490 case RC_JBIBTEX_ALTERNATIVES: {
1491 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1492 CommandSet::const_iterator end = jbibtex_alternatives.end();
1493 for ( ; it != end; ++it) {
1494 if (ignore_system_lyxrc
1495 || !system_lyxrc.jbibtex_alternatives.count(*it))
1496 os << "\\jbibtex_alternatives \""
1503 case RC_INDEX_ALTERNATIVES: {
1504 CommandSet::const_iterator it = index_alternatives.begin();
1505 CommandSet::const_iterator end = index_alternatives.end();
1506 for ( ; it != end; ++it) {
1507 if (ignore_system_lyxrc
1508 || !system_lyxrc.index_alternatives.count(*it))
1509 os << "\\index_alternatives \""
1516 case RC_INDEX_COMMAND:
1517 if (ignore_system_lyxrc ||
1518 index_command != system_lyxrc.index_command) {
1519 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1524 case RC_JINDEX_COMMAND:
1525 if (ignore_system_lyxrc ||
1526 jindex_command != system_lyxrc.jindex_command) {
1527 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1532 case RC_SPLITINDEX_COMMAND:
1533 if (ignore_system_lyxrc ||
1534 splitindex_command != system_lyxrc.splitindex_command) {
1535 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1540 case RC_NOMENCL_COMMAND:
1541 if (ignore_system_lyxrc ||
1542 nomencl_command != system_lyxrc.nomencl_command) {
1543 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1548 case RC_PYGMENTIZE_COMMAND:
1549 if (ignore_system_lyxrc ||
1550 pygmentize_command != system_lyxrc.pygmentize_command) {
1551 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1556 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1557 // Don't write this setting to the preferences file,
1558 // but allow temporary changes (bug 7557).
1559 if (ignore_system_lyxrc) {
1560 os << "\\tex_expects_windows_paths "
1561 << convert<string>(windows_style_tex_paths) << '\n';
1566 case RC_TEX_ALLOWS_SPACES:
1567 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1568 os << "\\tex_allows_spaces "
1569 << convert<string>(tex_allows_spaces) << '\n';
1575 if (ignore_system_lyxrc ||
1576 use_kbmap != system_lyxrc.use_kbmap) {
1577 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1582 case RC_KBMAP_PRIMARY:
1583 if (ignore_system_lyxrc ||
1584 primary_kbmap != system_lyxrc.primary_kbmap) {
1585 string const path = os::external_path(primary_kbmap);
1586 os << "\\kbmap_primary \"" << path << "\"\n";
1591 case RC_KBMAP_SECONDARY:
1592 if (ignore_system_lyxrc ||
1593 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1594 string const path = os::external_path(secondary_kbmap);
1595 os << "\\kbmap_secondary \"" << path << "\"\n";
1601 if (ignore_system_lyxrc ||
1602 lyxpipes != system_lyxrc.lyxpipes) {
1603 string const path = os::external_path(lyxpipes);
1604 os << "\\serverpipe \"" << path << "\"\n";
1609 case RC_DATE_INSERT_FORMAT:
1610 if (ignore_system_lyxrc ||
1611 date_insert_format != system_lyxrc.date_insert_format) {
1612 os << "\\date_insert_format \"" << date_insert_format
1619 os << "\\user_name \"" << user_name << "\"\n";
1624 os << "\\user_email \"" << user_email << "\"\n";
1628 case RC_SHOW_BANNER:
1629 if (ignore_system_lyxrc ||
1630 show_banner != system_lyxrc.show_banner) {
1631 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1637 if (ignore_system_lyxrc ||
1638 preview != system_lyxrc.preview) {
1644 case PREVIEW_NO_MATH:
1651 os << "\\preview " << status << '\n';
1656 case RC_PREVIEW_HASHED_LABELS:
1657 if (ignore_system_lyxrc ||
1658 preview_hashed_labels !=
1659 system_lyxrc.preview_hashed_labels) {
1660 os << "\\preview_hashed_labels "
1661 << convert<string>(preview_hashed_labels) << '\n';
1666 case RC_PREVIEW_SCALE_FACTOR:
1667 if (ignore_system_lyxrc ||
1668 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1669 os << "\\preview_scale_factor "
1670 << preview_scale_factor << '\n';
1675 case RC_USE_CONVERTER_CACHE:
1676 if (ignore_system_lyxrc ||
1677 use_converter_cache != system_lyxrc.use_converter_cache) {
1678 os << "\\use_converter_cache "
1679 << convert<string>(use_converter_cache) << '\n';
1684 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1685 if (ignore_system_lyxrc ||
1686 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1687 os << "\\use_converter_needauth_forbidden "
1688 << convert<string>(use_converter_needauth_forbidden) << '\n';
1693 case RC_USE_CONVERTER_NEEDAUTH:
1694 if (ignore_system_lyxrc ||
1695 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1696 os << "\\use_converter_needauth "
1697 << convert<string>(use_converter_needauth) << '\n';
1702 case RC_CONVERTER_CACHE_MAXAGE:
1703 if (ignore_system_lyxrc ||
1704 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1705 os << "\\converter_cache_maxage "
1706 << converter_cache_maxage << '\n';
1712 << "# SCREEN & FONTS SECTION ############################\n"
1716 if (ignore_system_lyxrc ||
1717 icon_set != system_lyxrc.icon_set) {
1718 os << "\\icon_set \"" << icon_set
1724 case RC_USE_SYSTEM_THEME_ICONS:
1725 if (ignore_system_lyxrc ||
1726 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1727 os << "\\use_system_theme_icons "
1728 << convert<string>(use_system_theme_icons)
1735 if (ignore_system_lyxrc ||
1736 dpi != system_lyxrc.dpi) {
1737 os << "\\screen_dpi " << dpi << '\n';
1742 case RC_SCREEN_ZOOM:
1743 if (ignore_system_lyxrc ||
1744 defaultZoom != system_lyxrc.defaultZoom) {
1745 os << "\\screen_zoom " << defaultZoom << '\n';
1750 case RC_GEOMETRY_SESSION:
1751 if (ignore_system_lyxrc ||
1752 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1753 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1759 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1760 if (ignore_system_lyxrc ||
1761 cursor_follows_scrollbar
1762 != system_lyxrc.cursor_follows_scrollbar) {
1763 os << "\\cursor_follows_scrollbar "
1764 << convert<string>(cursor_follows_scrollbar) << '\n';
1769 case RC_CURSOR_WIDTH:
1770 if (ignore_system_lyxrc ||
1772 != system_lyxrc.cursor_width) {
1773 os << "\\cursor_width "
1774 << cursor_width << '\n';
1779 case RC_SCROLL_BELOW_DOCUMENT:
1780 if (ignore_system_lyxrc ||
1781 scroll_below_document
1782 != system_lyxrc.scroll_below_document) {
1783 os << "\\scroll_below_document "
1784 << convert<string>(scroll_below_document) << '\n';
1789 case RC_PARAGRAPH_MARKERS:
1790 if (ignore_system_lyxrc ||
1792 != system_lyxrc.paragraph_markers) {
1793 os << "\\paragraph_markers "
1794 << convert<string>(paragraph_markers) << '\n';
1799 case RC_MAC_DONTSWAP_CTRL_META:
1800 if (ignore_system_lyxrc ||
1801 mac_dontswap_ctrl_meta
1802 != system_lyxrc.mac_dontswap_ctrl_meta) {
1803 os << "\\mac_dontswap_ctrl_meta "
1804 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1809 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1810 if (ignore_system_lyxrc ||
1811 mac_like_cursor_movement
1812 != system_lyxrc.mac_like_cursor_movement) {
1813 os << "\\mac_like_cursor_movement "
1814 << convert<string>(mac_like_cursor_movement) << '\n';
1819 case RC_MACRO_EDIT_STYLE:
1820 if (ignore_system_lyxrc ||
1822 != system_lyxrc.macro_edit_style) {
1823 os << "\\macro_edit_style ";
1824 switch (macro_edit_style) {
1825 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1826 case MACRO_EDIT_INLINE: os << "1\n"; break;
1827 case MACRO_EDIT_LIST: os << "2\n"; break;
1833 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1834 if (ignore_system_lyxrc ||
1835 dialogs_iconify_with_main
1836 != system_lyxrc.dialogs_iconify_with_main) {
1837 os << "\\dialogs_iconify_with_main "
1838 << convert<string>(dialogs_iconify_with_main) << '\n';
1843 case RC_SCREEN_FONT_ROMAN:
1844 if (ignore_system_lyxrc ||
1845 roman_font_name != system_lyxrc.roman_font_name) {
1846 os << "\\screen_font_roman \"" << roman_font_name
1852 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1853 if (ignore_system_lyxrc ||
1854 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1855 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1861 case RC_SCREEN_FONT_SANS:
1862 if (ignore_system_lyxrc ||
1863 sans_font_name != system_lyxrc.sans_font_name) {
1864 os << "\\screen_font_sans \"" << sans_font_name
1870 case RC_SCREEN_FONT_SANS_FOUNDRY:
1871 if (ignore_system_lyxrc ||
1872 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1873 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1879 case RC_SCREEN_FONT_TYPEWRITER:
1880 if (ignore_system_lyxrc ||
1881 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1882 os << "\\screen_font_typewriter \""
1883 << typewriter_font_name << "\"\n";
1888 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1889 if (ignore_system_lyxrc ||
1890 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1891 os << "\\screen_font_typewriter_foundry \""
1892 << typewriter_font_foundry << "\"\n";
1897 case RC_SCREEN_FONT_SCALABLE:
1898 if (ignore_system_lyxrc ||
1899 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1900 os << "\\screen_font_scalable "
1901 << convert<string>(use_scalable_fonts)
1907 case RC_SCREEN_FONT_SIZES:
1908 if (ignore_system_lyxrc ||
1909 font_sizes[FONT_SIZE_TINY]
1910 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1911 font_sizes[FONT_SIZE_SCRIPT]
1912 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1913 font_sizes[FONT_SIZE_FOOTNOTE]
1914 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1915 font_sizes[FONT_SIZE_SMALL]
1916 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1917 font_sizes[FONT_SIZE_NORMAL]
1918 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1919 font_sizes[FONT_SIZE_LARGE]
1920 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1921 font_sizes[FONT_SIZE_LARGER]
1922 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1923 font_sizes[FONT_SIZE_LARGEST]
1924 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1925 font_sizes[FONT_SIZE_HUGE]
1926 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1927 font_sizes[FONT_SIZE_HUGER]
1928 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1929 streamsize old_prec = os.precision();
1930 os.setf(ios::fixed);
1932 os << "\\screen_font_sizes"
1933 << ' ' << font_sizes[FONT_SIZE_TINY]
1934 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1935 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1936 << ' ' << font_sizes[FONT_SIZE_SMALL]
1937 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1938 << ' ' << font_sizes[FONT_SIZE_LARGE]
1939 << ' ' << font_sizes[FONT_SIZE_LARGER]
1940 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1941 << ' ' << font_sizes[FONT_SIZE_HUGE]
1942 << ' ' << font_sizes[FONT_SIZE_HUGER]
1944 os.precision(old_prec);
1945 os.unsetf(ios::fixed);
1950 case RC_FULL_SCREEN_LIMIT:
1951 if (ignore_system_lyxrc ||
1952 full_screen_limit != system_lyxrc.full_screen_limit) {
1953 os << "\\fullscreen_limit "
1954 << convert<string>(full_screen_limit)
1960 case RC_FULL_SCREEN_TOOLBARS:
1961 if (ignore_system_lyxrc ||
1962 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1963 os << "\\fullscreen_toolbars "
1964 << convert<string>(full_screen_toolbars)
1970 case RC_FULL_SCREEN_SCROLLBAR:
1971 if (ignore_system_lyxrc ||
1972 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1973 os << "\\fullscreen_scrollbar "
1974 << convert<string>(full_screen_scrollbar)
1980 case RC_FULL_SCREEN_STATUSBAR:
1981 if (ignore_system_lyxrc ||
1982 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1983 os << "\\fullscreen_statusbar "
1984 << convert<string>(full_screen_statusbar)
1990 case RC_FULL_SCREEN_TABBAR:
1991 if (ignore_system_lyxrc ||
1992 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1993 os << "\\fullscreen_tabbar "
1994 << convert<string>(full_screen_tabbar)
2000 case RC_FULL_SCREEN_MENUBAR:
2001 if (ignore_system_lyxrc ||
2002 full_screen_menubar != system_lyxrc.full_screen_menubar) {
2003 os << "\\fullscreen_menubar "
2004 << convert<string>(full_screen_menubar)
2010 case RC_FULL_SCREEN_WIDTH:
2011 if (ignore_system_lyxrc ||
2012 full_screen_width != system_lyxrc.full_screen_width) {
2013 os << "\\fullscreen_width "
2014 << convert<string>(full_screen_width)
2020 case RC_OPEN_BUFFERS_IN_TABS:
2021 if (ignore_system_lyxrc ||
2022 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2023 os << "\\open_buffers_in_tabs "
2024 << convert<string>(open_buffers_in_tabs)
2030 case RC_SINGLE_CLOSE_TAB_BUTTON:
2031 if (ignore_system_lyxrc ||
2032 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2033 os << "\\single_close_tab_button "
2034 << convert<string>(single_close_tab_button)
2040 case RC_SINGLE_INSTANCE:
2041 if (ignore_system_lyxrc ||
2042 single_instance != system_lyxrc.single_instance) {
2043 os << "\\single_instance "
2044 << convert<string>(single_instance)
2050 case RC_FORWARD_SEARCH_DVI:
2051 if (ignore_system_lyxrc ||
2052 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2053 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2058 case RC_FORWARD_SEARCH_PDF:
2059 if (ignore_system_lyxrc ||
2060 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2061 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2067 << "# COLOR SECTION ###################################\n"
2072 for (int i = 0; i < Color_ignore; ++i) {
2073 ColorCode lc = static_cast<ColorCode>(i);
2074 string const col = lcolor.getX11Name(lc);
2075 if (ignore_system_lyxrc
2076 || col != system_lcolor.getX11Name(lc)) {
2077 os << "\\set_color \""
2078 << lcolor.getLyXName(lc) << "\" \""
2086 << "# PRINTER SECTION ###################################\n"
2090 case RC_PRINTLANDSCAPEFLAG:
2091 if (ignore_system_lyxrc ||
2092 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2093 os << "\\print_landscape_flag \"" << print_landscape_flag
2099 case RC_PRINTPAPERFLAG:
2100 if (ignore_system_lyxrc ||
2101 print_paper_flag != system_lyxrc.print_paper_flag) {
2102 os << "\\print_paper_flag \"" << print_paper_flag
2108 case RC_PRINTPAPERDIMENSIONFLAG:
2109 if (ignore_system_lyxrc ||
2110 print_paper_dimension_flag
2111 != system_lyxrc.print_paper_dimension_flag) {
2112 os << "\\print_paper_dimension_flag \""
2113 << print_paper_dimension_flag << "\"\n";
2119 << "# TEX SECTION #######################################\n"
2123 case RC_TEXINPUTS_PREFIX:
2124 if (ignore_system_lyxrc ||
2125 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2126 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2131 case RC_FONT_ENCODING:
2132 if (ignore_system_lyxrc ||
2133 fontenc != system_lyxrc.fontenc) {
2134 os << "\\font_encoding \"" << fontenc << "\"\n";
2140 << "# FILE SECTION ######################################\n"
2144 case RC_DOCUMENTPATH:
2145 if (ignore_system_lyxrc ||
2146 document_path != system_lyxrc.document_path) {
2147 string const path = os::external_path(document_path);
2148 os << "\\document_path \"" << path << "\"\n";
2153 case RC_USELASTFILEPOS:
2154 if (ignore_system_lyxrc ||
2155 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2156 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2162 case RC_LOADSESSION:
2163 if (ignore_system_lyxrc ||
2164 load_session != system_lyxrc.load_session) {
2165 os << "\\load_session " << convert<string>(load_session)
2171 case RC_MOUSE_WHEEL_SPEED:
2172 if (ignore_system_lyxrc ||
2173 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2174 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2179 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2180 if (ignore_system_lyxrc ||
2181 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2182 os << "\\mouse_middlebutton_paste "
2183 << convert<string>(mouse_middlebutton_paste) << '\n';
2188 case RC_COMPLETION_INLINE_DELAY:
2189 if (ignore_system_lyxrc ||
2190 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2191 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2196 case RC_COMPLETION_INLINE_MATH:
2197 if (ignore_system_lyxrc ||
2198 completion_inline_math != system_lyxrc.completion_inline_math) {
2199 os << "\\completion_inline_math "
2200 << convert<string>(completion_inline_math) << '\n';
2205 case RC_COMPLETION_INLINE_TEXT:
2206 if (ignore_system_lyxrc ||
2207 completion_inline_text != system_lyxrc.completion_inline_text) {
2208 os << "\\completion_inline_text "
2209 << convert<string>(completion_inline_text) << '\n';
2214 case RC_COMPLETION_INLINE_DOTS:
2215 if (ignore_system_lyxrc ||
2216 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2217 os << "\\completion_inline_dots "
2218 << convert<string>(completion_inline_dots) << '\n';
2223 case RC_AUTOCORRECTION_MATH:
2224 if (ignore_system_lyxrc ||
2225 autocorrection_math != system_lyxrc.autocorrection_math) {
2226 os << "\\autocorrection_math "
2227 << convert<string>(autocorrection_math) << '\n';
2232 case RC_COMPLETION_POPUP_DELAY:
2233 if (ignore_system_lyxrc ||
2234 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2235 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2240 case RC_COMPLETION_POPUP_MATH:
2241 if (ignore_system_lyxrc ||
2242 completion_popup_math != system_lyxrc.completion_popup_math) {
2243 os << "\\completion_popup_math "
2244 << convert<string>(completion_popup_math) << '\n';
2249 case RC_COMPLETION_POPUP_TEXT:
2250 if (ignore_system_lyxrc ||
2251 completion_popup_text != system_lyxrc.completion_popup_text) {
2252 os << "\\completion_popup_text "
2253 << convert<string>(completion_popup_text) << '\n';
2258 case RC_COMPLETION_CURSOR_TEXT:
2259 if (ignore_system_lyxrc ||
2260 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2261 os << "\\completion_cursor_text "
2262 << convert<string>(completion_cursor_text) << '\n';
2267 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2268 if (ignore_system_lyxrc ||
2269 completion_popup_after_complete
2270 != system_lyxrc.completion_popup_after_complete) {
2271 os << "\\completion_popup_after_complete "
2272 << convert<string>(completion_popup_after_complete) << '\n';
2277 case RC_COMPLETION_MINLENGTH:
2278 if (ignore_system_lyxrc ||
2279 completion_minlength != system_lyxrc.completion_minlength) {
2280 os << "\\completion_minlength " << convert<string>(completion_minlength)
2286 case RC_NUMLASTFILES:
2287 if (ignore_system_lyxrc ||
2288 num_lastfiles != system_lyxrc.num_lastfiles) {
2289 os << "\\num_lastfiles " << num_lastfiles << '\n';
2294 case RC_CHECKLASTFILES:
2295 if (ignore_system_lyxrc ||
2296 check_lastfiles != system_lyxrc.check_lastfiles) {
2297 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2303 case RC_EXAMPLEPATH:
2304 if (ignore_system_lyxrc ||
2305 example_path != system_lyxrc.example_path) {
2306 string const path = os::external_path(example_path);
2307 os << "\\example_path \"" << path << "\"\n";
2312 case RC_TEMPLATEPATH:
2313 if (ignore_system_lyxrc ||
2314 template_path != system_lyxrc.template_path) {
2315 string const path = os::external_path(template_path);
2316 os << "\\template_path \"" << path << "\"\n";
2321 case RC_TEMPDIRPATH:
2322 if (ignore_system_lyxrc ||
2323 tempdir_path != system_lyxrc.tempdir_path) {
2324 string const path = os::external_path(tempdir_path);
2325 os << "\\tempdir_path \"" << path << "\"\n";
2330 case RC_THESAURUSDIRPATH:
2331 if (ignore_system_lyxrc ||
2332 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2333 string const path = os::external_path(thesaurusdir_path);
2334 os << "\\thesaurusdir_path \"" << path << "\"\n";
2339 case RC_HUNSPELLDIR_PATH:
2340 if (ignore_system_lyxrc ||
2341 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2342 string const path = os::external_path(hunspelldir_path);
2343 os << "\\hunspelldir_path \"" << path << "\"\n";
2348 case RC_PLAINTEXT_LINELEN:
2349 if (ignore_system_lyxrc ||
2350 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2351 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2356 case RC_MAKE_BACKUP:
2357 if (ignore_system_lyxrc ||
2358 make_backup != system_lyxrc.make_backup) {
2359 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2364 case RC_SAVE_COMPRESSED:
2365 if (ignore_system_lyxrc ||
2366 save_compressed != system_lyxrc.save_compressed) {
2367 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2372 case RC_SAVE_ORIGIN:
2373 if (ignore_system_lyxrc ||
2374 save_origin != system_lyxrc.save_origin) {
2375 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2380 case RC_BACKUPDIR_PATH:
2381 if (ignore_system_lyxrc ||
2382 backupdir_path != system_lyxrc.backupdir_path) {
2383 string const path = os::external_path(backupdir_path);
2384 os << "\\backupdir_path \"" << path << "\"\n";
2390 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2394 << "# SPELLCHECKER SECTION ##############################\n"
2398 case RC_ACCEPT_COMPOUND:
2399 if (ignore_system_lyxrc ||
2400 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2401 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2408 if (ignore_system_lyxrc ||
2409 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2410 os << "\\alternate_language \"" << spellchecker_alt_lang
2417 if (ignore_system_lyxrc ||
2418 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2419 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2424 case RC_USE_NATIVE_FILEDIALOG:
2425 if (ignore_system_lyxrc ||
2426 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2427 os << "\\use_native_filedialog "
2428 << convert<string>(use_native_filedialog)
2434 case RC_USE_SYSTEM_COLORS:
2435 if (ignore_system_lyxrc ||
2436 use_system_colors != system_lyxrc.use_system_colors) {
2437 os << "\\use_system_colors "
2438 << convert<string>(use_system_colors)
2444 case RC_USE_TOOLTIP:
2445 if (ignore_system_lyxrc ||
2446 use_tooltip != system_lyxrc.use_tooltip) {
2447 os << "\\use_tooltip "
2448 << convert<string>(use_tooltip)
2454 case RC_USE_PIXMAP_CACHE:
2455 if (ignore_system_lyxrc ||
2456 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2457 os << "\\use_pixmap_cache "
2458 << convert<string>(use_pixmap_cache)
2465 if (ignore_system_lyxrc ||
2466 use_qimage != system_lyxrc.use_qimage) {
2467 os << "\\use_qimage "
2468 << convert<string>(use_qimage)
2475 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2479 case RC_DEFAULT_DECIMAL_POINT:
2480 if (ignore_system_lyxrc ||
2481 default_decimal_point != system_lyxrc.default_decimal_point) {
2482 os << "\\default_decimal_point " << default_decimal_point << '\n';
2487 case RC_DEFAULT_LENGTH_UNIT:
2488 if (ignore_system_lyxrc ||
2489 default_length_unit != system_lyxrc.default_length_unit) {
2490 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2495 case RC_SPELLCHECKER:
2496 if (ignore_system_lyxrc ||
2497 spellchecker != system_lyxrc.spellchecker) {
2498 os << "\\spellchecker " << spellchecker << '\n';
2503 case RC_SPELLCHECK_CONTINUOUSLY:
2504 if (ignore_system_lyxrc ||
2505 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2506 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2512 case RC_SPELLCHECK_NOTES:
2513 if (ignore_system_lyxrc ||
2514 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2515 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2521 case RC_VISUAL_CURSOR:
2522 if (ignore_system_lyxrc ||
2523 visual_cursor != system_lyxrc.visual_cursor) {
2524 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2529 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2530 if (ignore_system_lyxrc ||
2531 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2532 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2533 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2538 case RC_LANGUAGE_CUSTOM_PACKAGE:
2539 if (ignore_system_lyxrc ||
2540 language_custom_package != system_lyxrc.language_custom_package) {
2541 os << "\\language_custom_package \"" << language_custom_package
2547 case RC_LANGUAGE_GLOBAL_OPTIONS:
2548 if (ignore_system_lyxrc ||
2549 language_global_options
2550 != system_lyxrc.language_global_options) {
2551 os << "\\language_global_options \""
2552 << convert<string>(language_global_options)
2558 case RC_LANGUAGE_PACKAGE_SELECTION:
2559 if (ignore_system_lyxrc ||
2560 language_package_selection != system_lyxrc.language_package_selection) {
2561 os << "\\language_package_selection ";
2562 switch (language_package_selection) {
2580 case RC_LANGUAGE_COMMAND_BEGIN:
2581 if (ignore_system_lyxrc ||
2582 language_command_begin
2583 != system_lyxrc.language_command_begin) {
2584 os << "\\language_command_begin \""
2585 << language_command_begin
2591 case RC_LANGUAGE_COMMAND_END:
2592 if (ignore_system_lyxrc ||
2593 language_command_end
2594 != system_lyxrc.language_command_end) {
2595 os << "\\language_command_end \"" << language_command_end
2601 case RC_LANGUAGE_COMMAND_LOCAL:
2602 if (ignore_system_lyxrc ||
2603 language_command_local
2604 != system_lyxrc.language_command_local) {
2605 os << "\\language_command_local \""
2606 << language_command_local
2612 case RC_LANGUAGE_AUTO_BEGIN:
2613 if (ignore_system_lyxrc ||
2614 language_auto_begin != system_lyxrc.language_auto_begin) {
2615 os << "\\language_auto_begin "
2616 << convert<string>(language_auto_begin) << '\n';
2621 case RC_LANGUAGE_AUTO_END:
2622 if (ignore_system_lyxrc ||
2623 language_auto_end != system_lyxrc.language_auto_end) {
2624 os << "\\language_auto_end "
2625 << convert<string>(language_auto_end) << '\n';
2630 case RC_MARK_FOREIGN_LANGUAGE:
2631 if (ignore_system_lyxrc ||
2632 mark_foreign_language
2633 != system_lyxrc.mark_foreign_language) {
2634 os << "\\mark_foreign_language " <<
2635 convert<string>(mark_foreign_language) << '\n';
2641 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2645 case RC_AUTO_NUMBER:
2646 if (ignore_system_lyxrc ||
2647 auto_number != system_lyxrc.auto_number) {
2648 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2653 case RC_GUI_LANGUAGE:
2654 if (ignore_system_lyxrc ||
2655 gui_language != system_lyxrc.gui_language) {
2656 os << "\\gui_language " << gui_language << '\n';
2661 case RC_EXPORT_OVERWRITE:
2662 if (ignore_system_lyxrc ||
2663 export_overwrite != system_lyxrc.export_overwrite) {
2665 switch (export_overwrite) {
2676 os << "\\export_overwrite " << status << '\n';
2681 case RC_SCROLL_WHEEL_ZOOM:
2682 if (ignore_system_lyxrc ||
2683 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2685 switch (scroll_wheel_zoom) {
2686 case SCROLL_WHEEL_ZOOM_OFF:
2689 case SCROLL_WHEEL_ZOOM_CTRL:
2692 case SCROLL_WHEEL_ZOOM_SHIFT:
2695 case SCROLL_WHEEL_ZOOM_ALT:
2699 os << "\\scroll_wheel_zoom " << status << '\n';
2705 << "# FORMATS SECTION ##########################\n"
2710 // New/modified formats
2711 for (Formats::const_iterator cit = theFormats().begin();
2712 cit != theFormats().end(); ++cit) {
2713 Format const * format =
2714 theSystemFormats().getFormat(cit->name());
2716 format->extensions() != cit->extensions() ||
2717 format->prettyname() != cit->prettyname() ||
2718 format->shortcut() != cit->shortcut() ||
2719 format->viewer() != cit->viewer() ||
2720 format->editor() != cit->editor() ||
2721 format->documentFormat() != cit->documentFormat() ||
2722 format->vectorFormat() != cit->vectorFormat() ||
2723 format->inExportMenu() != cit->inExportMenu() ||
2724 format->mime() != cit->mime()) {
2725 os << "\\format \"" << cit->name() << "\" \""
2726 << cit->extensions() << "\" \""
2727 << to_utf8(cit->prettyname()) << "\" \""
2728 << cit->shortcut() << "\" \""
2729 << escapeCommand(cit->viewer()) << "\" \""
2730 << escapeCommand(cit->editor()) << "\" \"";
2731 vector<string> flags;
2732 if (cit->documentFormat())
2733 flags.push_back("document");
2734 if (cit->vectorFormat())
2735 flags.push_back("vector");
2736 if (cit->zippedNative())
2737 flags.push_back("zipped=native");
2738 if (cit->inExportMenu())
2739 flags.push_back("menu=export");
2741 os << getStringFromVector(flags);
2742 os << "\" \"" << cit->mime() << "\"\n";
2746 // Look for deleted formats
2747 for (Formats::const_iterator cit = theSystemFormats().begin();
2748 cit != theSystemFormats().end(); ++cit)
2749 if (!theFormats().getFormat(cit->name()))
2750 os << "\\format \"" << cit->name()
2751 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2755 case RC_VIEWER_ALTERNATIVES: {
2756 Alternatives::const_iterator it = viewer_alternatives.begin();
2757 Alternatives::const_iterator const en = viewer_alternatives.end();
2758 Alternatives::const_iterator const sysend =
2759 system_lyxrc.viewer_alternatives.end();
2760 for (; it != en; ++it) {
2761 string const & fmt = it->first;
2762 CommandSet const & cmd = it->second;
2763 CommandSet::const_iterator sit = cmd.begin();
2764 CommandSet::const_iterator const sen = cmd.end();
2765 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2766 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2767 system_lyxrc.viewer_alternatives.find(fmt);
2768 for (; sit != sen; ++sit) {
2769 string const & cmd = *sit;
2770 if (ignore_system_lyxrc
2771 || sysfmt == sysend // format not found
2772 || sysfmt->second.count(cmd) == 0 // this command not found
2774 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2781 case RC_EDITOR_ALTERNATIVES: {
2782 Alternatives::const_iterator it = editor_alternatives.begin();
2783 Alternatives::const_iterator const en = editor_alternatives.end();
2784 Alternatives::const_iterator const sysend =
2785 system_lyxrc.editor_alternatives.end();
2786 for (; it != en; ++it) {
2787 string const & fmt = it->first;
2788 CommandSet const & cmd = it->second;
2789 CommandSet::const_iterator sit = cmd.begin();
2790 CommandSet::const_iterator const sen = cmd.end();
2791 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2792 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2793 system_lyxrc.editor_alternatives.find(fmt);
2794 for (; sit != sen; ++sit) {
2795 string const & cmd = *sit;
2796 if (ignore_system_lyxrc
2797 || sysfmt == sysend // format not found
2798 || sysfmt->second.count(cmd) == 0 // this command not found
2800 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2807 case RC_DEFAULT_OTF_VIEW_FORMAT:
2808 if ((ignore_system_lyxrc ||
2809 default_otf_view_format != system_lyxrc.default_otf_view_format)
2810 && !default_otf_view_format.empty()) {
2811 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2816 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2817 if ((ignore_system_lyxrc ||
2818 default_platex_view_format != system_lyxrc.default_platex_view_format)
2819 && !default_platex_view_format.empty()) {
2820 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2825 case RC_DEFAULT_VIEW_FORMAT:
2826 if (ignore_system_lyxrc ||
2827 default_view_format != system_lyxrc.default_view_format) {
2828 os << "\\default_view_format " << default_view_format << '\n';
2839 << "# CONVERTERS SECTION ##########################\n"
2844 // Look for new converters
2845 for (Converters::const_iterator cit = theConverters().begin();
2846 cit != theConverters().end(); ++cit) {
2847 Converter const * converter =
2848 theSystemConverters().getConverter(cit->from(),
2851 converter->command() != cit->command() ||
2852 converter->flags() != cit->flags())
2853 os << "\\converter \"" << cit->from() << "\" \""
2854 << cit->to() << "\" \""
2855 << escapeCommand(cit->command()) << "\" \""
2856 << cit->flags() << "\"\n";
2859 // New/modifed converters
2860 for (Converters::const_iterator cit = theSystemConverters().begin();
2861 cit != theSystemConverters().end(); ++cit)
2862 if (!theConverters().getConverter(cit->from(), cit->to()))
2863 os << "\\converter \"" << cit->from()
2864 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2871 << "# COPIERS SECTION ##########################\n"
2874 // Look for new movers
2875 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2876 Movers::const_iterator const sysend = theSystemMovers().end();
2877 Movers::const_iterator it = theMovers().begin();
2878 Movers::const_iterator end = theMovers().end();
2880 for (; it != end; ++it) {
2881 Movers::const_iterator const sysit =
2882 find_if(sysbegin, sysend, SameMover(*it));
2883 if (sysit == sysend) {
2884 string const & fmt = it->first;
2885 string const & command =
2886 it->second.command();
2888 os << "\\copier " << fmt
2889 << " \"" << escapeCommand(command) << "\"\n";
2895 // We don't actually delete SpecialisedMover(s) from the
2896 // map, just clear their 'command', so there's no need
2897 // to test for anything else.
2904 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2906 // Why the switch you might ask. It is a trick to ensure that all
2907 // the elements in the LyXRCTags enum is handled. As you can see
2908 // there are no breaks at all. So it is just a huge fall-through.
2909 // The nice thing is that we will get a warning from the compiler
2910 // if we forget an element.
2911 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2913 case LyXRC::RC_LAST:
2914 case LyXRC::RC_ACCEPT_COMPOUND:
2915 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2916 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2918 case LyXRC::RC_ALT_LANG:
2919 case LyXRC::RC_PLAINTEXT_LINELEN:
2920 case LyXRC::RC_AUTOCORRECTION_MATH:
2921 case LyXRC::RC_AUTOREGIONDELETE:
2922 case LyXRC::RC_AUTORESET_OPTIONS:
2923 case LyXRC::RC_AUTOSAVE:
2924 case LyXRC::RC_AUTO_NUMBER:
2925 case LyXRC::RC_BACKUPDIR_PATH:
2926 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2927 case LyXRC::RC_BIBTEX_COMMAND:
2928 case LyXRC::RC_BINDFILE:
2929 case LyXRC::RC_CHECKLASTFILES:
2930 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2931 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2932 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2933 case LyXRC::RC_COMPLETION_INLINE_MATH:
2934 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2935 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2936 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2937 case LyXRC::RC_COMPLETION_POPUP_MATH:
2938 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2939 case LyXRC::RC_COMPLETION_MINLENGTH:
2940 case LyXRC::RC_USELASTFILEPOS:
2941 case LyXRC::RC_LOADSESSION:
2942 case LyXRC::RC_CHKTEX_COMMAND:
2943 case LyXRC::RC_CONVERTER:
2944 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2945 case LyXRC::RC_COPIER:
2946 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2947 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2948 case LyXRC::RC_DATE_INSERT_FORMAT:
2949 case LyXRC::RC_GUI_LANGUAGE:
2950 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2951 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2952 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2953 case LyXRC::RC_DEFFILE:
2954 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2955 case LyXRC::RC_DISPLAY_GRAPHICS:
2956 case LyXRC::RC_DOCUMENTPATH:
2957 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2958 FileName path(lyxrc_new.document_path);
2959 if (path.exists() && path.isDirectory())
2960 package().document_dir() = FileName(lyxrc.document_path);
2963 case LyXRC::RC_EDITOR_ALTERNATIVES:
2964 case LyXRC::RC_ESC_CHARS:
2965 case LyXRC::RC_EXAMPLEPATH:
2966 case LyXRC::RC_FONT_ENCODING:
2967 case LyXRC::RC_FILEFORMAT:
2968 case LyXRC::RC_GROUP_LAYOUTS:
2969 case LyXRC::RC_HUNSPELLDIR_PATH:
2970 case LyXRC::RC_ICON_SET:
2971 case LyXRC::RC_INDEX_ALTERNATIVES:
2972 case LyXRC::RC_INDEX_COMMAND:
2973 case LyXRC::RC_JBIBTEX_COMMAND:
2974 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2975 case LyXRC::RC_JINDEX_COMMAND:
2976 case LyXRC::RC_NOMENCL_COMMAND:
2977 case LyXRC::RC_PYGMENTIZE_COMMAND:
2978 case LyXRC::RC_INPUT:
2979 case LyXRC::RC_KBMAP:
2980 case LyXRC::RC_KBMAP_PRIMARY:
2981 case LyXRC::RC_KBMAP_SECONDARY:
2982 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2983 case LyXRC::RC_LANGUAGE_AUTO_END:
2984 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2985 case LyXRC::RC_LANGUAGE_COMMAND_END:
2986 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2987 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2988 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2989 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2990 case LyXRC::RC_LYXRCFORMAT:
2991 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2992 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2993 case LyXRC::RC_MACRO_EDIT_STYLE:
2994 case LyXRC::RC_MAKE_BACKUP:
2995 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2996 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2997 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2998 case LyXRC::RC_NUMLASTFILES:
2999 case LyXRC::RC_PARAGRAPH_MARKERS:
3000 case LyXRC::RC_PATH_PREFIX:
3001 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
3002 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
3003 // Resets python path
3004 support::os::python(true);
3007 case LyXRC::RC_PREVIEW:
3008 if (lyxrc_orig.preview != lyxrc_new.preview) {
3009 // Update all previews of all documents.
3010 /* FIXME: this can be very expensive. It would be cheaper
3011 * to kill all existing previews and update visible
3013 theBufferList().updatePreviews();
3016 case LyXRC::RC_PREVIEW_HASHED_LABELS:
3017 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
3018 case LyXRC::RC_PRINTLANDSCAPEFLAG:
3019 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
3020 case LyXRC::RC_PRINTPAPERFLAG:
3021 case LyXRC::RC_SAVE_COMPRESSED:
3022 case LyXRC::RC_SAVE_ORIGIN:
3023 case LyXRC::RC_SCREEN_DPI:
3025 case LyXRC::RC_SCREEN_FONT_ROMAN:
3026 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3027 case LyXRC::RC_SCREEN_FONT_SANS:
3028 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3029 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3030 case LyXRC::RC_SCREEN_FONT_SIZES:
3031 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3032 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3033 case LyXRC::RC_SCREEN_ZOOM:
3034 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
3035 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
3036 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
3037 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
3038 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
3039 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
3040 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
3041 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
3042 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
3043 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
3046 case LyXRC::RC_GEOMETRY_SESSION:
3047 case LyXRC::RC_SERVERPIPE:
3048 case LyXRC::RC_SET_COLOR:
3049 case LyXRC::RC_SHOW_BANNER:
3050 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3051 case LyXRC::RC_SPELLCHECKER:
3052 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3055 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3056 case LyXRC::RC_SPELLCHECK_NOTES:
3057 case LyXRC::RC_SPLITINDEX_COMMAND:
3058 case LyXRC::RC_TEMPDIRPATH:
3059 case LyXRC::RC_TEMPLATEPATH:
3060 case LyXRC::RC_TEX_ALLOWS_SPACES:
3061 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3062 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3063 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3066 case LyXRC::RC_TEXINPUTS_PREFIX:
3067 case LyXRC::RC_THESAURUSDIRPATH:
3068 case LyXRC::RC_UIFILE:
3069 case LyXRC::RC_USER_EMAIL:
3070 case LyXRC::RC_USER_NAME:
3071 case LyXRC::RC_USE_CONVERTER_CACHE:
3072 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
3073 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
3074 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
3075 case LyXRC::RC_USE_SYSTEM_COLORS:
3076 case LyXRC::RC_USE_TOOLTIP:
3077 case LyXRC::RC_USE_PIXMAP_CACHE:
3078 case LyXRC::RC_USE_QIMAGE:
3079 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3080 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3081 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3082 case LyXRC::RC_SINGLE_INSTANCE:
3083 case LyXRC::RC_SORT_LAYOUTS:
3084 case LyXRC::RC_FULL_SCREEN_LIMIT:
3085 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3086 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3087 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3088 case LyXRC::RC_FULL_SCREEN_TABBAR:
3089 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3090 case LyXRC::RC_FULL_SCREEN_WIDTH:
3091 case LyXRC::RC_VISUAL_CURSOR:
3092 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3093 case LyXRC::RC_VIEWER:
3094 case LyXRC::RC_VIEWER_ALTERNATIVES:
3095 case LyXRC::RC_FORWARD_SEARCH_DVI:
3096 case LyXRC::RC_FORWARD_SEARCH_PDF:
3097 case LyXRC::RC_EXPORT_OVERWRITE:
3098 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3099 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3100 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3101 case LyXRC::RC_CURSOR_WIDTH:
3108 string const LyXRC::getDescription(LyXRCTags tag)
3113 case RC_ACCEPT_COMPOUND:
3114 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3118 str = _("Specify an alternate language. The default is to use the language of the document.");
3121 case RC_PLAINTEXT_LINELEN:
3122 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.");
3125 case RC_AUTOREGIONDELETE:
3126 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3129 case RC_AUTORESET_OPTIONS:
3130 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3134 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3137 case RC_AUTO_NUMBER:
3140 case RC_BACKUPDIR_PATH:
3141 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.");
3144 case RC_BIBTEX_COMMAND:
3145 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3148 case RC_JBIBTEX_COMMAND:
3149 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3153 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3156 case RC_CHECKLASTFILES:
3157 str = _("Select to check whether the lastfiles still exist.");
3160 case RC_CHKTEX_COMMAND:
3161 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3167 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3168 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3171 case RC_CONVERTER_NEEDAUTH:
3172 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3178 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3179 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.");
3182 case RC_CURSOR_WIDTH:
3183 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3186 case RC_SCROLL_BELOW_DOCUMENT:
3187 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");
3190 case RC_MAC_DONTSWAP_CTRL_META:
3191 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3194 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3195 str = _("Use the Mac OS X conventions for cursor movement");
3198 case RC_SHOW_MACRO_LABEL:
3199 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3202 case RC_DATE_INSERT_FORMAT:
3203 //xgettext:no-c-format
3204 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3208 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3211 case RC_DEFAULT_OTF_VIEW_FORMAT:
3212 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3215 case RC_DEFAULT_VIEW_FORMAT:
3216 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3219 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3220 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3223 case RC_DISPLAY_GRAPHICS:
3224 str = _("Select how LyX will display any graphics.");
3227 case RC_DOCUMENTPATH:
3228 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3232 str = _("Specify additional chars that can be part of a word.");
3235 case RC_EXAMPLEPATH:
3236 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3239 case RC_FONT_ENCODING:
3240 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3246 case RC_INDEX_COMMAND:
3247 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\".");
3250 case RC_JINDEX_COMMAND:
3251 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3254 case RC_NOMENCL_COMMAND:
3255 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3258 case RC_PYGMENTIZE_COMMAND:
3259 str = _("The command to run the python pygments syntax highlighter.");
3266 case RC_KBMAP_PRIMARY:
3267 case RC_KBMAP_SECONDARY:
3268 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.");
3271 case RC_LANGUAGE_AUTO_BEGIN:
3272 str = _("Select if a language switching command is needed at the beginning of the document.");
3275 case RC_LANGUAGE_AUTO_END:
3276 str = _("Select if a language switching command is needed at the end of the document.");
3279 case RC_LANGUAGE_COMMAND_BEGIN:
3280 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.");
3283 case RC_LANGUAGE_COMMAND_END:
3284 str = _("The LaTeX command for changing back to the language of the document.");
3287 case RC_LANGUAGE_COMMAND_LOCAL:
3288 str = _("The LaTeX command for local changing of the language.");
3291 case RC_LANGUAGE_GLOBAL_OPTIONS:
3292 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3295 case RC_LANGUAGE_CUSTOM_PACKAGE:
3296 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3299 case RC_LANGUAGE_PACKAGE_SELECTION:
3300 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3303 case RC_USELASTFILEPOS:
3304 str = _("De-select if you do not want LyX to scroll to saved position.");
3307 case RC_LOADSESSION:
3308 str = _("De-select to prevent loading files opened from the last LyX session.");
3311 case RC_MAKE_BACKUP:
3312 str = _("De-select if you don't want LyX to create backup files.");
3315 case RC_MARK_FOREIGN_LANGUAGE:
3316 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3319 case RC_MOUSE_WHEEL_SPEED:
3320 str = _("The scrolling speed of the mouse wheel.");
3323 case RC_COMPLETION_POPUP_DELAY:
3324 str = _("The completion popup delay.");
3327 case RC_COMPLETION_POPUP_MATH:
3328 str = _("Select to display the completion popup in math mode.");
3331 case RC_COMPLETION_POPUP_TEXT:
3332 str = _("Select to display the completion popup in text mode.");
3335 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3336 str = _("Show the completion popup without delay after non-unique completion attempt.");
3339 case RC_COMPLETION_POPUP_TEXT:
3340 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3343 case RC_COMPLETION_POPUP_DELAY:
3344 str = _("The inline completion delay.");
3347 case RC_COMPLETION_INLINE_MATH:
3348 str = _("Select to display the inline completion in math mode.");
3351 case RC_COMPLETION_INLINE_TEXT:
3352 str = _("Select to display the inline completion in text mode.");
3355 case RC_COMPLETION_INLINE_DOTS:
3356 str = _("Use \"...\" to shorten long completions.");
3359 case RC_AUTOCORRECTION_MATH:
3360 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3363 case RC_NUMLASTFILES:
3364 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3368 case RC_PATH_PREFIX:
3369 str = _("Specify those directories which should be "
3370 "prepended to the PATH environment variable.\n"
3371 "Use the OS native format.");
3375 str = _("Shows a typeset preview of things such as math");
3378 case RC_PREVIEW_HASHED_LABELS:
3379 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3382 case RC_PREVIEW_SCALE_FACTOR:
3383 str = _("Scale the preview size to suit.");
3386 case RC_PRINTLANDSCAPEFLAG:
3387 str = _("The option to print out in landscape.");
3390 case RC_PRINTPAPERDIMENSIONFLAG:
3391 str = _("Option to specify the dimensions of the print paper.");
3394 case RC_PRINTPAPERFLAG:
3395 str = _("The option to specify paper type.");
3398 case RC_VISUAL_CURSOR:
3399 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3402 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3403 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).");
3407 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3410 case RC_SCREEN_FONT_ROMAN:
3411 case RC_SCREEN_FONT_SANS:
3412 case RC_SCREEN_FONT_TYPEWRITER:
3413 str = _("The screen fonts used to display the text while editing.");
3416 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3417 case RC_SCREEN_FONT_SANS_FOUNDRY:
3418 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3421 case RC_SCREEN_FONT_SCALABLE:
3422 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.");
3425 case RC_SCREEN_FONT_SIZES:
3426 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3429 case RC_SCREEN_ZOOM:
3430 //xgettext:no-c-format
3431 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3434 case RC_GEOMETRY_SESSION:
3435 str = _("Allow session manager to save and restore windows geometry.");
3439 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3445 case RC_SHOW_BANNER:
3446 str = _("De-select if you don't want the startup banner.");
3449 case RC_TEMPDIRPATH:
3450 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3453 case RC_THESAURUSDIRPATH:
3454 str = _("This is the place where the files of the thesaurus library reside.");
3457 case RC_TEMPLATEPATH:
3458 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3461 case RC_TEX_ALLOWS_SPACES:
3464 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3467 case RC_TEXINPUTS_PREFIX:
3468 str = _("Specify those directories which should be "
3469 "prepended to the TEXINPUTS environment variable.\n"
3470 "A '.' represents the current document directory. "
3471 "Use the OS native format.");
3475 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3484 case RC_USE_USE_SYSTEM_COLORS:
3485 str = _("Enable use the system colors for some things like main window background and selection.");
3488 case RC_USE_TOOLTIP:
3489 str = _("Enable the automatic appearance of tool tips in the work area.");
3492 case RC_USE_PIXMAP_CACHE:
3493 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3496 case RC_VIEWDVI_PAPEROPTION:
3497 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3512 // The global instance
3515 // The global copy of the system lyxrc entries (everything except preferences)