3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
21 #include "BufferList.h"
23 #include "Converter.h"
24 #include "FontEnums.h"
30 #include "SpellChecker.h"
33 #include "graphics/GraphicsTypes.h"
35 #include "support/convert.h"
36 #include "support/debug.h"
37 #include "support/environment.h"
38 #include "support/FileName.h"
39 #include "support/filetools.h"
40 #include "support/gettext.h"
41 #include "support/lstrings.h"
42 #include "support/os.h"
43 #include "support/Package.h"
44 #include "support/TempFile.h"
45 #include "support/userinfo.h"
52 using namespace lyx::support;
56 namespace os = support::os;
60 // The format should also be updated in configure.py, and conversion code
61 // should be added to prefs2prefs_prefs.py.
62 static unsigned int const LYXRC_FILEFORMAT = 26; // spitz: remove font_encoding
64 // when adding something to this array keep it sorted!
65 LexerKeyword lyxrcTags[] = {
66 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
67 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
68 { "\\alternate_language", LyXRC::RC_ALT_LANG },
69 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
70 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
71 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
72 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
73 { "\\autosave", LyXRC::RC_AUTOSAVE },
74 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
75 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
76 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
77 { "\\bind_file", LyXRC::RC_BINDFILE },
78 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
79 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
80 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
81 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
82 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
83 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
84 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
85 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
86 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
87 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
88 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
89 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
90 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
91 { "\\converter", LyXRC::RC_CONVERTER },
92 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
93 { "\\copier", LyXRC::RC_COPIER },
94 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
95 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
96 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
97 { "\\def_file", LyXRC::RC_DEFFILE },
98 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
99 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
100 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
101 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
102 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
103 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
104 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
105 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
106 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
107 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
108 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
109 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
110 { "\\format", LyXRC::RC_FILEFORMAT },
111 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
112 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
113 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
114 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
115 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
116 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
117 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
118 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
119 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
120 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
121 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
122 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
123 { "\\icon_set", LyXRC::RC_ICON_SET },
124 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
125 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
126 { "\\input", LyXRC::RC_INPUT },
127 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
128 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
129 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
130 { "\\kbmap", LyXRC::RC_KBMAP },
131 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
132 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
133 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
134 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
135 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
136 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
137 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
138 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
139 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
140 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
141 { "\\load_session", LyXRC::RC_LOADSESSION },
142 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
143 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
144 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
145 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
146 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
147 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
148 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
149 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
150 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
151 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
152 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
153 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
154 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
155 { "\\preview", LyXRC::RC_PREVIEW },
156 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
157 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
158 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
159 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
160 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
161 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
162 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
163 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
164 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
165 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
166 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
167 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
168 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
169 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
170 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
171 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
172 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
173 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
174 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
175 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
176 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
177 { "\\set_color", LyXRC::RC_SET_COLOR },
178 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
179 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
180 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
181 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
182 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
183 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
184 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
185 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
186 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
187 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
188 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
189 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
190 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
191 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
192 { "\\ui_file", LyXRC::RC_UIFILE },
193 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
194 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
195 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
196 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
197 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
198 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
199 // compatibility with versions older than 1.4.0 only
200 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
201 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
202 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
203 { "\\user_email", LyXRC::RC_USER_EMAIL },
204 { "\\user_name", LyXRC::RC_USER_NAME },
205 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
206 // compatibility with versions older than 1.4.0 only
207 { "\\viewer", LyXRC::RC_VIEWER},
208 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
209 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
210 { "format", LyXRC::RC_LYXRCFORMAT }
213 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
224 void LyXRC::setDefaults()
227 use_system_theme_icons = false;
229 def_file = "default";
231 // The current document directory
232 texinputs_prefix = ".";
233 print_landscape_flag = "-t landscape";
234 print_paper_flag = "-t";
235 print_paper_dimension_flag = "-T";
236 document_path.erase();
237 view_dvi_paper_option.erase();
238 default_view_format = "pdf2";
239 default_otf_view_format = "pdf4";
240 default_platex_view_format = "pdf3";
241 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
242 bibtex_command = "automatic";
243 index_command = "makeindex -c -q";
244 nomencl_command = "makeindex -s nomencl.ist";
245 pygmentize_command = string();
247 // Because a screen is typically wider than a piece of paper:
249 currentZoom = defaultZoom;
250 allow_geometry_session = true;
251 // Default LaTeX font size:
252 font_sizes[FONT_SIZE_TINY] = "5.0";
253 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
254 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
255 font_sizes[FONT_SIZE_SMALL] = "9.0";
256 font_sizes[FONT_SIZE_NORMAL] = "10.0";
257 font_sizes[FONT_SIZE_LARGE] = "12.0";
258 font_sizes[FONT_SIZE_LARGER] = "14.4";
259 font_sizes[FONT_SIZE_LARGEST] = "17.26";
260 font_sizes[FONT_SIZE_HUGE] = "20.74";
261 font_sizes[FONT_SIZE_HUGER] = "24.88";
262 use_scalable_fonts = true;
263 roman_font_name = "";
265 typewriter_font_name = "";
267 auto_region_delete = true;
268 auto_reset_options = false;
269 plaintext_linelen = 65;
270 mouse_wheel_speed = 1.0;
272 check_lastfiles = true;
273 use_lastfilepos = true;
274 use_native_filedialog = true;
275 load_session = false;
277 save_compressed = false;
279 backupdir_path.erase();
280 display_graphics = true;
281 // Spellchecker settings:
282 // FIXME: this check should test the target platform (darwin)
283 #if defined(USE_MACOSX_PACKAGING)
284 spellchecker = "native";
285 #elif defined(USE_ENCHANT)
286 spellchecker = "enchant";
287 #elif defined(USE_ASPELL)
288 spellchecker = "aspell";
289 #elif defined(USE_HUNSPELL)
290 spellchecker = "hunspell";
292 spellchecker = "aspell";
294 spellchecker_accept_compound = false;
295 spellcheck_continuously = false;
296 completion_minlength = 6;
297 spellcheck_notes = true;
299 visual_cursor = false;
301 mark_foreign_language = true;
302 language_auto_begin = true;
303 language_auto_end = true;
304 language_global_options = true;
305 language_package_selection = LP_AUTO;
306 language_custom_package = "\\usepackage{babel}";
307 language_command_begin = "\\selectlanguage{$$lang}";
308 language_command_local = "\\foreignlanguage{$$lang}{";
309 sort_layouts = false;
310 group_layouts = true;
311 gui_language = "auto";
313 windows_style_tex_paths = false;
314 tex_allows_spaces = false;
315 date_insert_format = "%x";
316 cursor_follows_scrollbar = false;
317 scroll_below_document = false;
318 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
319 paragraph_markers = false;
320 mac_dontswap_ctrl_meta = false;
321 mac_like_cursor_movement = false;
322 macro_edit_style = MACRO_EDIT_INLINE_BOX;
323 dialogs_iconify_with_main = false;
324 preview = PREVIEW_OFF;
325 preview_hashed_labels = false;
326 preview_scale_factor = 1.0;
327 use_converter_cache = true;
328 use_converter_needauth_forbidden = true;
329 use_converter_needauth = true;
330 use_system_colors = false;
332 use_pixmap_cache = false;
333 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
334 user_name = to_utf8(support::user_name());
335 user_email = to_utf8(support::user_email());
336 open_buffers_in_tabs = true;
337 single_close_tab_button = false;
338 single_instance = true;
339 forward_search_dvi = string();
340 forward_search_pdf = string();
341 export_overwrite = NO_FILES;
343 // Fullscreen settings
344 full_screen_limit = false;
345 full_screen_toolbars = true;
346 full_screen_tabbar = true;
347 full_screen_menubar = true;
348 full_screen_statusbar = true;
349 full_screen_scrollbar = true;
350 full_screen_width = 700;
352 completion_cursor_text = true;
353 completion_popup_math = true;
354 completion_popup_text = false;
355 completion_popup_delay = 2.0;
356 completion_popup_after_complete = true;
357 autocorrection_math = false;
358 completion_inline_math = true;
359 completion_inline_text = false;
360 completion_inline_dots = -1;
361 completion_inline_delay = 0.2;
362 default_decimal_point = ".";
363 default_length_unit = Length::CM;
365 close_buffer_with_last_view = "yes";
366 mouse_middlebutton_paste = true;
372 void oldFontFormat(string & family, string & foundry)
374 if (family.empty() || family[0] != '-')
376 foundry = token(family, '-', 1);
377 family = token(family, '-', 2);
385 bool LyXRC::read(FileName const & filename, bool check_format)
387 Lexer lexrc(lyxrcTags);
388 lexrc.setFile(filename);
389 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
390 ReturnValues retval = read(lexrc, check_format);
391 if (!check_format || retval != FormatMismatch)
392 return retval == ReadOK;
394 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
395 TempFile tmp("convert_lyxrc");
396 FileName const tempfile = tmp.name();
397 bool const success = prefs2prefs(filename, tempfile, false);
399 LYXERR0 ("Unable to convert " << filename.absFileName() <<
400 " to format " << LYXRC_FILEFORMAT);
403 // Keep this in the else branch, such that lexrc2 goes out
404 // of scope and releases the lock on tempfile before we
405 // attempt to remove it. This matters on Windows.
406 Lexer lexrc2(lyxrcTags);
407 lexrc2.setFile(tempfile);
408 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
409 retval = read(lexrc2, check_format);
411 return retval == ReadOK;
415 // don't need to worry about conversion, because this is always
416 // from an internal source
417 bool LyXRC::read(istream & is)
419 Lexer lexrc(lyxrcTags);
421 LYXERR(Debug::LYXRC, "Reading istream...");
422 return read(lexrc, false) == ReadOK;
426 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
428 if (lyxerr.debugging(Debug::PARSER))
429 lexrc.printTable(lyxerr);
434 // format prior to 2.0 and introduction of format tag
435 unsigned int rc_format = 0;
437 while (lexrc.isOK()) {
438 // By using two switches we take advantage of the compiler
439 // telling us if we have missed a LyXRCTags element in
440 // the second switch.
441 // Note that this also shows a problem with Lexer since it
442 // helps us avoid taking advantage of the strictness of the
445 int le = lexrc.lex();
447 case Lexer::LEX_UNDEF:
448 lexrc.printError("Unknown tag `$$Token'");
450 case Lexer::LEX_FEOF:
455 switch (static_cast<LyXRCTags>(le)) {
458 rc_format = lexrc.getInteger();
460 case RC_INPUT: // Include file
463 libFileSearch(string(),
465 if (!read(tmp, check_format)) {
467 "Error reading included file: " + tmp.absFileName());
473 bind_file = os::internal_path(lexrc.getString());
478 def_file = os::internal_path(lexrc.getString());
483 ui_file = os::internal_path(lexrc.getString());
486 case RC_AUTORESET_OPTIONS:
487 lexrc >> auto_reset_options;
490 case RC_DISPLAY_GRAPHICS:
492 display_graphics = lexrc.getString() == "true";
495 case RC_TEX_EXPECTS_WINDOWS_PATHS:
496 lexrc >> windows_style_tex_paths;
499 case RC_TEX_ALLOWS_SPACES:
500 lexrc >> tex_allows_spaces;
503 case RC_TEXINPUTS_PREFIX:
504 lexrc >> texinputs_prefix;
511 case RC_KBMAP_PRIMARY:
513 string const kmap(os::internal_path(lexrc.getString()));
514 if (!libFileSearch("kbd", kmap, "kmap").empty()
516 primary_kbmap = kmap;
518 lexrc.printError("LyX: Keymap `$$Token' not found");
523 case RC_KBMAP_SECONDARY:
525 string const kmap(os::internal_path(lexrc.getString()));
526 if (!libFileSearch("kbd", kmap, "kmap").empty()
528 secondary_kbmap = kmap;
530 lexrc.printError("LyX: Keymap `$$Token' not found");
535 case RC_PRINTLANDSCAPEFLAG:
536 lexrc >> print_landscape_flag;
539 case RC_PRINTPAPERDIMENSIONFLAG:
540 lexrc >> print_paper_dimension_flag;
543 case RC_PRINTPAPERFLAG:
544 lexrc >> print_paper_flag;
547 case RC_PYGMENTIZE_COMMAND:
548 if (lexrc.next(true)) {
549 pygmentize_command = lexrc.getString();
553 case RC_VIEWDVI_PAPEROPTION:
555 view_dvi_paper_option = lexrc.getString();
557 view_dvi_paper_option.erase();
560 case RC_CHKTEX_COMMAND:
561 if (lexrc.next(true)) {
562 chktex_command = lexrc.getString();
566 case RC_BIBTEX_ALTERNATIVES:
567 if (lexrc.next(true)) {
568 bibtex_alternatives.insert(lexrc.getString());
572 case RC_BIBTEX_COMMAND:
573 if (lexrc.next(true)) {
574 bibtex_command = lexrc.getString();
578 case RC_JBIBTEX_COMMAND:
579 if (lexrc.next(true)) {
580 jbibtex_command = lexrc.getString();
584 case RC_JBIBTEX_ALTERNATIVES:
585 if (lexrc.next(true)) {
586 jbibtex_alternatives.insert(lexrc.getString());
590 case RC_INDEX_ALTERNATIVES:
591 if (lexrc.next(true)) {
592 index_alternatives.insert(lexrc.getString());
596 case RC_INDEX_COMMAND:
597 if (lexrc.next(true)) {
598 index_command = lexrc.getString();
602 case RC_JINDEX_COMMAND:
603 if (lexrc.next(true)) {
604 jindex_command = lexrc.getString();
608 case RC_SPLITINDEX_COMMAND:
609 if (lexrc.next(true)) {
610 splitindex_command = lexrc.getString();
614 case RC_NOMENCL_COMMAND:
615 if (lexrc.next(true)) {
616 nomencl_command = lexrc.getString();
625 lexrc >> defaultZoom;
626 if (defaultZoom < 10)
630 case RC_GEOMETRY_SESSION:
631 lexrc >> allow_geometry_session;
634 case RC_SCREEN_FONT_SIZES:
635 lexrc >> font_sizes[FONT_SIZE_TINY];
636 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
637 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
638 lexrc >> font_sizes[FONT_SIZE_SMALL];
639 lexrc >> font_sizes[FONT_SIZE_NORMAL];
640 lexrc >> font_sizes[FONT_SIZE_LARGE];
641 lexrc >> font_sizes[FONT_SIZE_LARGER];
642 lexrc >> font_sizes[FONT_SIZE_LARGEST];
643 lexrc >> font_sizes[FONT_SIZE_HUGE];
644 lexrc >> font_sizes[FONT_SIZE_HUGER];
647 case RC_SCREEN_FONT_SCALABLE:
648 lexrc >> use_scalable_fonts;
655 case RC_DOCUMENTPATH:
657 document_path = os::internal_path(lexrc.getString());
662 example_path = os::internal_path(lexrc.getString());
665 case RC_TEMPLATEPATH:
667 template_path = os::internal_path(lexrc.getString());
672 tempdir_path = os::internal_path(lexrc.getString());
675 case RC_THESAURUSDIRPATH:
677 thesaurusdir_path = os::internal_path(lexrc.getString());
680 case RC_HUNSPELLDIR_PATH:
682 hunspelldir_path = os::internal_path(lexrc.getString());
685 case RC_USELASTFILEPOS:
686 lexrc >> use_lastfilepos;
690 lexrc >> load_session;
693 case RC_MOUSE_WHEEL_SPEED:
694 lexrc >> mouse_wheel_speed;
697 case RC_COMPLETION_INLINE_DELAY:
698 lexrc >> completion_inline_delay;
701 case RC_COMPLETION_INLINE_MATH:
702 lexrc >> completion_inline_math;
705 case RC_COMPLETION_INLINE_TEXT:
706 lexrc >> completion_inline_text;
709 case RC_COMPLETION_INLINE_DOTS:
710 lexrc >> completion_inline_dots;
713 case RC_AUTOCORRECTION_MATH:
714 lexrc >> autocorrection_math;
717 case RC_COMPLETION_POPUP_DELAY:
718 lexrc >> completion_popup_delay;
721 case RC_COMPLETION_POPUP_MATH:
722 lexrc >> completion_popup_math;
725 case RC_COMPLETION_POPUP_TEXT:
726 lexrc >> completion_popup_text;
729 case RC_COMPLETION_CURSOR_TEXT:
730 lexrc >> completion_cursor_text;
733 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
734 lexrc >> completion_popup_after_complete;
737 case RC_COMPLETION_MINLENGTH:
738 lexrc >> completion_minlength;
741 case RC_NUMLASTFILES:
742 lexrc >> num_lastfiles;
745 case RC_CHECKLASTFILES:
746 lexrc >> check_lastfiles;
753 case RC_USE_SYSTEM_THEME_ICONS:
754 lexrc >> use_system_theme_icons;
757 case RC_SCREEN_FONT_ROMAN:
759 roman_font_name = lexrc.getString();
760 oldFontFormat(roman_font_name,
765 case RC_SCREEN_FONT_SANS:
767 sans_font_name = lexrc.getString();
768 oldFontFormat(sans_font_name, sans_font_foundry);
772 case RC_SCREEN_FONT_TYPEWRITER:
774 typewriter_font_name = lexrc.getString();
775 oldFontFormat(typewriter_font_name,
776 typewriter_font_foundry);
780 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
781 lexrc >> roman_font_foundry;
784 case RC_SCREEN_FONT_SANS_FOUNDRY:
785 lexrc >> sans_font_foundry;
788 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
789 lexrc >> typewriter_font_foundry;
794 lexrc.printError("Missing color tag.");
797 string lyx_name = lexrc.getString();
800 lexrc.printError("Missing color name for color: `$$Token'");
803 string x11_name = lexrc.getString();
805 ColorCode const col =
806 lcolor.getFromLyXName(lyx_name);
807 if (col == Color_none ||
808 col == Color_inherit ||
812 if (!lcolor.setColor(col, x11_name))
813 LYXERR0("Bad lyxrc set_color for " << lyx_name);
817 case RC_AUTOREGIONDELETE:
818 // Auto region delete defaults to true
819 lexrc >> auto_region_delete;
824 lyxpipes = os::internal_path(lexrc.getString());
827 case RC_CURSOR_FOLLOWS_SCROLLBAR:
828 lexrc >> cursor_follows_scrollbar;
831 case RC_CURSOR_WIDTH:
832 lexrc >> cursor_width;
835 case RC_SCROLL_BELOW_DOCUMENT:
836 lexrc >> scroll_below_document;
839 case RC_PARAGRAPH_MARKERS:
840 lexrc >> paragraph_markers;
843 case RC_MAC_DONTSWAP_CTRL_META:
844 lexrc >> mac_dontswap_ctrl_meta;
847 case RC_MAC_LIKE_CURSOR_MOVEMENT:
848 lexrc >> mac_like_cursor_movement;
851 case RC_MACRO_EDIT_STYLE:
853 switch (lexrc.getInteger()) {
854 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
855 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
856 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
861 case RC_DIALOGS_ICONIFY_WITH_MAIN:
862 lexrc >> dialogs_iconify_with_main;
865 case RC_PLAINTEXT_LINELEN:
866 lexrc >> plaintext_linelen;
868 // Spellchecker settings:
869 case RC_ACCEPT_COMPOUND:
870 lexrc >> spellchecker_accept_compound;
872 case RC_USE_NATIVE_FILEDIALOG:
873 lexrc >> use_native_filedialog;
875 case RC_USE_SYSTEM_COLORS:
876 lexrc >> use_system_colors;
879 lexrc >> use_tooltip;
881 case RC_USE_PIXMAP_CACHE:
882 lexrc >> use_pixmap_cache;
884 case RC_SPELLCHECKER:
885 lexrc >> spellchecker;
888 lexrc >> spellchecker_alt_lang;
891 lexrc >> spellchecker_esc_chars;
893 case RC_SPELLCHECK_CONTINUOUSLY:
894 lexrc >> spellcheck_continuously;
896 case RC_SPELLCHECK_NOTES:
897 lexrc >> spellcheck_notes;
900 lexrc >> make_backup;
902 case RC_SAVE_COMPRESSED:
903 lexrc >> save_compressed;
906 lexrc >> save_origin;
908 case RC_BACKUPDIR_PATH:
910 backupdir_path = os::internal_path(lexrc.getString());
912 case RC_DEFAULT_DECIMAL_POINT:
913 lexrc >> default_decimal_point;
915 case RC_DEFAULT_LENGTH_UNIT:
917 default_length_unit = (Length::UNIT) lexrc.getInteger();
919 case RC_DATE_INSERT_FORMAT:
920 lexrc >> date_insert_format;
922 case RC_LANGUAGE_CUSTOM_PACKAGE:
923 lexrc >> language_custom_package;
925 case RC_LANGUAGE_AUTO_BEGIN:
926 lexrc >> language_auto_begin;
928 case RC_LANGUAGE_AUTO_END:
929 lexrc >> language_auto_end;
931 case RC_LANGUAGE_GLOBAL_OPTIONS:
932 lexrc >> language_global_options;
934 case RC_LANGUAGE_PACKAGE_SELECTION:
936 switch (lexrc.getInteger()) {
938 language_package_selection = LP_AUTO;
941 language_package_selection = LP_BABEL;
944 language_package_selection = LP_CUSTOM;
947 language_package_selection = LP_NONE;
952 case RC_LANGUAGE_COMMAND_BEGIN:
953 lexrc >> language_command_begin;
955 case RC_LANGUAGE_COMMAND_END:
956 lexrc >> language_command_end;
958 case RC_LANGUAGE_COMMAND_LOCAL:
959 lexrc >> language_command_local;
961 case RC_VISUAL_CURSOR:
962 lexrc >> visual_cursor;
964 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
965 lexrc >> close_buffer_with_last_view;
968 lexrc >> auto_number;
970 case RC_MARK_FOREIGN_LANGUAGE:
971 lexrc >> mark_foreign_language;
977 fmt = lexrc.getString();
978 if (lexrc.next(true))
979 command = lexrc.getString();
980 setMover(fmt, command);
985 string from, to, command, flags;
987 from = lexrc.getString();
989 to = lexrc.getString();
990 if (lexrc.next(true))
991 command = lexrc.getString();
993 flags = lexrc.getString();
995 theConverters().erase(from, to);
997 theConverters().add(from, to, command, flags);
1000 // compatibility with versions older than 1.4.0 only
1002 string format, command;
1003 lexrc >> format >> command;
1004 theFormats().setViewer(format, command);
1007 case RC_FILEFORMAT: {
1009 string format, extensions, shortcut;
1010 docstring prettyname;
1011 if (!(lexrc >> format >> extensions))
1013 if (ok && lexrc.next(true))
1014 prettyname = lexrc.getDocString();
1018 if(!(lexrc >> shortcut))
1020 string viewer, editor;
1021 if (ok && lexrc.next(true))
1022 viewer = lexrc.getString();
1025 if (ok && lexrc.next(true))
1026 editor = lexrc.getString();
1030 if (!(lexrc >> flags >> mime))
1032 int flgs = Format::none;
1033 while (!flags.empty()) {
1035 flags = split(flags, flag, ',');
1036 if (flag == "document")
1037 flgs |= Format::document;
1038 else if (flag == "vector")
1039 flgs |= Format::vector;
1040 else if (flag == "zipped=native")
1041 flgs |= Format::zipped_native;
1042 else if (flag == "menu=export")
1043 flgs |= Format::export_menu;
1045 LYXERR0("Ignoring unknown flag `"
1046 << flag << "' for format `"
1050 LYXERR0("Syntax error in format " << format);
1051 else if (prettyname.empty()) {
1052 if (theConverters().formatIsUsed(format))
1053 LYXERR0("Can't delete format " << format);
1055 theFormats().erase(format);
1057 theFormats().add(format, extensions, prettyname,
1058 shortcut, viewer, editor, mime, flgs);
1062 case RC_VIEWER_ALTERNATIVES: {
1063 string format, command;
1064 if ((lexrc >> format) && lexrc.next(true)) {
1065 command = lexrc.getString();
1066 viewer_alternatives[format].insert(command);
1070 case RC_EDITOR_ALTERNATIVES: {
1071 string format, command;
1072 if ((lexrc >> format) && lexrc.next(true)) {
1073 command = lexrc.getString();
1074 editor_alternatives[format].insert(command);
1079 case RC_DEFAULT_OTF_VIEW_FORMAT:
1080 lexrc >> default_otf_view_format;
1083 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
1084 lexrc >> default_platex_view_format;
1087 case RC_DEFAULT_VIEW_FORMAT:
1088 lexrc >> default_view_format;
1091 case RC_GUI_LANGUAGE:
1092 lexrc >> gui_language;
1095 case RC_SHOW_BANNER:
1096 lexrc >> show_banner;
1101 string const tmp = lexrc.getString();
1102 if (tmp == "true" || tmp == "on")
1103 preview = PREVIEW_ON;
1104 else if (tmp == "no_math")
1105 preview = PREVIEW_NO_MATH;
1107 preview = PREVIEW_OFF;
1108 if (tmp != "false" && tmp != "off")
1109 LYXERR0("Unrecognized preview status \""
1115 case RC_PREVIEW_HASHED_LABELS:
1116 lexrc >> preview_hashed_labels;
1119 case RC_PREVIEW_SCALE_FACTOR:
1120 lexrc >> preview_scale_factor;
1127 lexrc >> user_email;
1130 case RC_PATH_PREFIX:
1131 lexrc >> path_prefix;
1134 case RC_USE_CONVERTER_CACHE:
1135 lexrc >> use_converter_cache;
1137 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1138 lexrc >> use_converter_needauth_forbidden;
1140 case RC_USE_CONVERTER_NEEDAUTH:
1141 lexrc >> use_converter_needauth;
1143 case RC_CONVERTER_CACHE_MAXAGE:
1144 lexrc >> converter_cache_maxage;
1147 case RC_SORT_LAYOUTS:
1148 lexrc >> sort_layouts;
1150 case RC_GROUP_LAYOUTS:
1151 lexrc >> group_layouts;
1153 case RC_FULL_SCREEN_LIMIT:
1154 lexrc >> full_screen_limit;
1156 case RC_FULL_SCREEN_TOOLBARS:
1157 lexrc >> full_screen_toolbars;
1159 case RC_FULL_SCREEN_SCROLLBAR:
1160 lexrc >> full_screen_scrollbar;
1162 case RC_FULL_SCREEN_STATUSBAR:
1163 lexrc >> full_screen_statusbar;
1165 case RC_FULL_SCREEN_TABBAR:
1166 lexrc >> full_screen_tabbar;
1168 case RC_FULL_SCREEN_MENUBAR:
1169 lexrc >> full_screen_menubar;
1171 case RC_FULL_SCREEN_WIDTH:
1172 lexrc >> full_screen_width;
1174 case RC_OPEN_BUFFERS_IN_TABS:
1175 lexrc >> open_buffers_in_tabs;
1177 case RC_SINGLE_CLOSE_TAB_BUTTON:
1178 lexrc >> single_close_tab_button;
1180 case RC_SINGLE_INSTANCE:
1181 lexrc >> single_instance;
1182 if (run_mode == PREFERRED)
1183 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1185 case RC_FORWARD_SEARCH_DVI:
1186 if (lexrc.next(true))
1187 forward_search_dvi = lexrc.getString();
1189 case RC_FORWARD_SEARCH_PDF:
1190 if (lexrc.next(true))
1191 forward_search_pdf = lexrc.getString();
1193 case RC_EXPORT_OVERWRITE:
1195 string const tmp = lexrc.getString();
1196 if (tmp == "all" || tmp == "true")
1197 export_overwrite = ALL_FILES;
1198 else if (tmp == "main")
1199 export_overwrite = MAIN_FILE;
1201 export_overwrite = NO_FILES;
1202 if (tmp != "ask" && tmp != "false")
1203 LYXERR0("Unrecognized export_overwrite status \""
1208 case RC_SCROLL_WHEEL_ZOOM:
1210 string const tmp = lexrc.getString();
1212 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1213 else if (tmp == "shift")
1214 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1215 else if (tmp == "alt")
1216 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1218 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1219 if (tmp != "off" && tmp != "false")
1220 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1226 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1227 lexrc >> mouse_middlebutton_paste;
1231 break; // this is just a dummy
1234 // This is triggered the first time through the loop unless
1235 // we hit a format tag.
1236 if (check_format && rc_format != LYXRC_FILEFORMAT)
1237 return FormatMismatch;
1240 /// Update converters data-structures
1241 theConverters().update(theFormats());
1242 theConverters().buildGraph();
1243 theBufferList().invalidateConverterCache();
1249 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1251 ofstream ofs(filename.toFilesystemEncoding().c_str());
1253 write(ofs, ignore_system_lyxrc);
1257 void LyXRC::print() const
1259 if (lyxerr.debugging())
1260 write(lyxerr, false);
1268 typedef pair<string, SpecialisedMover> Data;
1270 SameMover(Data const & comparison)
1271 : comparison_(comparison) {}
1273 bool operator()(Data const & data) const
1275 return data.first == comparison_.first &&
1276 data.second.command() == comparison_.second.command();
1286 // Escape \ and " so that LyXLex can read the string later
1287 string escapeCommand(string const & str) {
1288 return subst(subst(str , "\\", "\\\\"),
1295 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1297 LyXRCTags tag = RC_LAST;
1299 if (!name.empty()) {
1300 for (int i = 0; i != lyxrcCount; ++i)
1301 if ("\\" + name == lyxrcTags[i].tag)
1302 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1306 os << "# LyX " << lyx_version
1307 << " generated this file. If you want to make your own\n"
1308 << "# modifications you should do them from inside LyX and save.\n\n"
1309 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1311 // Why the switch you might ask. It is a trick to ensure that all
1312 // the elements in the LyXRCTags enum are handled. As you can see
1313 // there are no breaks at all. So it is just a huge fall-through.
1314 // The nice thing is that we will get a warning from the compiler
1315 // if we forget an element.
1319 // input/include files are not done here
1320 case RC_LYXRCFORMAT:
1322 if (ignore_system_lyxrc ||
1323 bind_file != system_lyxrc.bind_file) {
1324 string const path = os::external_path(bind_file);
1325 os << "\\bind_file \"" << path << "\"\n";
1331 if (ignore_system_lyxrc ||
1332 def_file != system_lyxrc.def_file) {
1333 string const path = os::external_path(def_file);
1334 os << "\\def_file \"" << path << "\"\n";
1343 << "# MISC SECTION ######################################\n"
1345 // bind files are not done here.
1347 case RC_PATH_PREFIX:
1348 if (ignore_system_lyxrc ||
1349 path_prefix != system_lyxrc.path_prefix) {
1350 os << "\\path_prefix \"" << path_prefix << "\"\n";
1356 if (ignore_system_lyxrc ||
1357 ui_file != system_lyxrc.ui_file) {
1358 string const path = os::external_path(ui_file);
1359 os << "\\ui_file \"" << path << "\"\n";
1364 case RC_AUTOREGIONDELETE:
1365 if (ignore_system_lyxrc ||
1366 auto_region_delete != system_lyxrc.auto_region_delete) {
1367 os << "# Set to false to inhibit automatic replacement of\n"
1368 << "# the current selection.\n"
1369 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1375 case RC_AUTORESET_OPTIONS:
1376 if (ignore_system_lyxrc ||
1377 auto_reset_options != system_lyxrc.auto_reset_options) {
1378 os << "# Set to false to inhibit automatic reset of\n"
1379 << "# the class options to defaults on class change.\n"
1380 << "\\auto_reset_options "
1381 << convert<string>(auto_reset_options)
1388 if (ignore_system_lyxrc ||
1389 autosave != system_lyxrc.autosave) {
1390 os << "# The time interval between auto-saves in seconds.\n"
1391 << "\\autosave " << autosave << '\n';
1396 case RC_DISPLAY_GRAPHICS:
1397 if (ignore_system_lyxrc ||
1398 display_graphics != system_lyxrc.display_graphics) {
1399 os << "# Display graphics within LyX\n"
1401 << "\\display_graphics "
1402 << (display_graphics ? "true" : "false")
1408 case RC_SORT_LAYOUTS:
1409 if (ignore_system_lyxrc ||
1410 sort_layouts != system_lyxrc.sort_layouts) {
1411 os << "# Sort layouts alphabetically.\n"
1412 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1417 case RC_GROUP_LAYOUTS:
1418 if (ignore_system_lyxrc ||
1419 group_layouts != system_lyxrc.group_layouts) {
1420 os << "# Group layouts by their category.\n"
1421 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1426 case RC_VIEWDVI_PAPEROPTION:
1427 if (ignore_system_lyxrc ||
1428 view_dvi_paper_option
1429 != system_lyxrc.view_dvi_paper_option) {
1430 os << "# Options used to specify paper size to the\n"
1431 << "# view_dvi_command (e.g. -paper)\n"
1432 << "\\view_dvi_paper_option \""
1433 << view_dvi_paper_option << "\"\n";
1438 case RC_CHKTEX_COMMAND:
1439 if (ignore_system_lyxrc ||
1440 chktex_command != system_lyxrc.chktex_command) {
1441 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1446 case RC_BIBTEX_ALTERNATIVES: {
1447 CommandSet::const_iterator it = bibtex_alternatives.begin();
1448 CommandSet::const_iterator end = bibtex_alternatives.end();
1449 for ( ; it != end; ++it) {
1450 if (ignore_system_lyxrc
1451 || !system_lyxrc.bibtex_alternatives.count(*it))
1452 os << "\\bibtex_alternatives \""
1459 case RC_BIBTEX_COMMAND:
1460 if (ignore_system_lyxrc ||
1461 bibtex_command != system_lyxrc.bibtex_command) {
1462 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1467 case RC_JBIBTEX_COMMAND:
1468 if (ignore_system_lyxrc ||
1469 jbibtex_command != system_lyxrc.jbibtex_command) {
1470 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1475 case RC_JBIBTEX_ALTERNATIVES: {
1476 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1477 CommandSet::const_iterator end = jbibtex_alternatives.end();
1478 for ( ; it != end; ++it) {
1479 if (ignore_system_lyxrc
1480 || !system_lyxrc.jbibtex_alternatives.count(*it))
1481 os << "\\jbibtex_alternatives \""
1488 case RC_INDEX_ALTERNATIVES: {
1489 CommandSet::const_iterator it = index_alternatives.begin();
1490 CommandSet::const_iterator end = index_alternatives.end();
1491 for ( ; it != end; ++it) {
1492 if (ignore_system_lyxrc
1493 || !system_lyxrc.index_alternatives.count(*it))
1494 os << "\\index_alternatives \""
1501 case RC_INDEX_COMMAND:
1502 if (ignore_system_lyxrc ||
1503 index_command != system_lyxrc.index_command) {
1504 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1509 case RC_JINDEX_COMMAND:
1510 if (ignore_system_lyxrc ||
1511 jindex_command != system_lyxrc.jindex_command) {
1512 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1517 case RC_SPLITINDEX_COMMAND:
1518 if (ignore_system_lyxrc ||
1519 splitindex_command != system_lyxrc.splitindex_command) {
1520 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1525 case RC_NOMENCL_COMMAND:
1526 if (ignore_system_lyxrc ||
1527 nomencl_command != system_lyxrc.nomencl_command) {
1528 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1533 case RC_PYGMENTIZE_COMMAND:
1534 if (ignore_system_lyxrc ||
1535 pygmentize_command != system_lyxrc.pygmentize_command) {
1536 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1541 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1542 // Don't write this setting to the preferences file,
1543 // but allow temporary changes (bug 7557).
1544 if (ignore_system_lyxrc) {
1545 os << "\\tex_expects_windows_paths "
1546 << convert<string>(windows_style_tex_paths) << '\n';
1551 case RC_TEX_ALLOWS_SPACES:
1552 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1553 os << "\\tex_allows_spaces "
1554 << convert<string>(tex_allows_spaces) << '\n';
1560 if (ignore_system_lyxrc ||
1561 use_kbmap != system_lyxrc.use_kbmap) {
1562 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1567 case RC_KBMAP_PRIMARY:
1568 if (ignore_system_lyxrc ||
1569 primary_kbmap != system_lyxrc.primary_kbmap) {
1570 string const path = os::external_path(primary_kbmap);
1571 os << "\\kbmap_primary \"" << path << "\"\n";
1576 case RC_KBMAP_SECONDARY:
1577 if (ignore_system_lyxrc ||
1578 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1579 string const path = os::external_path(secondary_kbmap);
1580 os << "\\kbmap_secondary \"" << path << "\"\n";
1586 if (ignore_system_lyxrc ||
1587 lyxpipes != system_lyxrc.lyxpipes) {
1588 string const path = os::external_path(lyxpipes);
1589 os << "\\serverpipe \"" << path << "\"\n";
1594 case RC_DATE_INSERT_FORMAT:
1595 if (ignore_system_lyxrc ||
1596 date_insert_format != system_lyxrc.date_insert_format) {
1597 os << "\\date_insert_format \"" << date_insert_format
1604 os << "\\user_name \"" << user_name << "\"\n";
1609 os << "\\user_email \"" << user_email << "\"\n";
1613 case RC_SHOW_BANNER:
1614 if (ignore_system_lyxrc ||
1615 show_banner != system_lyxrc.show_banner) {
1616 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1622 if (ignore_system_lyxrc ||
1623 preview != system_lyxrc.preview) {
1629 case PREVIEW_NO_MATH:
1636 os << "\\preview " << status << '\n';
1641 case RC_PREVIEW_HASHED_LABELS:
1642 if (ignore_system_lyxrc ||
1643 preview_hashed_labels !=
1644 system_lyxrc.preview_hashed_labels) {
1645 os << "\\preview_hashed_labels "
1646 << convert<string>(preview_hashed_labels) << '\n';
1651 case RC_PREVIEW_SCALE_FACTOR:
1652 if (ignore_system_lyxrc ||
1653 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1654 os << "\\preview_scale_factor "
1655 << preview_scale_factor << '\n';
1660 case RC_USE_CONVERTER_CACHE:
1661 if (ignore_system_lyxrc ||
1662 use_converter_cache != system_lyxrc.use_converter_cache) {
1663 os << "\\use_converter_cache "
1664 << convert<string>(use_converter_cache) << '\n';
1669 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1670 if (ignore_system_lyxrc ||
1671 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1672 os << "\\use_converter_needauth_forbidden "
1673 << convert<string>(use_converter_needauth_forbidden) << '\n';
1678 case RC_USE_CONVERTER_NEEDAUTH:
1679 if (ignore_system_lyxrc ||
1680 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1681 os << "\\use_converter_needauth "
1682 << convert<string>(use_converter_needauth) << '\n';
1687 case RC_CONVERTER_CACHE_MAXAGE:
1688 if (ignore_system_lyxrc ||
1689 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1690 os << "\\converter_cache_maxage "
1691 << converter_cache_maxage << '\n';
1697 << "# SCREEN & FONTS SECTION ############################\n"
1701 if (ignore_system_lyxrc ||
1702 icon_set != system_lyxrc.icon_set) {
1703 os << "\\icon_set \"" << icon_set
1709 case RC_USE_SYSTEM_THEME_ICONS:
1710 if (ignore_system_lyxrc ||
1711 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1712 os << "\\use_system_theme_icons "
1713 << convert<string>(use_system_theme_icons)
1720 if (ignore_system_lyxrc ||
1721 dpi != system_lyxrc.dpi) {
1722 os << "\\screen_dpi " << dpi << '\n';
1727 case RC_SCREEN_ZOOM:
1728 if (ignore_system_lyxrc ||
1729 defaultZoom != system_lyxrc.defaultZoom) {
1730 os << "\\screen_zoom " << defaultZoom << '\n';
1735 case RC_GEOMETRY_SESSION:
1736 if (ignore_system_lyxrc ||
1737 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1738 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1744 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1745 if (ignore_system_lyxrc ||
1746 cursor_follows_scrollbar
1747 != system_lyxrc.cursor_follows_scrollbar) {
1748 os << "\\cursor_follows_scrollbar "
1749 << convert<string>(cursor_follows_scrollbar) << '\n';
1754 case RC_CURSOR_WIDTH:
1755 if (ignore_system_lyxrc ||
1757 != system_lyxrc.cursor_width) {
1758 os << "\\cursor_width "
1759 << cursor_width << '\n';
1764 case RC_SCROLL_BELOW_DOCUMENT:
1765 if (ignore_system_lyxrc ||
1766 scroll_below_document
1767 != system_lyxrc.scroll_below_document) {
1768 os << "\\scroll_below_document "
1769 << convert<string>(scroll_below_document) << '\n';
1774 case RC_PARAGRAPH_MARKERS:
1775 if (ignore_system_lyxrc ||
1777 != system_lyxrc.paragraph_markers) {
1778 os << "\\paragraph_markers "
1779 << convert<string>(paragraph_markers) << '\n';
1784 case RC_MAC_DONTSWAP_CTRL_META:
1785 if (ignore_system_lyxrc ||
1786 mac_dontswap_ctrl_meta
1787 != system_lyxrc.mac_dontswap_ctrl_meta) {
1788 os << "\\mac_dontswap_ctrl_meta "
1789 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1794 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1795 if (ignore_system_lyxrc ||
1796 mac_like_cursor_movement
1797 != system_lyxrc.mac_like_cursor_movement) {
1798 os << "\\mac_like_cursor_movement "
1799 << convert<string>(mac_like_cursor_movement) << '\n';
1804 case RC_MACRO_EDIT_STYLE:
1805 if (ignore_system_lyxrc ||
1807 != system_lyxrc.macro_edit_style) {
1808 os << "\\macro_edit_style ";
1809 switch (macro_edit_style) {
1810 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1811 case MACRO_EDIT_INLINE: os << "1\n"; break;
1812 case MACRO_EDIT_LIST: os << "2\n"; break;
1818 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1819 if (ignore_system_lyxrc ||
1820 dialogs_iconify_with_main
1821 != system_lyxrc.dialogs_iconify_with_main) {
1822 os << "\\dialogs_iconify_with_main "
1823 << convert<string>(dialogs_iconify_with_main) << '\n';
1828 case RC_SCREEN_FONT_ROMAN:
1829 if (ignore_system_lyxrc ||
1830 roman_font_name != system_lyxrc.roman_font_name) {
1831 os << "\\screen_font_roman \"" << roman_font_name
1837 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1838 if (ignore_system_lyxrc ||
1839 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1840 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1846 case RC_SCREEN_FONT_SANS:
1847 if (ignore_system_lyxrc ||
1848 sans_font_name != system_lyxrc.sans_font_name) {
1849 os << "\\screen_font_sans \"" << sans_font_name
1855 case RC_SCREEN_FONT_SANS_FOUNDRY:
1856 if (ignore_system_lyxrc ||
1857 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1858 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1864 case RC_SCREEN_FONT_TYPEWRITER:
1865 if (ignore_system_lyxrc ||
1866 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1867 os << "\\screen_font_typewriter \""
1868 << typewriter_font_name << "\"\n";
1873 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1874 if (ignore_system_lyxrc ||
1875 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1876 os << "\\screen_font_typewriter_foundry \""
1877 << typewriter_font_foundry << "\"\n";
1882 case RC_SCREEN_FONT_SCALABLE:
1883 if (ignore_system_lyxrc ||
1884 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1885 os << "\\screen_font_scalable "
1886 << convert<string>(use_scalable_fonts)
1892 case RC_SCREEN_FONT_SIZES:
1893 if (ignore_system_lyxrc ||
1894 font_sizes[FONT_SIZE_TINY]
1895 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1896 font_sizes[FONT_SIZE_SCRIPT]
1897 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1898 font_sizes[FONT_SIZE_FOOTNOTE]
1899 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1900 font_sizes[FONT_SIZE_SMALL]
1901 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1902 font_sizes[FONT_SIZE_NORMAL]
1903 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1904 font_sizes[FONT_SIZE_LARGE]
1905 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1906 font_sizes[FONT_SIZE_LARGER]
1907 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1908 font_sizes[FONT_SIZE_LARGEST]
1909 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1910 font_sizes[FONT_SIZE_HUGE]
1911 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1912 font_sizes[FONT_SIZE_HUGER]
1913 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1914 streamsize old_prec = os.precision();
1915 os.setf(ios::fixed);
1917 os << "\\screen_font_sizes"
1918 << ' ' << font_sizes[FONT_SIZE_TINY]
1919 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1920 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1921 << ' ' << font_sizes[FONT_SIZE_SMALL]
1922 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1923 << ' ' << font_sizes[FONT_SIZE_LARGE]
1924 << ' ' << font_sizes[FONT_SIZE_LARGER]
1925 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1926 << ' ' << font_sizes[FONT_SIZE_HUGE]
1927 << ' ' << font_sizes[FONT_SIZE_HUGER]
1929 os.precision(old_prec);
1930 os.unsetf(ios::fixed);
1935 case RC_FULL_SCREEN_LIMIT:
1936 if (ignore_system_lyxrc ||
1937 full_screen_limit != system_lyxrc.full_screen_limit) {
1938 os << "\\fullscreen_limit "
1939 << convert<string>(full_screen_limit)
1945 case RC_FULL_SCREEN_TOOLBARS:
1946 if (ignore_system_lyxrc ||
1947 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1948 os << "\\fullscreen_toolbars "
1949 << convert<string>(full_screen_toolbars)
1955 case RC_FULL_SCREEN_SCROLLBAR:
1956 if (ignore_system_lyxrc ||
1957 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1958 os << "\\fullscreen_scrollbar "
1959 << convert<string>(full_screen_scrollbar)
1965 case RC_FULL_SCREEN_STATUSBAR:
1966 if (ignore_system_lyxrc ||
1967 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1968 os << "\\fullscreen_statusbar "
1969 << convert<string>(full_screen_statusbar)
1975 case RC_FULL_SCREEN_TABBAR:
1976 if (ignore_system_lyxrc ||
1977 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1978 os << "\\fullscreen_tabbar "
1979 << convert<string>(full_screen_tabbar)
1985 case RC_FULL_SCREEN_MENUBAR:
1986 if (ignore_system_lyxrc ||
1987 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1988 os << "\\fullscreen_menubar "
1989 << convert<string>(full_screen_menubar)
1995 case RC_FULL_SCREEN_WIDTH:
1996 if (ignore_system_lyxrc ||
1997 full_screen_width != system_lyxrc.full_screen_width) {
1998 os << "\\fullscreen_width "
1999 << convert<string>(full_screen_width)
2005 case RC_OPEN_BUFFERS_IN_TABS:
2006 if (ignore_system_lyxrc ||
2007 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2008 os << "\\open_buffers_in_tabs "
2009 << convert<string>(open_buffers_in_tabs)
2015 case RC_SINGLE_CLOSE_TAB_BUTTON:
2016 if (ignore_system_lyxrc ||
2017 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2018 os << "\\single_close_tab_button "
2019 << convert<string>(single_close_tab_button)
2025 case RC_SINGLE_INSTANCE:
2026 if (ignore_system_lyxrc ||
2027 single_instance != system_lyxrc.single_instance) {
2028 os << "\\single_instance "
2029 << convert<string>(single_instance)
2035 case RC_FORWARD_SEARCH_DVI:
2036 if (ignore_system_lyxrc ||
2037 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2038 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2043 case RC_FORWARD_SEARCH_PDF:
2044 if (ignore_system_lyxrc ||
2045 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2046 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2052 << "# COLOR SECTION ###################################\n"
2057 for (int i = 0; i < Color_ignore; ++i) {
2058 ColorCode lc = static_cast<ColorCode>(i);
2059 string const col = lcolor.getX11Name(lc);
2060 if (ignore_system_lyxrc
2061 || col != system_lcolor.getX11Name(lc)) {
2062 os << "\\set_color \""
2063 << lcolor.getLyXName(lc) << "\" \""
2071 << "# PRINTER SECTION ###################################\n"
2075 case RC_PRINTLANDSCAPEFLAG:
2076 if (ignore_system_lyxrc ||
2077 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2078 os << "\\print_landscape_flag \"" << print_landscape_flag
2084 case RC_PRINTPAPERFLAG:
2085 if (ignore_system_lyxrc ||
2086 print_paper_flag != system_lyxrc.print_paper_flag) {
2087 os << "\\print_paper_flag \"" << print_paper_flag
2093 case RC_PRINTPAPERDIMENSIONFLAG:
2094 if (ignore_system_lyxrc ||
2095 print_paper_dimension_flag
2096 != system_lyxrc.print_paper_dimension_flag) {
2097 os << "\\print_paper_dimension_flag \""
2098 << print_paper_dimension_flag << "\"\n";
2104 << "# TEX SECTION #######################################\n"
2108 case RC_TEXINPUTS_PREFIX:
2109 if (ignore_system_lyxrc ||
2110 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2111 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2117 << "# FILE SECTION ######################################\n"
2120 case RC_DOCUMENTPATH:
2121 if (ignore_system_lyxrc ||
2122 document_path != system_lyxrc.document_path) {
2123 string const path = os::external_path(document_path);
2124 os << "\\document_path \"" << path << "\"\n";
2129 case RC_USELASTFILEPOS:
2130 if (ignore_system_lyxrc ||
2131 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2132 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2138 case RC_LOADSESSION:
2139 if (ignore_system_lyxrc ||
2140 load_session != system_lyxrc.load_session) {
2141 os << "\\load_session " << convert<string>(load_session)
2147 case RC_MOUSE_WHEEL_SPEED:
2148 if (ignore_system_lyxrc ||
2149 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2150 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2155 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2156 if (ignore_system_lyxrc ||
2157 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2158 os << "\\mouse_middlebutton_paste "
2159 << convert<string>(mouse_middlebutton_paste) << '\n';
2164 case RC_COMPLETION_INLINE_DELAY:
2165 if (ignore_system_lyxrc ||
2166 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2167 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2172 case RC_COMPLETION_INLINE_MATH:
2173 if (ignore_system_lyxrc ||
2174 completion_inline_math != system_lyxrc.completion_inline_math) {
2175 os << "\\completion_inline_math "
2176 << convert<string>(completion_inline_math) << '\n';
2181 case RC_COMPLETION_INLINE_TEXT:
2182 if (ignore_system_lyxrc ||
2183 completion_inline_text != system_lyxrc.completion_inline_text) {
2184 os << "\\completion_inline_text "
2185 << convert<string>(completion_inline_text) << '\n';
2190 case RC_COMPLETION_INLINE_DOTS:
2191 if (ignore_system_lyxrc ||
2192 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2193 os << "\\completion_inline_dots "
2194 << convert<string>(completion_inline_dots) << '\n';
2199 case RC_AUTOCORRECTION_MATH:
2200 if (ignore_system_lyxrc ||
2201 autocorrection_math != system_lyxrc.autocorrection_math) {
2202 os << "\\autocorrection_math "
2203 << convert<string>(autocorrection_math) << '\n';
2208 case RC_COMPLETION_POPUP_DELAY:
2209 if (ignore_system_lyxrc ||
2210 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2211 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2216 case RC_COMPLETION_POPUP_MATH:
2217 if (ignore_system_lyxrc ||
2218 completion_popup_math != system_lyxrc.completion_popup_math) {
2219 os << "\\completion_popup_math "
2220 << convert<string>(completion_popup_math) << '\n';
2225 case RC_COMPLETION_POPUP_TEXT:
2226 if (ignore_system_lyxrc ||
2227 completion_popup_text != system_lyxrc.completion_popup_text) {
2228 os << "\\completion_popup_text "
2229 << convert<string>(completion_popup_text) << '\n';
2234 case RC_COMPLETION_CURSOR_TEXT:
2235 if (ignore_system_lyxrc ||
2236 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2237 os << "\\completion_cursor_text "
2238 << convert<string>(completion_cursor_text) << '\n';
2243 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2244 if (ignore_system_lyxrc ||
2245 completion_popup_after_complete
2246 != system_lyxrc.completion_popup_after_complete) {
2247 os << "\\completion_popup_after_complete "
2248 << convert<string>(completion_popup_after_complete) << '\n';
2253 case RC_COMPLETION_MINLENGTH:
2254 if (ignore_system_lyxrc ||
2255 completion_minlength != system_lyxrc.completion_minlength) {
2256 os << "\\completion_minlength " << convert<string>(completion_minlength)
2262 case RC_NUMLASTFILES:
2263 if (ignore_system_lyxrc ||
2264 num_lastfiles != system_lyxrc.num_lastfiles) {
2265 os << "\\num_lastfiles " << num_lastfiles << '\n';
2270 case RC_CHECKLASTFILES:
2271 if (ignore_system_lyxrc ||
2272 check_lastfiles != system_lyxrc.check_lastfiles) {
2273 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2279 case RC_EXAMPLEPATH:
2280 if (ignore_system_lyxrc ||
2281 example_path != system_lyxrc.example_path) {
2282 string const path = os::external_path(example_path);
2283 os << "\\example_path \"" << path << "\"\n";
2288 case RC_TEMPLATEPATH:
2289 if (ignore_system_lyxrc ||
2290 template_path != system_lyxrc.template_path) {
2291 string const path = os::external_path(template_path);
2292 os << "\\template_path \"" << path << "\"\n";
2297 case RC_TEMPDIRPATH:
2298 if (ignore_system_lyxrc ||
2299 tempdir_path != system_lyxrc.tempdir_path) {
2300 string const path = os::external_path(tempdir_path);
2301 os << "\\tempdir_path \"" << path << "\"\n";
2306 case RC_THESAURUSDIRPATH:
2307 if (ignore_system_lyxrc ||
2308 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2309 string const path = os::external_path(thesaurusdir_path);
2310 os << "\\thesaurusdir_path \"" << path << "\"\n";
2315 case RC_HUNSPELLDIR_PATH:
2316 if (ignore_system_lyxrc ||
2317 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2318 string const path = os::external_path(hunspelldir_path);
2319 os << "\\hunspelldir_path \"" << path << "\"\n";
2324 case RC_PLAINTEXT_LINELEN:
2325 if (ignore_system_lyxrc ||
2326 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2327 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2332 case RC_MAKE_BACKUP:
2333 if (ignore_system_lyxrc ||
2334 make_backup != system_lyxrc.make_backup) {
2335 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2340 case RC_SAVE_COMPRESSED:
2341 if (ignore_system_lyxrc ||
2342 save_compressed != system_lyxrc.save_compressed) {
2343 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2348 case RC_SAVE_ORIGIN:
2349 if (ignore_system_lyxrc ||
2350 save_origin != system_lyxrc.save_origin) {
2351 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2356 case RC_BACKUPDIR_PATH:
2357 if (ignore_system_lyxrc ||
2358 backupdir_path != system_lyxrc.backupdir_path) {
2359 string const path = os::external_path(backupdir_path);
2360 os << "\\backupdir_path \"" << path << "\"\n";
2366 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2370 << "# SPELLCHECKER SECTION ##############################\n"
2374 case RC_ACCEPT_COMPOUND:
2375 if (ignore_system_lyxrc ||
2376 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2377 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2384 if (ignore_system_lyxrc ||
2385 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2386 os << "\\alternate_language \"" << spellchecker_alt_lang
2393 if (ignore_system_lyxrc ||
2394 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2395 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2400 case RC_USE_NATIVE_FILEDIALOG:
2401 if (ignore_system_lyxrc ||
2402 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2403 os << "\\use_native_filedialog "
2404 << convert<string>(use_native_filedialog)
2410 case RC_USE_SYSTEM_COLORS:
2411 if (ignore_system_lyxrc ||
2412 use_system_colors != system_lyxrc.use_system_colors) {
2413 os << "\\use_system_colors "
2414 << convert<string>(use_system_colors)
2420 case RC_USE_TOOLTIP:
2421 if (ignore_system_lyxrc ||
2422 use_tooltip != system_lyxrc.use_tooltip) {
2423 os << "\\use_tooltip "
2424 << convert<string>(use_tooltip)
2430 case RC_USE_PIXMAP_CACHE:
2431 if (ignore_system_lyxrc ||
2432 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2433 os << "\\use_pixmap_cache "
2434 << convert<string>(use_pixmap_cache)
2442 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2446 case RC_DEFAULT_DECIMAL_POINT:
2447 if (ignore_system_lyxrc ||
2448 default_decimal_point != system_lyxrc.default_decimal_point) {
2449 os << "\\default_decimal_point " << default_decimal_point << '\n';
2454 case RC_DEFAULT_LENGTH_UNIT:
2455 if (ignore_system_lyxrc ||
2456 default_length_unit != system_lyxrc.default_length_unit) {
2457 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2462 case RC_SPELLCHECKER:
2463 if (ignore_system_lyxrc ||
2464 spellchecker != system_lyxrc.spellchecker) {
2465 os << "\\spellchecker " << spellchecker << '\n';
2470 case RC_SPELLCHECK_CONTINUOUSLY:
2471 if (ignore_system_lyxrc ||
2472 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2473 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2479 case RC_SPELLCHECK_NOTES:
2480 if (ignore_system_lyxrc ||
2481 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2482 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2488 case RC_VISUAL_CURSOR:
2489 if (ignore_system_lyxrc ||
2490 visual_cursor != system_lyxrc.visual_cursor) {
2491 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2496 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2497 if (ignore_system_lyxrc ||
2498 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2499 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2500 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2505 case RC_LANGUAGE_CUSTOM_PACKAGE:
2506 if (ignore_system_lyxrc ||
2507 language_custom_package != system_lyxrc.language_custom_package) {
2508 os << "\\language_custom_package \"" << language_custom_package
2514 case RC_LANGUAGE_GLOBAL_OPTIONS:
2515 if (ignore_system_lyxrc ||
2516 language_global_options
2517 != system_lyxrc.language_global_options) {
2518 os << "\\language_global_options \""
2519 << convert<string>(language_global_options)
2525 case RC_LANGUAGE_PACKAGE_SELECTION:
2526 if (ignore_system_lyxrc ||
2527 language_package_selection != system_lyxrc.language_package_selection) {
2528 os << "\\language_package_selection ";
2529 switch (language_package_selection) {
2547 case RC_LANGUAGE_COMMAND_BEGIN:
2548 if (ignore_system_lyxrc ||
2549 language_command_begin
2550 != system_lyxrc.language_command_begin) {
2551 os << "\\language_command_begin \""
2552 << language_command_begin
2558 case RC_LANGUAGE_COMMAND_END:
2559 if (ignore_system_lyxrc ||
2560 language_command_end
2561 != system_lyxrc.language_command_end) {
2562 os << "\\language_command_end \"" << language_command_end
2568 case RC_LANGUAGE_COMMAND_LOCAL:
2569 if (ignore_system_lyxrc ||
2570 language_command_local
2571 != system_lyxrc.language_command_local) {
2572 os << "\\language_command_local \""
2573 << language_command_local
2579 case RC_LANGUAGE_AUTO_BEGIN:
2580 if (ignore_system_lyxrc ||
2581 language_auto_begin != system_lyxrc.language_auto_begin) {
2582 os << "\\language_auto_begin "
2583 << convert<string>(language_auto_begin) << '\n';
2588 case RC_LANGUAGE_AUTO_END:
2589 if (ignore_system_lyxrc ||
2590 language_auto_end != system_lyxrc.language_auto_end) {
2591 os << "\\language_auto_end "
2592 << convert<string>(language_auto_end) << '\n';
2597 case RC_MARK_FOREIGN_LANGUAGE:
2598 if (ignore_system_lyxrc ||
2599 mark_foreign_language
2600 != system_lyxrc.mark_foreign_language) {
2601 os << "\\mark_foreign_language " <<
2602 convert<string>(mark_foreign_language) << '\n';
2608 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2612 case RC_AUTO_NUMBER:
2613 if (ignore_system_lyxrc ||
2614 auto_number != system_lyxrc.auto_number) {
2615 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2620 case RC_GUI_LANGUAGE:
2621 if (ignore_system_lyxrc ||
2622 gui_language != system_lyxrc.gui_language) {
2623 os << "\\gui_language " << gui_language << '\n';
2628 case RC_EXPORT_OVERWRITE:
2629 if (ignore_system_lyxrc ||
2630 export_overwrite != system_lyxrc.export_overwrite) {
2632 switch (export_overwrite) {
2643 os << "\\export_overwrite " << status << '\n';
2648 case RC_SCROLL_WHEEL_ZOOM:
2649 if (ignore_system_lyxrc ||
2650 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2652 switch (scroll_wheel_zoom) {
2653 case SCROLL_WHEEL_ZOOM_OFF:
2656 case SCROLL_WHEEL_ZOOM_CTRL:
2659 case SCROLL_WHEEL_ZOOM_SHIFT:
2662 case SCROLL_WHEEL_ZOOM_ALT:
2666 os << "\\scroll_wheel_zoom " << status << '\n';
2672 << "# FORMATS SECTION ##########################\n"
2677 // New/modified formats
2678 for (Formats::const_iterator cit = theFormats().begin();
2679 cit != theFormats().end(); ++cit) {
2680 Format const * format =
2681 theSystemFormats().getFormat(cit->name());
2683 format->extensions() != cit->extensions() ||
2684 format->prettyname() != cit->prettyname() ||
2685 format->shortcut() != cit->shortcut() ||
2686 format->viewer() != cit->viewer() ||
2687 format->editor() != cit->editor() ||
2688 format->documentFormat() != cit->documentFormat() ||
2689 format->vectorFormat() != cit->vectorFormat() ||
2690 format->inExportMenu() != cit->inExportMenu() ||
2691 format->mime() != cit->mime()) {
2692 os << "\\format \"" << cit->name() << "\" \""
2693 << cit->extensions() << "\" \""
2694 << to_utf8(cit->prettyname()) << "\" \""
2695 << cit->shortcut() << "\" \""
2696 << escapeCommand(cit->viewer()) << "\" \""
2697 << escapeCommand(cit->editor()) << "\" \"";
2698 vector<string> flags;
2699 if (cit->documentFormat())
2700 flags.push_back("document");
2701 if (cit->vectorFormat())
2702 flags.push_back("vector");
2703 if (cit->zippedNative())
2704 flags.push_back("zipped=native");
2705 if (cit->inExportMenu())
2706 flags.push_back("menu=export");
2708 os << getStringFromVector(flags);
2709 os << "\" \"" << cit->mime() << "\"\n";
2713 // Look for deleted formats
2714 for (Formats::const_iterator cit = theSystemFormats().begin();
2715 cit != theSystemFormats().end(); ++cit)
2716 if (!theFormats().getFormat(cit->name()))
2717 os << "\\format \"" << cit->name()
2718 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2722 case RC_VIEWER_ALTERNATIVES: {
2723 Alternatives::const_iterator it = viewer_alternatives.begin();
2724 Alternatives::const_iterator const en = viewer_alternatives.end();
2725 Alternatives::const_iterator const sysend =
2726 system_lyxrc.viewer_alternatives.end();
2727 for (; it != en; ++it) {
2728 string const & fmt = it->first;
2729 CommandSet const & cmd = it->second;
2730 CommandSet::const_iterator sit = cmd.begin();
2731 CommandSet::const_iterator const sen = cmd.end();
2732 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2733 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2734 system_lyxrc.viewer_alternatives.find(fmt);
2735 for (; sit != sen; ++sit) {
2736 string const & cmd = *sit;
2737 if (ignore_system_lyxrc
2738 || sysfmt == sysend // format not found
2739 || sysfmt->second.count(cmd) == 0 // this command not found
2741 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2748 case RC_EDITOR_ALTERNATIVES: {
2749 Alternatives::const_iterator it = editor_alternatives.begin();
2750 Alternatives::const_iterator const en = editor_alternatives.end();
2751 Alternatives::const_iterator const sysend =
2752 system_lyxrc.editor_alternatives.end();
2753 for (; it != en; ++it) {
2754 string const & fmt = it->first;
2755 CommandSet const & cmd = it->second;
2756 CommandSet::const_iterator sit = cmd.begin();
2757 CommandSet::const_iterator const sen = cmd.end();
2758 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2759 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2760 system_lyxrc.editor_alternatives.find(fmt);
2761 for (; sit != sen; ++sit) {
2762 string const & cmd = *sit;
2763 if (ignore_system_lyxrc
2764 || sysfmt == sysend // format not found
2765 || sysfmt->second.count(cmd) == 0 // this command not found
2767 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2774 case RC_DEFAULT_OTF_VIEW_FORMAT:
2775 if ((ignore_system_lyxrc ||
2776 default_otf_view_format != system_lyxrc.default_otf_view_format)
2777 && !default_otf_view_format.empty()) {
2778 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2783 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2784 if ((ignore_system_lyxrc ||
2785 default_platex_view_format != system_lyxrc.default_platex_view_format)
2786 && !default_platex_view_format.empty()) {
2787 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2792 case RC_DEFAULT_VIEW_FORMAT:
2793 if (ignore_system_lyxrc ||
2794 default_view_format != system_lyxrc.default_view_format) {
2795 os << "\\default_view_format " << default_view_format << '\n';
2806 << "# CONVERTERS SECTION ##########################\n"
2811 // Look for new converters
2812 for (Converters::const_iterator cit = theConverters().begin();
2813 cit != theConverters().end(); ++cit) {
2814 Converter const * converter =
2815 theSystemConverters().getConverter(cit->from(),
2818 converter->command() != cit->command() ||
2819 converter->flags() != cit->flags())
2820 os << "\\converter \"" << cit->from() << "\" \""
2821 << cit->to() << "\" \""
2822 << escapeCommand(cit->command()) << "\" \""
2823 << cit->flags() << "\"\n";
2826 // New/modifed converters
2827 for (Converters::const_iterator cit = theSystemConverters().begin();
2828 cit != theSystemConverters().end(); ++cit)
2829 if (!theConverters().getConverter(cit->from(), cit->to()))
2830 os << "\\converter \"" << cit->from()
2831 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2838 << "# COPIERS SECTION ##########################\n"
2841 // Look for new movers
2842 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2843 Movers::const_iterator const sysend = theSystemMovers().end();
2844 Movers::const_iterator it = theMovers().begin();
2845 Movers::const_iterator end = theMovers().end();
2847 for (; it != end; ++it) {
2848 Movers::const_iterator const sysit =
2849 find_if(sysbegin, sysend, SameMover(*it));
2850 if (sysit == sysend) {
2851 string const & fmt = it->first;
2852 string const & command =
2853 it->second.command();
2855 os << "\\copier " << fmt
2856 << " \"" << escapeCommand(command) << "\"\n";
2862 // We don't actually delete SpecialisedMover(s) from the
2863 // map, just clear their 'command', so there's no need
2864 // to test for anything else.
2871 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2873 // Why the switch you might ask. It is a trick to ensure that all
2874 // the elements in the LyXRCTags enum is handled. As you can see
2875 // there are no breaks at all. So it is just a huge fall-through.
2876 // The nice thing is that we will get a warning from the compiler
2877 // if we forget an element.
2878 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2880 case LyXRC::RC_LAST:
2881 case LyXRC::RC_ACCEPT_COMPOUND:
2882 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2883 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2885 case LyXRC::RC_ALT_LANG:
2886 case LyXRC::RC_PLAINTEXT_LINELEN:
2887 case LyXRC::RC_AUTOCORRECTION_MATH:
2888 case LyXRC::RC_AUTOREGIONDELETE:
2889 case LyXRC::RC_AUTORESET_OPTIONS:
2890 case LyXRC::RC_AUTOSAVE:
2891 case LyXRC::RC_AUTO_NUMBER:
2892 case LyXRC::RC_BACKUPDIR_PATH:
2893 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2894 case LyXRC::RC_BIBTEX_COMMAND:
2895 case LyXRC::RC_BINDFILE:
2896 case LyXRC::RC_CHECKLASTFILES:
2897 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2898 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2899 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2900 case LyXRC::RC_COMPLETION_INLINE_MATH:
2901 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2902 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2903 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2904 case LyXRC::RC_COMPLETION_POPUP_MATH:
2905 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2906 case LyXRC::RC_COMPLETION_MINLENGTH:
2907 case LyXRC::RC_USELASTFILEPOS:
2908 case LyXRC::RC_LOADSESSION:
2909 case LyXRC::RC_CHKTEX_COMMAND:
2910 case LyXRC::RC_CONVERTER:
2911 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2912 case LyXRC::RC_COPIER:
2913 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2914 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2915 case LyXRC::RC_DATE_INSERT_FORMAT:
2916 case LyXRC::RC_GUI_LANGUAGE:
2917 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2918 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2919 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2920 case LyXRC::RC_DEFFILE:
2921 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2922 case LyXRC::RC_DISPLAY_GRAPHICS:
2923 case LyXRC::RC_DOCUMENTPATH:
2924 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2925 FileName path(lyxrc_new.document_path);
2926 if (path.exists() && path.isDirectory())
2927 package().document_dir() = FileName(lyxrc.document_path);
2930 case LyXRC::RC_EDITOR_ALTERNATIVES:
2931 case LyXRC::RC_ESC_CHARS:
2932 case LyXRC::RC_EXAMPLEPATH:
2933 case LyXRC::RC_FILEFORMAT:
2934 case LyXRC::RC_GROUP_LAYOUTS:
2935 case LyXRC::RC_HUNSPELLDIR_PATH:
2936 case LyXRC::RC_ICON_SET:
2937 case LyXRC::RC_INDEX_ALTERNATIVES:
2938 case LyXRC::RC_INDEX_COMMAND:
2939 case LyXRC::RC_JBIBTEX_COMMAND:
2940 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2941 case LyXRC::RC_JINDEX_COMMAND:
2942 case LyXRC::RC_NOMENCL_COMMAND:
2943 case LyXRC::RC_PYGMENTIZE_COMMAND:
2944 case LyXRC::RC_INPUT:
2945 case LyXRC::RC_KBMAP:
2946 case LyXRC::RC_KBMAP_PRIMARY:
2947 case LyXRC::RC_KBMAP_SECONDARY:
2948 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2949 case LyXRC::RC_LANGUAGE_AUTO_END:
2950 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2951 case LyXRC::RC_LANGUAGE_COMMAND_END:
2952 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2953 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2954 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2955 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2956 case LyXRC::RC_LYXRCFORMAT:
2957 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2958 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2959 case LyXRC::RC_MACRO_EDIT_STYLE:
2960 case LyXRC::RC_MAKE_BACKUP:
2961 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2962 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2963 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2964 case LyXRC::RC_NUMLASTFILES:
2965 case LyXRC::RC_PARAGRAPH_MARKERS:
2966 case LyXRC::RC_PATH_PREFIX:
2967 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2968 prependEnvPath("PATH", lyxrc_new.path_prefix);
2969 // Resets python path
2970 support::os::python(true);
2973 case LyXRC::RC_PREVIEW:
2974 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2975 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2976 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2977 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2978 case LyXRC::RC_PRINTPAPERFLAG:
2979 case LyXRC::RC_SAVE_COMPRESSED:
2980 case LyXRC::RC_SAVE_ORIGIN:
2981 case LyXRC::RC_SCREEN_DPI:
2982 case LyXRC::RC_SCREEN_FONT_ROMAN:
2983 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2984 case LyXRC::RC_SCREEN_FONT_SANS:
2985 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2986 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2987 case LyXRC::RC_SCREEN_FONT_SIZES:
2988 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2989 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2990 case LyXRC::RC_GEOMETRY_SESSION:
2991 case LyXRC::RC_SCREEN_ZOOM:
2992 case LyXRC::RC_SERVERPIPE:
2993 case LyXRC::RC_SET_COLOR:
2994 case LyXRC::RC_SHOW_BANNER:
2995 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2996 case LyXRC::RC_SPELLCHECKER:
2997 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3000 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3001 case LyXRC::RC_SPELLCHECK_NOTES:
3002 case LyXRC::RC_SPLITINDEX_COMMAND:
3003 case LyXRC::RC_TEMPDIRPATH:
3004 case LyXRC::RC_TEMPLATEPATH:
3005 case LyXRC::RC_TEX_ALLOWS_SPACES:
3006 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3007 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3008 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3011 case LyXRC::RC_TEXINPUTS_PREFIX:
3012 case LyXRC::RC_THESAURUSDIRPATH:
3013 case LyXRC::RC_UIFILE:
3014 case LyXRC::RC_USER_EMAIL:
3015 case LyXRC::RC_USER_NAME:
3016 case LyXRC::RC_USE_CONVERTER_CACHE:
3017 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
3018 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
3019 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
3020 case LyXRC::RC_USE_SYSTEM_COLORS:
3021 case LyXRC::RC_USE_TOOLTIP:
3022 case LyXRC::RC_USE_PIXMAP_CACHE:
3023 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3024 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3025 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3026 case LyXRC::RC_SINGLE_INSTANCE:
3027 case LyXRC::RC_SORT_LAYOUTS:
3028 case LyXRC::RC_FULL_SCREEN_LIMIT:
3029 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3030 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3031 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3032 case LyXRC::RC_FULL_SCREEN_TABBAR:
3033 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3034 case LyXRC::RC_FULL_SCREEN_WIDTH:
3035 case LyXRC::RC_VISUAL_CURSOR:
3036 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3037 case LyXRC::RC_VIEWER:
3038 case LyXRC::RC_VIEWER_ALTERNATIVES:
3039 case LyXRC::RC_FORWARD_SEARCH_DVI:
3040 case LyXRC::RC_FORWARD_SEARCH_PDF:
3041 case LyXRC::RC_EXPORT_OVERWRITE:
3042 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3043 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3044 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3045 case LyXRC::RC_CURSOR_WIDTH:
3052 string const LyXRC::getDescription(LyXRCTags tag)
3057 case RC_ACCEPT_COMPOUND:
3058 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3062 str = _("Specify an alternate language. The default is to use the language of the document.");
3065 case RC_PLAINTEXT_LINELEN:
3066 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.");
3069 case RC_AUTOREGIONDELETE:
3070 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3073 case RC_AUTORESET_OPTIONS:
3074 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3078 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3081 case RC_AUTO_NUMBER:
3084 case RC_BACKUPDIR_PATH:
3085 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.");
3088 case RC_BIBTEX_COMMAND:
3089 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3092 case RC_JBIBTEX_COMMAND:
3093 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3097 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3100 case RC_CHECKLASTFILES:
3101 str = _("Select to check whether the lastfiles still exist.");
3104 case RC_CHKTEX_COMMAND:
3105 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3111 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3112 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3115 case RC_CONVERTER_NEEDAUTH:
3116 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3122 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3123 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.");
3126 case RC_CURSOR_WIDTH:
3127 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3130 case RC_SCROLL_BELOW_DOCUMENT:
3131 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");
3134 case RC_MAC_DONTSWAP_CTRL_META:
3135 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3138 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3139 str = _("Use the Mac OS X conventions for cursor movement");
3142 case RC_SHOW_MACRO_LABEL:
3143 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3146 case RC_DATE_INSERT_FORMAT:
3147 //xgettext:no-c-format
3148 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3152 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3155 case RC_DEFAULT_OTF_VIEW_FORMAT:
3156 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3159 case RC_DEFAULT_VIEW_FORMAT:
3160 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3163 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3164 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3167 case RC_DISPLAY_GRAPHICS:
3168 str = _("Select how LyX will display any graphics.");
3171 case RC_DOCUMENTPATH:
3172 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3176 str = _("Specify additional chars that can be part of a word.");
3179 case RC_EXAMPLEPATH:
3180 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3186 case RC_INDEX_COMMAND:
3187 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\".");
3190 case RC_JINDEX_COMMAND:
3191 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3194 case RC_NOMENCL_COMMAND:
3195 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3198 case RC_PYGMENTIZE_COMMAND:
3199 str = _("The command to run the python pygments syntax highlighter.");
3206 case RC_KBMAP_PRIMARY:
3207 case RC_KBMAP_SECONDARY:
3208 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.");
3211 case RC_LANGUAGE_AUTO_BEGIN:
3212 str = _("Select if a language switching command is needed at the beginning of the document.");
3215 case RC_LANGUAGE_AUTO_END:
3216 str = _("Select if a language switching command is needed at the end of the document.");
3219 case RC_LANGUAGE_COMMAND_BEGIN:
3220 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.");
3223 case RC_LANGUAGE_COMMAND_END:
3224 str = _("The LaTeX command for changing back to the language of the document.");
3227 case RC_LANGUAGE_COMMAND_LOCAL:
3228 str = _("The LaTeX command for local changing of the language.");
3231 case RC_LANGUAGE_GLOBAL_OPTIONS:
3232 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3235 case RC_LANGUAGE_CUSTOM_PACKAGE:
3236 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3239 case RC_LANGUAGE_PACKAGE_SELECTION:
3240 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3243 case RC_USELASTFILEPOS:
3244 str = _("De-select if you do not want LyX to scroll to saved position.");
3247 case RC_LOADSESSION:
3248 str = _("De-select to prevent loading files opened from the last LyX session.");
3251 case RC_MAKE_BACKUP:
3252 str = _("De-select if you don't want LyX to create backup files.");
3255 case RC_MARK_FOREIGN_LANGUAGE:
3256 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3259 case RC_MOUSE_WHEEL_SPEED:
3260 str = _("The scrolling speed of the mouse wheel.");
3263 case RC_COMPLETION_POPUP_DELAY:
3264 str = _("The completion popup delay.");
3267 case RC_COMPLETION_POPUP_MATH:
3268 str = _("Select to display the completion popup in math mode.");
3271 case RC_COMPLETION_POPUP_TEXT:
3272 str = _("Select to display the completion popup in text mode.");
3275 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3276 str = _("Show the completion popup without delay after non-unique completion attempt.");
3279 case RC_COMPLETION_POPUP_TEXT:
3280 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3283 case RC_COMPLETION_POPUP_DELAY:
3284 str = _("The inline completion delay.");
3287 case RC_COMPLETION_INLINE_MATH:
3288 str = _("Select to display the inline completion in math mode.");
3291 case RC_COMPLETION_INLINE_TEXT:
3292 str = _("Select to display the inline completion in text mode.");
3295 case RC_COMPLETION_INLINE_DOTS:
3296 str = _("Use \"...\" to shorten long completions.");
3299 case RC_AUTOCORRECTION_MATH:
3300 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3303 case RC_NUMLASTFILES:
3304 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3308 case RC_PATH_PREFIX:
3309 str = _("Specify those directories which should be "
3310 "prepended to the PATH environment variable.\n"
3311 "Use the OS native format.");
3315 str = _("Shows a typeset preview of things such as math");
3318 case RC_PREVIEW_HASHED_LABELS:
3319 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3322 case RC_PREVIEW_SCALE_FACTOR:
3323 str = _("Scale the preview size to suit.");
3326 case RC_PRINTLANDSCAPEFLAG:
3327 str = _("The option to print out in landscape.");
3330 case RC_PRINTPAPERDIMENSIONFLAG:
3331 str = _("Option to specify the dimensions of the print paper.");
3334 case RC_PRINTPAPERFLAG:
3335 str = _("The option to specify paper type.");
3338 case RC_VISUAL_CURSOR:
3339 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3342 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3343 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).");
3347 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3350 case RC_SCREEN_FONT_ROMAN:
3351 case RC_SCREEN_FONT_SANS:
3352 case RC_SCREEN_FONT_TYPEWRITER:
3353 str = _("The screen fonts used to display the text while editing.");
3356 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3357 case RC_SCREEN_FONT_SANS_FOUNDRY:
3358 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3361 case RC_SCREEN_FONT_SCALABLE:
3362 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.");
3365 case RC_SCREEN_FONT_SIZES:
3366 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3369 case RC_SCREEN_ZOOM:
3370 //xgettext:no-c-format
3371 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3374 case RC_GEOMETRY_SESSION:
3375 str = _("Allow session manager to save and restore windows geometry.");
3379 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3385 case RC_SHOW_BANNER:
3386 str = _("De-select if you don't want the startup banner.");
3389 case RC_TEMPDIRPATH:
3390 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3393 case RC_THESAURUSDIRPATH:
3394 str = _("This is the place where the files of the thesaurus library reside.");
3397 case RC_TEMPLATEPATH:
3398 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3401 case RC_TEX_ALLOWS_SPACES:
3404 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3407 case RC_TEXINPUTS_PREFIX:
3408 str = _("Specify those directories which should be "
3409 "prepended to the TEXINPUTS environment variable.\n"
3410 "A '.' represents the current document directory. "
3411 "Use the OS native format.");
3415 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3424 case RC_USE_USE_SYSTEM_COLORS:
3425 str = _("Enable use the system colors for some things like main window background and selection.");
3428 case RC_USE_TOOLTIP:
3429 str = _("Enable the automatic appearance of tool tips in the work area.");
3432 case RC_USE_PIXMAP_CACHE:
3433 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3436 case RC_VIEWDVI_PAPEROPTION:
3437 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3452 // The global instance
3455 // The global copy of the system lyxrc entries (everything except preferences)