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 = 19; // rgh: remove print support
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_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
102 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
103 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
104 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
105 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
106 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
107 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
108 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
109 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
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_command", LyXRC::RC_JBIBTEX_COMMAND },
128 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
129 { "\\kbmap", LyXRC::RC_KBMAP },
130 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
131 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
132 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
133 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
134 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
135 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
136 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
137 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
138 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
139 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
140 { "\\load_session", LyXRC::RC_LOADSESSION },
141 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
142 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
143 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
144 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
145 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
146 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
147 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
148 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
149 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
150 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
151 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
152 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
153 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
154 { "\\preview", LyXRC::RC_PREVIEW },
155 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
156 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
157 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
158 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
159 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
160 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
161 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
162 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
163 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
164 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
165 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
166 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
167 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
168 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
169 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
170 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
171 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
172 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
173 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
174 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
175 { "\\set_color", LyXRC::RC_SET_COLOR },
176 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
177 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
178 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
179 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
180 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
181 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
182 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
183 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
184 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
185 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
186 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
187 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
188 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
189 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
190 { "\\ui_file", LyXRC::RC_UIFILE },
191 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
192 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
193 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
194 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
195 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
196 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
197 // compatibility with versions older than 1.4.0 only
198 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
199 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
200 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
201 { "\\user_email", LyXRC::RC_USER_EMAIL },
202 { "\\user_name", LyXRC::RC_USER_NAME },
203 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
204 // compatibility with versions older than 1.4.0 only
205 { "\\viewer", LyXRC::RC_VIEWER},
206 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
207 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
208 { "format", LyXRC::RC_LYXRCFORMAT }
211 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
222 void LyXRC::setDefaults()
225 use_system_theme_icons = false;
227 def_file = "default";
229 // The current document directory
230 texinputs_prefix = ".";
231 print_landscape_flag = "-t landscape";
232 print_paper_flag = "-t";
233 print_paper_dimension_flag = "-T";
234 document_path.erase();
235 view_dvi_paper_option.erase();
236 default_view_format = "pdf2";
237 default_otf_view_format = "pdf4";
238 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
239 bibtex_command = "bibtex";
241 index_command = "makeindex -c -q";
242 nomencl_command = "makeindex -s nomencl.ist";
244 // Because a screen is typically wider than a piece of paper:
246 allow_geometry_session = true;
247 // Default LaTeX font size:
248 font_sizes[FONT_SIZE_TINY] = "5.0";
249 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
250 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
251 font_sizes[FONT_SIZE_SMALL] = "9.0";
252 font_sizes[FONT_SIZE_NORMAL] = "10.0";
253 font_sizes[FONT_SIZE_LARGE] = "12.0";
254 font_sizes[FONT_SIZE_LARGER] = "14.4";
255 font_sizes[FONT_SIZE_LARGEST] = "17.26";
256 font_sizes[FONT_SIZE_HUGE] = "20.74";
257 font_sizes[FONT_SIZE_HUGER] = "24.88";
258 use_scalable_fonts = true;
259 roman_font_name = "";
261 typewriter_font_name = "";
263 auto_region_delete = true;
264 auto_reset_options = false;
265 plaintext_linelen = 65;
266 mouse_wheel_speed = 1.0;
268 check_lastfiles = true;
269 use_lastfilepos = true;
270 load_session = false;
272 save_compressed = false;
274 backupdir_path.erase();
275 display_graphics = true;
276 // Spellchecker settings:
277 // FIXME: this check should test the target platform (darwin)
278 #if defined(USE_MACOSX_PACKAGING)
279 spellchecker = "native";
280 #elif defined(USE_ASPELL)
281 spellchecker = "aspell";
282 #elif defined(USE_HUNSPELL)
283 spellchecker = "hunspell";
285 spellchecker = "aspell";
287 spellchecker_accept_compound = false;
288 spellcheck_continuously = false;
289 completion_minlength = 6;
290 spellcheck_notes = true;
292 visual_cursor = false;
294 mark_foreign_language = true;
295 language_auto_begin = true;
296 language_auto_end = true;
297 language_global_options = true;
298 language_package_selection = LP_AUTO;
299 language_custom_package = "\\usepackage{babel}";
300 language_command_begin = "\\selectlanguage{$$lang}";
301 language_command_local = "\\foreignlanguage{$$lang}{";
302 sort_layouts = false;
303 group_layouts = true;
304 gui_language = "auto";
306 windows_style_tex_paths = false;
307 tex_allows_spaces = false;
308 date_insert_format = "%x";
309 cursor_follows_scrollbar = false;
310 scroll_below_document = false;
311 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
312 paragraph_markers = false;
313 mac_dontswap_ctrl_meta = false;
314 mac_like_cursor_movement = false;
315 macro_edit_style = MACRO_EDIT_INLINE_BOX;
316 dialogs_iconify_with_main = false;
317 preview = PREVIEW_OFF;
318 preview_hashed_labels = false;
319 preview_scale_factor = 1.0;
320 use_converter_cache = true;
321 use_converter_needauth_forbidden = true;
322 use_converter_needauth = true;
323 use_system_colors = false;
325 use_pixmap_cache = false;
327 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
328 user_name = to_utf8(support::user_name());
329 user_email = to_utf8(support::user_email());
330 open_buffers_in_tabs = true;
331 single_close_tab_button = false;
332 single_instance = true;
333 forward_search_dvi = string();
334 forward_search_pdf = string();
335 export_overwrite = NO_FILES;
337 // Fullscreen settings
338 full_screen_limit = false;
339 full_screen_toolbars = true;
340 full_screen_tabbar = true;
341 full_screen_menubar = true;
342 full_screen_statusbar = true;
343 full_screen_scrollbar = true;
344 full_screen_width = 700;
346 completion_cursor_text = true;
347 completion_popup_math = true;
348 completion_popup_text = false;
349 completion_popup_delay = 2.0;
350 completion_popup_after_complete = true;
351 autocorrection_math = false;
352 completion_inline_math = true;
353 completion_inline_text = false;
354 completion_inline_dots = -1;
355 completion_inline_delay = 0.2;
356 default_decimal_point = ".";
357 default_length_unit = Length::CM;
359 close_buffer_with_last_view = "yes";
360 mouse_middlebutton_paste = true;
366 void oldFontFormat(string & family, string & foundry)
368 if (family.empty() || family[0] != '-')
370 foundry = token(family, '-', 1);
371 family = token(family, '-', 2);
379 bool LyXRC::read(FileName const & filename, bool check_format)
381 Lexer lexrc(lyxrcTags);
382 lexrc.setFile(filename);
383 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
384 ReturnValues retval = read(lexrc, check_format);
385 if (!check_format || retval != FormatMismatch)
386 return retval == ReadOK;
388 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
389 TempFile tmp("convert_lyxrc");
390 FileName const tempfile = tmp.name();
391 bool const success = prefs2prefs(filename, tempfile, false);
393 LYXERR0 ("Unable to convert " << filename.absFileName() <<
394 " to format " << LYXRC_FILEFORMAT);
397 // Keep this in the else branch, such that lexrc2 goes out
398 // of scope and releases the lock on tempfile before we
399 // attempt to remove it. This matters on Windows.
400 Lexer lexrc2(lyxrcTags);
401 lexrc2.setFile(tempfile);
402 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
403 retval = read(lexrc2, check_format);
405 return retval == ReadOK;
409 // don't need to worry about conversion, because this is always
410 // from an internal source
411 bool LyXRC::read(istream & is)
413 Lexer lexrc(lyxrcTags);
415 LYXERR(Debug::LYXRC, "Reading istream...");
416 return read(lexrc, false) == ReadOK;
420 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
422 if (lyxerr.debugging(Debug::PARSER))
423 lexrc.printTable(lyxerr);
428 // format prior to 2.0 and introduction of format tag
429 unsigned int format = 0;
431 while (lexrc.isOK()) {
432 // By using two switches we take advantage of the compiler
433 // telling us if we have missed a LyXRCTags element in
434 // the second switch.
435 // Note that this also shows a problem with Lexer since it
436 // helps us avoid taking advantage of the strictness of the
439 int le = lexrc.lex();
441 case Lexer::LEX_UNDEF:
442 lexrc.printError("Unknown tag `$$Token'");
444 case Lexer::LEX_FEOF:
449 switch (static_cast<LyXRCTags>(le)) {
452 format = lexrc.getInteger();
454 case RC_INPUT: // Include file
457 libFileSearch(string(),
459 if (read(tmp, check_format)) {
461 "Error reading included file: " + tmp.absFileName());
467 bind_file = os::internal_path(lexrc.getString());
472 def_file = os::internal_path(lexrc.getString());
477 ui_file = os::internal_path(lexrc.getString());
480 case RC_AUTORESET_OPTIONS:
481 lexrc >> auto_reset_options;
484 case RC_DISPLAY_GRAPHICS:
486 display_graphics = lexrc.getString() == "true";
489 case RC_TEX_EXPECTS_WINDOWS_PATHS:
490 lexrc >> windows_style_tex_paths;
493 case RC_TEX_ALLOWS_SPACES:
494 lexrc >> tex_allows_spaces;
497 case RC_TEXINPUTS_PREFIX:
498 lexrc >> texinputs_prefix;
505 case RC_KBMAP_PRIMARY:
507 string const kmap(os::internal_path(lexrc.getString()));
508 if (!libFileSearch("kbd", kmap, "kmap").empty()
510 primary_kbmap = kmap;
512 lexrc.printError("LyX: Keymap `$$Token' not found");
517 case RC_KBMAP_SECONDARY:
519 string const kmap(os::internal_path(lexrc.getString()));
520 if (!libFileSearch("kbd", kmap, "kmap").empty()
522 secondary_kbmap = kmap;
524 lexrc.printError("LyX: Keymap `$$Token' not found");
529 case RC_FONT_ENCODING:
533 case RC_PRINTLANDSCAPEFLAG:
534 lexrc >> print_landscape_flag;
537 case RC_PRINTPAPERDIMENSIONFLAG:
538 lexrc >> print_paper_dimension_flag;
541 case RC_PRINTPAPERFLAG:
542 lexrc >> print_paper_flag;
545 case RC_VIEWDVI_PAPEROPTION:
547 view_dvi_paper_option = lexrc.getString();
549 view_dvi_paper_option.erase();
552 case RC_CHKTEX_COMMAND:
553 if (lexrc.next(true)) {
554 chktex_command = lexrc.getString();
558 case RC_BIBTEX_ALTERNATIVES:
559 if (lexrc.next(true)) {
560 bibtex_alternatives.insert(lexrc.getString());
564 case RC_BIBTEX_COMMAND:
565 if (lexrc.next(true)) {
566 bibtex_command = lexrc.getString();
570 case RC_JBIBTEX_COMMAND:
571 if (lexrc.next(true)) {
572 jbibtex_command = lexrc.getString();
576 case RC_INDEX_ALTERNATIVES:
577 if (lexrc.next(true)) {
578 index_alternatives.insert(lexrc.getString());
582 case RC_INDEX_COMMAND:
583 if (lexrc.next(true)) {
584 index_command = lexrc.getString();
588 case RC_JINDEX_COMMAND:
589 if (lexrc.next(true)) {
590 jindex_command = lexrc.getString();
594 case RC_SPLITINDEX_COMMAND:
595 if (lexrc.next(true)) {
596 splitindex_command = lexrc.getString();
600 case RC_NOMENCL_COMMAND:
601 if (lexrc.next(true)) {
602 nomencl_command = lexrc.getString();
616 case RC_GEOMETRY_SESSION:
617 lexrc >> allow_geometry_session;
620 case RC_SCREEN_FONT_SIZES:
621 lexrc >> font_sizes[FONT_SIZE_TINY];
622 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
623 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
624 lexrc >> font_sizes[FONT_SIZE_SMALL];
625 lexrc >> font_sizes[FONT_SIZE_NORMAL];
626 lexrc >> font_sizes[FONT_SIZE_LARGE];
627 lexrc >> font_sizes[FONT_SIZE_LARGER];
628 lexrc >> font_sizes[FONT_SIZE_LARGEST];
629 lexrc >> font_sizes[FONT_SIZE_HUGE];
630 lexrc >> font_sizes[FONT_SIZE_HUGER];
633 case RC_SCREEN_FONT_SCALABLE:
634 lexrc >> use_scalable_fonts;
641 case RC_DOCUMENTPATH:
643 document_path = os::internal_path(lexrc.getString());
648 example_path = os::internal_path(lexrc.getString());
651 case RC_TEMPLATEPATH:
653 template_path = os::internal_path(lexrc.getString());
658 tempdir_path = os::internal_path(lexrc.getString());
661 case RC_THESAURUSDIRPATH:
663 thesaurusdir_path = os::internal_path(lexrc.getString());
666 case RC_HUNSPELLDIR_PATH:
668 hunspelldir_path = os::internal_path(lexrc.getString());
671 case RC_USELASTFILEPOS:
672 lexrc >> use_lastfilepos;
676 lexrc >> load_session;
679 case RC_MOUSE_WHEEL_SPEED:
680 lexrc >> mouse_wheel_speed;
683 case RC_COMPLETION_INLINE_DELAY:
684 lexrc >> completion_inline_delay;
687 case RC_COMPLETION_INLINE_MATH:
688 lexrc >> completion_inline_math;
691 case RC_COMPLETION_INLINE_TEXT:
692 lexrc >> completion_inline_text;
695 case RC_COMPLETION_INLINE_DOTS:
696 lexrc >> completion_inline_dots;
699 case RC_AUTOCORRECTION_MATH:
700 lexrc >> autocorrection_math;
703 case RC_COMPLETION_POPUP_DELAY:
704 lexrc >> completion_popup_delay;
707 case RC_COMPLETION_POPUP_MATH:
708 lexrc >> completion_popup_math;
711 case RC_COMPLETION_POPUP_TEXT:
712 lexrc >> completion_popup_text;
715 case RC_COMPLETION_CURSOR_TEXT:
716 lexrc >> completion_cursor_text;
719 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
720 lexrc >> completion_popup_after_complete;
723 case RC_COMPLETION_MINLENGTH:
724 lexrc >> completion_minlength;
727 case RC_NUMLASTFILES:
728 lexrc >> num_lastfiles;
731 case RC_CHECKLASTFILES:
732 lexrc >> check_lastfiles;
739 case RC_USE_SYSTEM_THEME_ICONS:
740 lexrc >> use_system_theme_icons;
743 case RC_SCREEN_FONT_ROMAN:
745 roman_font_name = lexrc.getString();
746 oldFontFormat(roman_font_name,
751 case RC_SCREEN_FONT_SANS:
753 sans_font_name = lexrc.getString();
754 oldFontFormat(sans_font_name, sans_font_foundry);
758 case RC_SCREEN_FONT_TYPEWRITER:
760 typewriter_font_name = lexrc.getString();
761 oldFontFormat(typewriter_font_name,
762 typewriter_font_foundry);
766 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
767 lexrc >> roman_font_foundry;
770 case RC_SCREEN_FONT_SANS_FOUNDRY:
771 lexrc >> sans_font_foundry;
774 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
775 lexrc >> typewriter_font_foundry;
780 lexrc.printError("Missing color tag.");
783 string lyx_name = lexrc.getString();
786 lexrc.printError("Missing color name for color: `$$Token'");
789 string x11_name = lexrc.getString();
791 ColorCode const col =
792 lcolor.getFromLyXName(lyx_name);
793 if (col == Color_none ||
794 col == Color_inherit ||
798 if (!lcolor.setColor(col, x11_name))
799 LYXERR0("Bad lyxrc set_color for " << lyx_name);
803 case RC_AUTOREGIONDELETE:
804 // Auto region delete defaults to true
805 lexrc >> auto_region_delete;
810 lyxpipes = os::internal_path(lexrc.getString());
813 case RC_CURSOR_FOLLOWS_SCROLLBAR:
814 lexrc >> cursor_follows_scrollbar;
817 case RC_CURSOR_WIDTH:
818 lexrc >> cursor_width;
821 case RC_SCROLL_BELOW_DOCUMENT:
822 lexrc >> scroll_below_document;
825 case RC_PARAGRAPH_MARKERS:
826 lexrc >> paragraph_markers;
829 case RC_MAC_DONTSWAP_CTRL_META:
830 lexrc >> mac_dontswap_ctrl_meta;
833 case RC_MAC_LIKE_CURSOR_MOVEMENT:
834 lexrc >> mac_like_cursor_movement;
837 case RC_MACRO_EDIT_STYLE:
839 switch (lexrc.getInteger()) {
840 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
841 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
842 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
847 case RC_DIALOGS_ICONIFY_WITH_MAIN:
848 lexrc >> dialogs_iconify_with_main;
851 case RC_PLAINTEXT_LINELEN:
852 lexrc >> plaintext_linelen;
854 // Spellchecker settings:
855 case RC_ACCEPT_COMPOUND:
856 lexrc >> spellchecker_accept_compound;
858 case RC_USE_SYSTEM_COLORS:
859 lexrc >> use_system_colors;
862 lexrc >> use_tooltip;
864 case RC_USE_PIXMAP_CACHE:
865 lexrc >> use_pixmap_cache;
870 case RC_SPELLCHECKER:
871 lexrc >> spellchecker;
874 lexrc >> spellchecker_alt_lang;
877 lexrc >> spellchecker_esc_chars;
879 case RC_SPELLCHECK_CONTINUOUSLY:
880 lexrc >> spellcheck_continuously;
882 case RC_SPELLCHECK_NOTES:
883 lexrc >> spellcheck_notes;
886 lexrc >> make_backup;
888 case RC_SAVE_COMPRESSED:
889 lexrc >> save_compressed;
892 lexrc >> save_origin;
894 case RC_BACKUPDIR_PATH:
896 backupdir_path = os::internal_path(lexrc.getString());
898 case RC_DEFAULT_DECIMAL_POINT:
899 lexrc >> default_decimal_point;
901 case RC_DEFAULT_LENGTH_UNIT:
903 default_length_unit = (Length::UNIT) lexrc.getInteger();
905 case RC_DATE_INSERT_FORMAT:
906 lexrc >> date_insert_format;
908 case RC_LANGUAGE_CUSTOM_PACKAGE:
909 lexrc >> language_custom_package;
911 case RC_LANGUAGE_AUTO_BEGIN:
912 lexrc >> language_auto_begin;
914 case RC_LANGUAGE_AUTO_END:
915 lexrc >> language_auto_end;
917 case RC_LANGUAGE_GLOBAL_OPTIONS:
918 lexrc >> language_global_options;
920 case RC_LANGUAGE_PACKAGE_SELECTION:
922 switch (lexrc.getInteger()) {
924 language_package_selection = LP_AUTO;
927 language_package_selection = LP_BABEL;
930 language_package_selection = LP_CUSTOM;
933 language_package_selection = LP_NONE;
938 case RC_LANGUAGE_COMMAND_BEGIN:
939 lexrc >> language_command_begin;
941 case RC_LANGUAGE_COMMAND_END:
942 lexrc >> language_command_end;
944 case RC_LANGUAGE_COMMAND_LOCAL:
945 lexrc >> language_command_local;
947 case RC_VISUAL_CURSOR:
948 lexrc >> visual_cursor;
950 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
951 lexrc >> close_buffer_with_last_view;
954 lexrc >> auto_number;
956 case RC_MARK_FOREIGN_LANGUAGE:
957 lexrc >> mark_foreign_language;
963 fmt = lexrc.getString();
964 if (lexrc.next(true))
965 command = lexrc.getString();
966 setMover(fmt, command);
971 string from, to, command, flags;
973 from = lexrc.getString();
975 to = lexrc.getString();
976 if (lexrc.next(true))
977 command = lexrc.getString();
979 flags = lexrc.getString();
981 theConverters().erase(from, to);
983 theConverters().add(from, to, command, flags);
986 // compatibility with versions older than 1.4.0 only
988 string format, command;
989 lexrc >> format >> command;
990 formats.setViewer(format, command);
993 case RC_FILEFORMAT: {
995 string format, extensions, shortcut;
996 docstring prettyname;
997 if (!(lexrc >> format >> extensions))
999 if (ok && lexrc.next(true))
1000 prettyname = lexrc.getDocString();
1004 if(!(lexrc >> shortcut))
1006 string viewer, editor;
1007 if (ok && lexrc.next(true))
1008 viewer = lexrc.getString();
1011 if (ok && lexrc.next(true))
1012 editor = lexrc.getString();
1016 if (!(lexrc >> flags >> mime))
1018 int flgs = Format::none;
1019 while (!flags.empty()) {
1021 flags = split(flags, flag, ',');
1022 if (flag == "document")
1023 flgs |= Format::document;
1024 else if (flag == "vector")
1025 flgs |= Format::vector;
1026 else if (flag == "zipped=native")
1027 flgs |= Format::zipped_native;
1028 else if (flag == "menu=export")
1029 flgs |= Format::export_menu;
1031 LYXERR0("Ignoring unknown flag `"
1032 << flag << "' for format `"
1036 LYXERR0("Syntax error in format " << format);
1037 else if (prettyname.empty()) {
1038 if (theConverters().formatIsUsed(format))
1039 LYXERR0("Can't delete format " << format);
1041 formats.erase(format);
1043 formats.add(format, extensions, prettyname,
1044 shortcut, viewer, editor, mime, flgs);
1048 case RC_VIEWER_ALTERNATIVES: {
1049 string format, command;
1050 if ((lexrc >> format) && lexrc.next(true)) {
1051 command = lexrc.getString();
1052 viewer_alternatives[format].insert(command);
1056 case RC_EDITOR_ALTERNATIVES: {
1057 string format, command;
1058 if ((lexrc >> format) && lexrc.next(true)) {
1059 command = lexrc.getString();
1060 editor_alternatives[format].insert(command);
1065 case RC_DEFAULT_OTF_VIEW_FORMAT:
1066 lexrc >> default_otf_view_format;
1069 case RC_DEFAULT_VIEW_FORMAT:
1070 lexrc >> default_view_format;
1073 case RC_GUI_LANGUAGE:
1074 lexrc >> gui_language;
1077 case RC_SHOW_BANNER:
1078 lexrc >> show_banner;
1083 string const tmp = lexrc.getString();
1084 if (tmp == "true" || tmp == "on")
1085 preview = PREVIEW_ON;
1086 else if (tmp == "no_math")
1087 preview = PREVIEW_NO_MATH;
1089 preview = PREVIEW_OFF;
1090 if (tmp != "false" && tmp != "off")
1091 LYXERR0("Unrecognized preview status \""
1097 case RC_PREVIEW_HASHED_LABELS:
1098 lexrc >> preview_hashed_labels;
1101 case RC_PREVIEW_SCALE_FACTOR:
1102 lexrc >> preview_scale_factor;
1109 lexrc >> user_email;
1112 case RC_PATH_PREFIX:
1113 lexrc >> path_prefix;
1116 case RC_USE_CONVERTER_CACHE:
1117 lexrc >> use_converter_cache;
1119 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1120 lexrc >> use_converter_needauth_forbidden;
1122 case RC_USE_CONVERTER_NEEDAUTH:
1123 lexrc >> use_converter_needauth;
1125 case RC_CONVERTER_CACHE_MAXAGE:
1126 lexrc >> converter_cache_maxage;
1129 case RC_SORT_LAYOUTS:
1130 lexrc >> sort_layouts;
1132 case RC_GROUP_LAYOUTS:
1133 lexrc >> group_layouts;
1135 case RC_FULL_SCREEN_LIMIT:
1136 lexrc >> full_screen_limit;
1138 case RC_FULL_SCREEN_TOOLBARS:
1139 lexrc >> full_screen_toolbars;
1141 case RC_FULL_SCREEN_SCROLLBAR:
1142 lexrc >> full_screen_scrollbar;
1144 case RC_FULL_SCREEN_STATUSBAR:
1145 lexrc >> full_screen_statusbar;
1147 case RC_FULL_SCREEN_TABBAR:
1148 lexrc >> full_screen_tabbar;
1150 case RC_FULL_SCREEN_MENUBAR:
1151 lexrc >> full_screen_menubar;
1153 case RC_FULL_SCREEN_WIDTH:
1154 lexrc >> full_screen_width;
1156 case RC_OPEN_BUFFERS_IN_TABS:
1157 lexrc >> open_buffers_in_tabs;
1159 case RC_SINGLE_CLOSE_TAB_BUTTON:
1160 lexrc >> single_close_tab_button;
1162 case RC_SINGLE_INSTANCE:
1163 lexrc >> single_instance;
1164 if (run_mode == PREFERRED)
1165 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1167 case RC_FORWARD_SEARCH_DVI:
1168 if (lexrc.next(true))
1169 forward_search_dvi = lexrc.getString();
1171 case RC_FORWARD_SEARCH_PDF:
1172 if (lexrc.next(true))
1173 forward_search_pdf = lexrc.getString();
1175 case RC_EXPORT_OVERWRITE:
1177 string const tmp = lexrc.getString();
1178 if (tmp == "all" || tmp == "true")
1179 export_overwrite = ALL_FILES;
1180 else if (tmp == "main")
1181 export_overwrite = MAIN_FILE;
1183 export_overwrite = NO_FILES;
1184 if (tmp != "ask" && tmp != "false")
1185 LYXERR0("Unrecognized export_overwrite status \""
1190 case RC_SCROLL_WHEEL_ZOOM:
1192 string const tmp = lexrc.getString();
1194 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1195 else if (tmp == "shift")
1196 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1197 else if (tmp == "alt")
1198 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1200 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1201 if (tmp != "off" && tmp != "false")
1202 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1208 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1209 lexrc >> mouse_middlebutton_paste;
1213 break; // this is just a dummy
1216 // This is triggered the first time through the loop unless
1217 // we hit a format tag.
1218 if (check_format && format != LYXRC_FILEFORMAT)
1219 return FormatMismatch;
1222 /// Update converters data-structures
1223 theConverters().update(formats);
1224 theConverters().buildGraph();
1225 theBufferList().invalidateConverterCache();
1231 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1233 ofstream ofs(filename.toFilesystemEncoding().c_str());
1235 write(ofs, ignore_system_lyxrc);
1239 void LyXRC::print() const
1241 if (lyxerr.debugging())
1242 write(lyxerr, false);
1250 typedef pair<string, SpecialisedMover> Data;
1252 SameMover(Data const & comparison)
1253 : comparison_(comparison) {}
1255 bool operator()(Data const & data) const
1257 return data.first == comparison_.first &&
1258 data.second.command() == comparison_.second.command();
1268 // Escape \ and " so that LyXLex can read the string later
1269 string escapeCommand(string const & str) {
1270 return subst(subst(str , "\\", "\\\\"),
1277 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1279 LyXRCTags tag = RC_LAST;
1281 if (!name.empty()) {
1282 for (int i = 0; i != lyxrcCount; ++i)
1283 if ("\\" + name == lyxrcTags[i].tag)
1284 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1288 os << "# LyX " << lyx_version
1289 << " generated this file. If you want to make your own\n"
1290 << "# modifications you should do them from inside LyX and save.\n\n"
1291 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1293 // Why the switch you might ask. It is a trick to ensure that all
1294 // the elements in the LyXRCTags enum are handled. As you can see
1295 // there are no breaks at all. So it is just a huge fall-through.
1296 // The nice thing is that we will get a warning from the compiler
1297 // if we forget an element.
1301 // input/include files are not done here
1302 case RC_LYXRCFORMAT:
1304 if (ignore_system_lyxrc ||
1305 bind_file != system_lyxrc.bind_file) {
1306 string const path = os::external_path(bind_file);
1307 os << "\\bind_file \"" << path << "\"\n";
1313 if (ignore_system_lyxrc ||
1314 def_file != system_lyxrc.def_file) {
1315 string const path = os::external_path(def_file);
1316 os << "\\def_file \"" << path << "\"\n";
1325 << "# MISC SECTION ######################################\n"
1327 // bind files are not done here.
1329 case RC_PATH_PREFIX:
1330 if (ignore_system_lyxrc ||
1331 path_prefix != system_lyxrc.path_prefix) {
1332 os << "\\path_prefix \"" << path_prefix << "\"\n";
1337 if (ignore_system_lyxrc ||
1338 ui_file != system_lyxrc.ui_file) {
1339 string const path = os::external_path(ui_file);
1340 os << "\\ui_file \"" << path << "\"\n";
1344 case RC_AUTOREGIONDELETE:
1345 if (ignore_system_lyxrc ||
1346 auto_region_delete != system_lyxrc.auto_region_delete) {
1347 os << "# Set to false to inhibit automatic replacement of\n"
1348 << "# the current selection.\n"
1349 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1354 case RC_AUTORESET_OPTIONS:
1355 if (ignore_system_lyxrc ||
1356 auto_reset_options != system_lyxrc.auto_reset_options) {
1357 os << "# Set to false to inhibit automatic reset of\n"
1358 << "# the class options to defaults on class change.\n"
1359 << "\\auto_reset_options "
1360 << convert<string>(auto_reset_options)
1366 if (ignore_system_lyxrc ||
1367 autosave != system_lyxrc.autosave) {
1368 os << "# The time interval between auto-saves in seconds.\n"
1369 << "\\autosave " << autosave << '\n';
1373 case RC_DISPLAY_GRAPHICS:
1374 if (ignore_system_lyxrc ||
1375 display_graphics != system_lyxrc.display_graphics) {
1376 os << "# Display graphics within LyX\n"
1378 << "\\display_graphics "
1379 << (display_graphics ? "true" : "false")
1384 case RC_SORT_LAYOUTS:
1385 if (ignore_system_lyxrc ||
1386 sort_layouts != system_lyxrc.sort_layouts) {
1387 os << "# Sort layouts alphabetically.\n"
1388 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1392 case RC_GROUP_LAYOUTS:
1393 if (ignore_system_lyxrc ||
1394 group_layouts != system_lyxrc.group_layouts) {
1395 os << "# Group layouts by their category.\n"
1396 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1400 case RC_VIEWDVI_PAPEROPTION:
1401 if (ignore_system_lyxrc ||
1402 view_dvi_paper_option
1403 != system_lyxrc.view_dvi_paper_option) {
1404 os << "# Options used to specify paper size to the\n"
1405 << "# view_dvi_command (e.g. -paper)\n"
1406 << "\\view_dvi_paper_option \""
1407 << view_dvi_paper_option << "\"\n";
1411 case RC_CHKTEX_COMMAND:
1412 if (ignore_system_lyxrc ||
1413 chktex_command != system_lyxrc.chktex_command) {
1414 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1418 case RC_BIBTEX_ALTERNATIVES: {
1419 CommandSet::const_iterator it = bibtex_alternatives.begin();
1420 CommandSet::const_iterator end = bibtex_alternatives.end();
1421 for ( ; it != end; ++it) {
1422 if (ignore_system_lyxrc
1423 || !system_lyxrc.bibtex_alternatives.count(*it))
1424 os << "\\bibtex_alternatives \""
1430 case RC_BIBTEX_COMMAND:
1431 if (ignore_system_lyxrc ||
1432 bibtex_command != system_lyxrc.bibtex_command) {
1433 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1437 case RC_JBIBTEX_COMMAND:
1438 if (ignore_system_lyxrc ||
1439 jbibtex_command != system_lyxrc.jbibtex_command) {
1440 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1444 case RC_INDEX_ALTERNATIVES: {
1445 CommandSet::const_iterator it = index_alternatives.begin();
1446 CommandSet::const_iterator end = index_alternatives.end();
1447 for ( ; it != end; ++it) {
1448 if (ignore_system_lyxrc
1449 || !system_lyxrc.index_alternatives.count(*it))
1450 os << "\\index_alternatives \""
1456 case RC_INDEX_COMMAND:
1457 if (ignore_system_lyxrc ||
1458 index_command != system_lyxrc.index_command) {
1459 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1463 case RC_JINDEX_COMMAND:
1464 if (ignore_system_lyxrc ||
1465 jindex_command != system_lyxrc.jindex_command) {
1466 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1470 case RC_SPLITINDEX_COMMAND:
1471 if (ignore_system_lyxrc ||
1472 splitindex_command != system_lyxrc.splitindex_command) {
1473 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1477 case RC_NOMENCL_COMMAND:
1478 if (ignore_system_lyxrc ||
1479 nomencl_command != system_lyxrc.nomencl_command) {
1480 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1484 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1485 // Don't write this setting to the preferences file,
1486 // but allow temporary changes (bug 7557).
1487 if (ignore_system_lyxrc) {
1488 os << "\\tex_expects_windows_paths "
1489 << convert<string>(windows_style_tex_paths) << '\n';
1493 case RC_TEX_ALLOWS_SPACES:
1494 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1495 os << "\\tex_allows_spaces "
1496 << convert<string>(tex_allows_spaces) << '\n';
1501 if (ignore_system_lyxrc ||
1502 use_kbmap != system_lyxrc.use_kbmap) {
1503 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1507 case RC_KBMAP_PRIMARY:
1508 if (ignore_system_lyxrc ||
1509 primary_kbmap != system_lyxrc.primary_kbmap) {
1510 string const path = os::external_path(primary_kbmap);
1511 os << "\\kbmap_primary \"" << path << "\"\n";
1515 case RC_KBMAP_SECONDARY:
1516 if (ignore_system_lyxrc ||
1517 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1518 string const path = os::external_path(secondary_kbmap);
1519 os << "\\kbmap_secondary \"" << path << "\"\n";
1524 if (ignore_system_lyxrc ||
1525 lyxpipes != system_lyxrc.lyxpipes) {
1526 string const path = os::external_path(lyxpipes);
1527 os << "\\serverpipe \"" << path << "\"\n";
1531 case RC_DATE_INSERT_FORMAT:
1532 if (ignore_system_lyxrc ||
1533 date_insert_format != system_lyxrc.date_insert_format) {
1534 os << "\\date_insert_format \"" << date_insert_format
1541 os << "\\user_name \"" << user_name << "\"\n";
1546 os << "\\user_email \"" << user_email << "\"\n";
1550 case RC_SHOW_BANNER:
1551 if (ignore_system_lyxrc ||
1552 show_banner != system_lyxrc.show_banner) {
1553 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1559 if (ignore_system_lyxrc ||
1560 preview != system_lyxrc.preview) {
1566 case PREVIEW_NO_MATH:
1573 os << "\\preview " << status << '\n';
1578 case RC_PREVIEW_HASHED_LABELS:
1579 if (ignore_system_lyxrc ||
1580 preview_hashed_labels !=
1581 system_lyxrc.preview_hashed_labels) {
1582 os << "\\preview_hashed_labels "
1583 << convert<string>(preview_hashed_labels) << '\n';
1588 case RC_PREVIEW_SCALE_FACTOR:
1589 if (ignore_system_lyxrc ||
1590 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1591 os << "\\preview_scale_factor "
1592 << preview_scale_factor << '\n';
1597 case RC_USE_CONVERTER_CACHE:
1598 if (ignore_system_lyxrc ||
1599 use_converter_cache != system_lyxrc.use_converter_cache) {
1600 os << "\\use_converter_cache "
1601 << convert<string>(use_converter_cache) << '\n';
1606 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1607 if (ignore_system_lyxrc ||
1608 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1609 os << "\\use_converter_needauth_forbidden "
1610 << convert<string>(use_converter_needauth_forbidden) << '\n';
1615 case RC_USE_CONVERTER_NEEDAUTH:
1616 if (ignore_system_lyxrc ||
1617 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1618 os << "\\use_converter_needauth "
1619 << convert<string>(use_converter_needauth) << '\n';
1624 case RC_CONVERTER_CACHE_MAXAGE:
1625 if (ignore_system_lyxrc ||
1626 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1627 os << "\\converter_cache_maxage "
1628 << converter_cache_maxage << '\n';
1634 << "# SCREEN & FONTS SECTION ############################\n"
1638 if (ignore_system_lyxrc ||
1639 icon_set != system_lyxrc.icon_set) {
1640 os << "\\icon_set \"" << icon_set
1646 case RC_USE_SYSTEM_THEME_ICONS:
1647 if (ignore_system_lyxrc ||
1648 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1649 os << "\\use_system_theme_icons "
1650 << convert<string>(use_system_theme_icons)
1657 if (ignore_system_lyxrc ||
1658 dpi != system_lyxrc.dpi) {
1659 os << "\\screen_dpi " << dpi << '\n';
1663 case RC_SCREEN_ZOOM:
1664 if (ignore_system_lyxrc ||
1665 zoom != system_lyxrc.zoom) {
1666 os << "\\screen_zoom " << zoom << '\n';
1670 case RC_GEOMETRY_SESSION:
1671 if (ignore_system_lyxrc ||
1672 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1673 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1678 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1679 if (ignore_system_lyxrc ||
1680 cursor_follows_scrollbar
1681 != system_lyxrc.cursor_follows_scrollbar) {
1682 os << "\\cursor_follows_scrollbar "
1683 << convert<string>(cursor_follows_scrollbar) << '\n';
1687 case RC_CURSOR_WIDTH:
1688 if (ignore_system_lyxrc ||
1690 != system_lyxrc.cursor_width) {
1691 os << "\\cursor_width "
1692 << cursor_width << '\n';
1696 case RC_SCROLL_BELOW_DOCUMENT:
1697 if (ignore_system_lyxrc ||
1698 scroll_below_document
1699 != system_lyxrc.scroll_below_document) {
1700 os << "\\scroll_below_document "
1701 << convert<string>(scroll_below_document) << '\n';
1705 case RC_PARAGRAPH_MARKERS:
1706 if (ignore_system_lyxrc ||
1708 != system_lyxrc.paragraph_markers) {
1709 os << "\\paragraph_markers "
1710 << convert<string>(paragraph_markers) << '\n';
1714 case RC_MAC_DONTSWAP_CTRL_META:
1715 if (ignore_system_lyxrc ||
1716 mac_dontswap_ctrl_meta
1717 != system_lyxrc.mac_dontswap_ctrl_meta) {
1718 os << "\\mac_dontswap_ctrl_meta "
1719 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1723 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1724 if (ignore_system_lyxrc ||
1725 mac_like_cursor_movement
1726 != system_lyxrc.mac_like_cursor_movement) {
1727 os << "\\mac_like_cursor_movement "
1728 << convert<string>(mac_like_cursor_movement) << '\n';
1732 case RC_MACRO_EDIT_STYLE:
1733 if (ignore_system_lyxrc ||
1735 != system_lyxrc.macro_edit_style) {
1736 os << "\\macro_edit_style ";
1737 switch (macro_edit_style) {
1738 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1739 case MACRO_EDIT_INLINE: os << "1\n"; break;
1740 case MACRO_EDIT_LIST: os << "2\n"; break;
1745 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1746 if (ignore_system_lyxrc ||
1747 dialogs_iconify_with_main
1748 != system_lyxrc.dialogs_iconify_with_main) {
1749 os << "\\dialogs_iconify_with_main "
1750 << convert<string>(dialogs_iconify_with_main) << '\n';
1754 case RC_SCREEN_FONT_ROMAN:
1755 if (ignore_system_lyxrc ||
1756 roman_font_name != system_lyxrc.roman_font_name) {
1757 os << "\\screen_font_roman \"" << roman_font_name
1762 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1763 if (ignore_system_lyxrc ||
1764 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1765 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1770 case RC_SCREEN_FONT_SANS:
1771 if (ignore_system_lyxrc ||
1772 sans_font_name != system_lyxrc.sans_font_name) {
1773 os << "\\screen_font_sans \"" << sans_font_name
1778 case RC_SCREEN_FONT_SANS_FOUNDRY:
1779 if (ignore_system_lyxrc ||
1780 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1781 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1786 case RC_SCREEN_FONT_TYPEWRITER:
1787 if (ignore_system_lyxrc ||
1788 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1789 os << "\\screen_font_typewriter \""
1790 << typewriter_font_name << "\"\n";
1794 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1795 if (ignore_system_lyxrc ||
1796 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1797 os << "\\screen_font_typewriter_foundry \""
1798 << typewriter_font_foundry << "\"\n";
1803 case RC_SCREEN_FONT_SCALABLE:
1804 if (ignore_system_lyxrc ||
1805 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1806 os << "\\screen_font_scalable "
1807 << convert<string>(use_scalable_fonts)
1812 case RC_SCREEN_FONT_SIZES:
1813 if (ignore_system_lyxrc ||
1814 font_sizes[FONT_SIZE_TINY]
1815 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1816 font_sizes[FONT_SIZE_SCRIPT]
1817 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1818 font_sizes[FONT_SIZE_FOOTNOTE]
1819 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1820 font_sizes[FONT_SIZE_SMALL]
1821 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1822 font_sizes[FONT_SIZE_NORMAL]
1823 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1824 font_sizes[FONT_SIZE_LARGE]
1825 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1826 font_sizes[FONT_SIZE_LARGER]
1827 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1828 font_sizes[FONT_SIZE_LARGEST]
1829 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1830 font_sizes[FONT_SIZE_HUGE]
1831 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1832 font_sizes[FONT_SIZE_HUGER]
1833 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1834 streamsize old_prec = os.precision();
1835 os.setf(ios::fixed);
1837 os << "\\screen_font_sizes"
1838 << ' ' << font_sizes[FONT_SIZE_TINY]
1839 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1840 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1841 << ' ' << font_sizes[FONT_SIZE_SMALL]
1842 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1843 << ' ' << font_sizes[FONT_SIZE_LARGE]
1844 << ' ' << font_sizes[FONT_SIZE_LARGER]
1845 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1846 << ' ' << font_sizes[FONT_SIZE_HUGE]
1847 << ' ' << font_sizes[FONT_SIZE_HUGER]
1849 os.precision(old_prec);
1850 os.unsetf(ios::fixed);
1854 case RC_FULL_SCREEN_LIMIT:
1855 if (ignore_system_lyxrc ||
1856 full_screen_limit != system_lyxrc.full_screen_limit) {
1857 os << "\\fullscreen_limit "
1858 << convert<string>(full_screen_limit)
1863 case RC_FULL_SCREEN_TOOLBARS:
1864 if (ignore_system_lyxrc ||
1865 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1866 os << "\\fullscreen_toolbars "
1867 << convert<string>(full_screen_toolbars)
1872 case RC_FULL_SCREEN_SCROLLBAR:
1873 if (ignore_system_lyxrc ||
1874 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1875 os << "\\fullscreen_scrollbar "
1876 << convert<string>(full_screen_scrollbar)
1881 case RC_FULL_SCREEN_STATUSBAR:
1882 if (ignore_system_lyxrc ||
1883 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1884 os << "\\fullscreen_statusbar "
1885 << convert<string>(full_screen_statusbar)
1890 case RC_FULL_SCREEN_TABBAR:
1891 if (ignore_system_lyxrc ||
1892 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1893 os << "\\fullscreen_tabbar "
1894 << convert<string>(full_screen_tabbar)
1899 case RC_FULL_SCREEN_MENUBAR:
1900 if (ignore_system_lyxrc ||
1901 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1902 os << "\\fullscreen_menubar "
1903 << convert<string>(full_screen_menubar)
1908 case RC_FULL_SCREEN_WIDTH:
1909 if (ignore_system_lyxrc ||
1910 full_screen_width != system_lyxrc.full_screen_width) {
1911 os << "\\fullscreen_width "
1912 << convert<string>(full_screen_width)
1917 case RC_OPEN_BUFFERS_IN_TABS:
1918 if (ignore_system_lyxrc ||
1919 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1920 os << "\\open_buffers_in_tabs "
1921 << convert<string>(open_buffers_in_tabs)
1926 case RC_SINGLE_CLOSE_TAB_BUTTON:
1927 if (ignore_system_lyxrc ||
1928 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1929 os << "\\single_close_tab_button "
1930 << convert<string>(single_close_tab_button)
1935 case RC_SINGLE_INSTANCE:
1936 if (ignore_system_lyxrc ||
1937 single_instance != system_lyxrc.single_instance) {
1938 os << "\\single_instance "
1939 << convert<string>(single_instance)
1944 case RC_FORWARD_SEARCH_DVI:
1945 if (ignore_system_lyxrc ||
1946 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1947 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1951 case RC_FORWARD_SEARCH_PDF:
1952 if (ignore_system_lyxrc ||
1953 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1954 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1960 << "# COLOR SECTION ###################################\n"
1964 for (int i = 0; i < Color_ignore; ++i) {
1965 ColorCode lc = static_cast<ColorCode>(i);
1966 string const col = lcolor.getX11Name(lc);
1967 if (ignore_system_lyxrc
1968 || col != system_lcolor.getX11Name(lc)) {
1969 os << "\\set_color \""
1970 << lcolor.getLyXName(lc) << "\" \""
1978 << "# PRINTER SECTION ###################################\n"
1981 case RC_PRINTLANDSCAPEFLAG:
1982 if (ignore_system_lyxrc ||
1983 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1984 os << "\\print_landscape_flag \"" << print_landscape_flag
1990 case RC_PRINTPAPERFLAG:
1991 if (ignore_system_lyxrc ||
1992 print_paper_flag != system_lyxrc.print_paper_flag) {
1993 os << "\\print_paper_flag \"" << print_paper_flag
1999 case RC_PRINTPAPERDIMENSIONFLAG:
2000 if (ignore_system_lyxrc ||
2001 print_paper_dimension_flag
2002 != system_lyxrc.print_paper_dimension_flag) {
2003 os << "\\print_paper_dimension_flag \""
2004 << print_paper_dimension_flag << "\"\n";
2010 << "# TEX SECTION #######################################\n"
2013 case RC_TEXINPUTS_PREFIX:
2014 if (ignore_system_lyxrc ||
2015 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2016 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2021 case RC_FONT_ENCODING:
2022 if (ignore_system_lyxrc ||
2023 fontenc != system_lyxrc.fontenc) {
2024 os << "\\font_encoding \"" << fontenc << "\"\n";
2030 << "# FILE SECTION ######################################\n"
2033 case RC_DOCUMENTPATH:
2034 if (ignore_system_lyxrc ||
2035 document_path != system_lyxrc.document_path) {
2036 string const path = os::external_path(document_path);
2037 os << "\\document_path \"" << path << "\"\n";
2041 case RC_USELASTFILEPOS:
2042 if (ignore_system_lyxrc ||
2043 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2044 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2049 case RC_LOADSESSION:
2050 if (ignore_system_lyxrc ||
2051 load_session != system_lyxrc.load_session) {
2052 os << "\\load_session " << convert<string>(load_session)
2057 case RC_MOUSE_WHEEL_SPEED:
2058 if (ignore_system_lyxrc ||
2059 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2060 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2064 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2065 if (ignore_system_lyxrc ||
2066 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2067 os << "\\mouse_middlebutton_paste "
2068 << convert<string>(mouse_middlebutton_paste) << '\n';
2072 case RC_COMPLETION_INLINE_DELAY:
2073 if (ignore_system_lyxrc ||
2074 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2075 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2079 case RC_COMPLETION_INLINE_MATH:
2080 if (ignore_system_lyxrc ||
2081 completion_inline_math != system_lyxrc.completion_inline_math) {
2082 os << "\\completion_inline_math "
2083 << convert<string>(completion_inline_math) << '\n';
2087 case RC_COMPLETION_INLINE_TEXT:
2088 if (ignore_system_lyxrc ||
2089 completion_inline_text != system_lyxrc.completion_inline_text) {
2090 os << "\\completion_inline_text "
2091 << convert<string>(completion_inline_text) << '\n';
2095 case RC_COMPLETION_INLINE_DOTS:
2096 if (ignore_system_lyxrc ||
2097 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2098 os << "\\completion_inline_dots "
2099 << convert<string>(completion_inline_dots) << '\n';
2103 case RC_AUTOCORRECTION_MATH:
2104 if (ignore_system_lyxrc ||
2105 autocorrection_math != system_lyxrc.autocorrection_math) {
2106 os << "\\autocorrection_math "
2107 << convert<string>(autocorrection_math) << '\n';
2111 case RC_COMPLETION_POPUP_DELAY:
2112 if (ignore_system_lyxrc ||
2113 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2114 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2118 case RC_COMPLETION_POPUP_MATH:
2119 if (ignore_system_lyxrc ||
2120 completion_popup_math != system_lyxrc.completion_popup_math) {
2121 os << "\\completion_popup_math "
2122 << convert<string>(completion_popup_math) << '\n';
2126 case RC_COMPLETION_POPUP_TEXT:
2127 if (ignore_system_lyxrc ||
2128 completion_popup_text != system_lyxrc.completion_popup_text) {
2129 os << "\\completion_popup_text "
2130 << convert<string>(completion_popup_text) << '\n';
2134 case RC_COMPLETION_CURSOR_TEXT:
2135 if (ignore_system_lyxrc ||
2136 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2137 os << "\\completion_cursor_text "
2138 << convert<string>(completion_cursor_text) << '\n';
2142 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2143 if (ignore_system_lyxrc ||
2144 completion_popup_after_complete
2145 != system_lyxrc.completion_popup_after_complete) {
2146 os << "\\completion_popup_after_complete "
2147 << convert<string>(completion_popup_after_complete) << '\n';
2151 case RC_COMPLETION_MINLENGTH:
2152 if (ignore_system_lyxrc ||
2153 completion_minlength != system_lyxrc.completion_minlength) {
2154 os << "\\completion_minlength " << convert<string>(completion_minlength)
2160 case RC_NUMLASTFILES:
2161 if (ignore_system_lyxrc ||
2162 num_lastfiles != system_lyxrc.num_lastfiles) {
2163 os << "\\num_lastfiles " << num_lastfiles << '\n';
2167 case RC_CHECKLASTFILES:
2168 if (ignore_system_lyxrc ||
2169 check_lastfiles != system_lyxrc.check_lastfiles) {
2170 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2175 case RC_EXAMPLEPATH:
2176 if (ignore_system_lyxrc ||
2177 example_path != system_lyxrc.example_path) {
2178 string const path = os::external_path(example_path);
2179 os << "\\example_path \"" << path << "\"\n";
2183 case RC_TEMPLATEPATH:
2184 if (ignore_system_lyxrc ||
2185 template_path != system_lyxrc.template_path) {
2186 string const path = os::external_path(template_path);
2187 os << "\\template_path \"" << path << "\"\n";
2191 case RC_TEMPDIRPATH:
2192 if (ignore_system_lyxrc ||
2193 tempdir_path != system_lyxrc.tempdir_path) {
2194 string const path = os::external_path(tempdir_path);
2195 os << "\\tempdir_path \"" << path << "\"\n";
2199 case RC_THESAURUSDIRPATH:
2200 if (ignore_system_lyxrc ||
2201 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2202 string const path = os::external_path(thesaurusdir_path);
2203 os << "\\thesaurusdir_path \"" << path << "\"\n";
2207 case RC_HUNSPELLDIR_PATH:
2208 if (ignore_system_lyxrc ||
2209 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2210 string const path = os::external_path(hunspelldir_path);
2211 os << "\\hunspelldir_path \"" << path << "\"\n";
2215 case RC_PLAINTEXT_LINELEN:
2216 if (ignore_system_lyxrc ||
2217 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2218 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2222 case RC_MAKE_BACKUP:
2223 if (ignore_system_lyxrc ||
2224 make_backup != system_lyxrc.make_backup) {
2225 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2229 case RC_SAVE_COMPRESSED:
2230 if (ignore_system_lyxrc ||
2231 save_compressed != system_lyxrc.save_compressed) {
2232 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2236 case RC_SAVE_ORIGIN:
2237 if (ignore_system_lyxrc ||
2238 save_origin != system_lyxrc.save_origin) {
2239 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2243 case RC_BACKUPDIR_PATH:
2244 if (ignore_system_lyxrc ||
2245 backupdir_path != system_lyxrc.backupdir_path) {
2246 string const path = os::external_path(backupdir_path);
2247 os << "\\backupdir_path \"" << path << "\"\n";
2253 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2257 << "# SPELLCHECKER SECTION ##############################\n"
2260 case RC_ACCEPT_COMPOUND:
2261 if (ignore_system_lyxrc ||
2262 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2263 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2269 if (ignore_system_lyxrc ||
2270 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2271 os << "\\alternate_language \"" << spellchecker_alt_lang
2277 if (ignore_system_lyxrc ||
2278 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2279 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2283 case RC_USE_SYSTEM_COLORS:
2284 if (ignore_system_lyxrc ||
2285 use_system_colors != system_lyxrc.use_system_colors) {
2286 os << "\\use_system_colors "
2287 << convert<string>(use_system_colors)
2292 case RC_USE_TOOLTIP:
2293 if (ignore_system_lyxrc ||
2294 use_tooltip != system_lyxrc.use_tooltip) {
2295 os << "\\use_tooltip "
2296 << convert<string>(use_tooltip)
2301 case RC_USE_PIXMAP_CACHE:
2302 if (ignore_system_lyxrc ||
2303 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2304 os << "\\use_pixmap_cache "
2305 << convert<string>(use_pixmap_cache)
2311 if (ignore_system_lyxrc ||
2312 use_qimage != system_lyxrc.use_qimage) {
2313 os << "\\use_qimage "
2314 << convert<string>(use_qimage)
2321 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2324 case RC_DEFAULT_DECIMAL_POINT:
2325 if (ignore_system_lyxrc ||
2326 default_decimal_point != system_lyxrc.default_decimal_point) {
2327 os << "\\default_decimal_point " << default_decimal_point << '\n';
2332 case RC_DEFAULT_LENGTH_UNIT:
2333 if (ignore_system_lyxrc ||
2334 default_length_unit != system_lyxrc.default_length_unit) {
2335 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2340 case RC_SPELLCHECKER:
2341 if (ignore_system_lyxrc ||
2342 spellchecker != system_lyxrc.spellchecker) {
2343 os << "\\spellchecker " << spellchecker << '\n';
2348 case RC_SPELLCHECK_CONTINUOUSLY:
2349 if (ignore_system_lyxrc ||
2350 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2351 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2357 case RC_SPELLCHECK_NOTES:
2358 if (ignore_system_lyxrc ||
2359 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2360 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2366 case RC_VISUAL_CURSOR:
2367 if (ignore_system_lyxrc ||
2368 visual_cursor != system_lyxrc.visual_cursor) {
2369 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2373 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2374 if (ignore_system_lyxrc ||
2375 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2376 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2377 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2381 case RC_LANGUAGE_CUSTOM_PACKAGE:
2382 if (ignore_system_lyxrc ||
2383 language_custom_package != system_lyxrc.language_custom_package) {
2384 os << "\\language_custom_package \"" << language_custom_package
2389 case RC_LANGUAGE_GLOBAL_OPTIONS:
2390 if (ignore_system_lyxrc ||
2391 language_global_options
2392 != system_lyxrc.language_global_options) {
2393 os << "\\language_global_options \""
2394 << convert<string>(language_global_options)
2399 case RC_LANGUAGE_PACKAGE_SELECTION:
2400 if (ignore_system_lyxrc ||
2401 language_package_selection != system_lyxrc.language_package_selection) {
2402 os << "\\language_package_selection ";
2403 switch (language_package_selection) {
2420 case RC_LANGUAGE_COMMAND_BEGIN:
2421 if (ignore_system_lyxrc ||
2422 language_command_begin
2423 != system_lyxrc.language_command_begin) {
2424 os << "\\language_command_begin \""
2425 << language_command_begin
2430 case RC_LANGUAGE_COMMAND_END:
2431 if (ignore_system_lyxrc ||
2432 language_command_end
2433 != system_lyxrc.language_command_end) {
2434 os << "\\language_command_end \"" << language_command_end
2439 case RC_LANGUAGE_COMMAND_LOCAL:
2440 if (ignore_system_lyxrc ||
2441 language_command_local
2442 != system_lyxrc.language_command_local) {
2443 os << "\\language_command_local \""
2444 << language_command_local
2449 case RC_LANGUAGE_AUTO_BEGIN:
2450 if (ignore_system_lyxrc ||
2451 language_auto_begin != system_lyxrc.language_auto_begin) {
2452 os << "\\language_auto_begin "
2453 << convert<string>(language_auto_begin) << '\n';
2457 case RC_LANGUAGE_AUTO_END:
2458 if (ignore_system_lyxrc ||
2459 language_auto_end != system_lyxrc.language_auto_end) {
2460 os << "\\language_auto_end "
2461 << convert<string>(language_auto_end) << '\n';
2465 case RC_MARK_FOREIGN_LANGUAGE:
2466 if (ignore_system_lyxrc ||
2467 mark_foreign_language
2468 != system_lyxrc.mark_foreign_language) {
2469 os << "\\mark_foreign_language " <<
2470 convert<string>(mark_foreign_language) << '\n';
2476 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2479 case RC_AUTO_NUMBER:
2480 if (ignore_system_lyxrc ||
2481 auto_number != system_lyxrc.auto_number) {
2482 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2486 case RC_GUI_LANGUAGE:
2487 if (ignore_system_lyxrc ||
2488 gui_language != system_lyxrc.gui_language) {
2489 os << "\\gui_language " << gui_language << '\n';
2493 case RC_EXPORT_OVERWRITE:
2494 if (ignore_system_lyxrc ||
2495 export_overwrite != system_lyxrc.export_overwrite) {
2497 switch (export_overwrite) {
2508 os << "\\export_overwrite " << status << '\n';
2513 case RC_SCROLL_WHEEL_ZOOM:
2514 if (ignore_system_lyxrc ||
2515 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2517 switch (scroll_wheel_zoom) {
2518 case SCROLL_WHEEL_ZOOM_OFF:
2521 case SCROLL_WHEEL_ZOOM_CTRL:
2524 case SCROLL_WHEEL_ZOOM_SHIFT:
2527 case SCROLL_WHEEL_ZOOM_ALT:
2531 os << "\\scroll_wheel_zoom " << status << '\n';
2537 << "# FORMATS SECTION ##########################\n"
2541 // New/modified formats
2542 for (Formats::const_iterator cit = formats.begin();
2543 cit != formats.end(); ++cit) {
2544 Format const * format =
2545 system_formats.getFormat(cit->name());
2547 format->extensions() != cit->extensions() ||
2548 format->prettyname() != cit->prettyname() ||
2549 format->shortcut() != cit->shortcut() ||
2550 format->viewer() != cit->viewer() ||
2551 format->editor() != cit->editor() ||
2552 format->documentFormat() != cit->documentFormat() ||
2553 format->vectorFormat() != cit->vectorFormat() ||
2554 format->inExportMenu() != cit->inExportMenu() ||
2555 format->mime() != cit->mime()) {
2556 os << "\\format \"" << cit->name() << "\" \""
2557 << cit->extensions() << "\" \""
2558 << to_utf8(cit->prettyname()) << "\" \""
2559 << cit->shortcut() << "\" \""
2560 << escapeCommand(cit->viewer()) << "\" \""
2561 << escapeCommand(cit->editor()) << "\" \"";
2562 vector<string> flags;
2563 if (cit->documentFormat())
2564 flags.push_back("document");
2565 if (cit->vectorFormat())
2566 flags.push_back("vector");
2567 if (cit->zippedNative())
2568 flags.push_back("zipped=native");
2569 if (cit->inExportMenu())
2570 flags.push_back("menu=export");
2572 os << getStringFromVector(flags);
2573 os << "\" \"" << cit->mime() << "\"\n";
2577 // Look for deleted formats
2578 for (Formats::const_iterator cit = system_formats.begin();
2579 cit != system_formats.end(); ++cit)
2580 if (!formats.getFormat(cit->name()))
2581 os << "\\format \"" << cit->name()
2582 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2585 case RC_VIEWER_ALTERNATIVES: {
2586 Alternatives::const_iterator it = viewer_alternatives.begin();
2587 Alternatives::const_iterator const en = viewer_alternatives.end();
2588 Alternatives::const_iterator const sysend =
2589 system_lyxrc.viewer_alternatives.end();
2590 for (; it != en; ++it) {
2591 string const & fmt = it->first;
2592 CommandSet const & cmd = it->second;
2593 CommandSet::const_iterator sit = cmd.begin();
2594 CommandSet::const_iterator const sen = cmd.end();
2595 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2596 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2597 system_lyxrc.viewer_alternatives.find(fmt);
2598 for (; sit != sen; ++sit) {
2599 string const & cmd = *sit;
2600 if (ignore_system_lyxrc
2601 || sysfmt == sysend // format not found
2602 || sysfmt->second.count(cmd) == 0 // this command not found
2604 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2610 case RC_EDITOR_ALTERNATIVES: {
2611 Alternatives::const_iterator it = editor_alternatives.begin();
2612 Alternatives::const_iterator const en = editor_alternatives.end();
2613 Alternatives::const_iterator const sysend =
2614 system_lyxrc.editor_alternatives.end();
2615 for (; it != en; ++it) {
2616 string const & fmt = it->first;
2617 CommandSet const & cmd = it->second;
2618 CommandSet::const_iterator sit = cmd.begin();
2619 CommandSet::const_iterator const sen = cmd.end();
2620 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2621 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2622 system_lyxrc.editor_alternatives.find(fmt);
2623 for (; sit != sen; ++sit) {
2624 string const & cmd = *sit;
2625 if (ignore_system_lyxrc
2626 || sysfmt == sysend // format not found
2627 || sysfmt->second.count(cmd) == 0 // this command not found
2629 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2635 case RC_DEFAULT_OTF_VIEW_FORMAT:
2636 if ((ignore_system_lyxrc ||
2637 default_otf_view_format != system_lyxrc.default_otf_view_format)
2638 && !default_otf_view_format.empty()) {
2639 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2643 case RC_DEFAULT_VIEW_FORMAT:
2644 if (ignore_system_lyxrc ||
2645 default_view_format != system_lyxrc.default_view_format) {
2646 os << "\\default_view_format " << default_view_format << '\n';
2656 << "# CONVERTERS SECTION ##########################\n"
2660 // Look for new converters
2661 for (Converters::const_iterator cit = theConverters().begin();
2662 cit != theConverters().end(); ++cit) {
2663 Converter const * converter =
2664 theSystemConverters().getConverter(cit->from(),
2667 converter->command() != cit->command() ||
2668 converter->flags() != cit->flags())
2669 os << "\\converter \"" << cit->from() << "\" \""
2670 << cit->to() << "\" \""
2671 << escapeCommand(cit->command()) << "\" \""
2672 << cit->flags() << "\"\n";
2675 // New/modifed converters
2676 for (Converters::const_iterator cit = theSystemConverters().begin();
2677 cit != theSystemConverters().end(); ++cit)
2678 if (!theConverters().getConverter(cit->from(), cit->to()))
2679 os << "\\converter \"" << cit->from()
2680 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2687 << "# COPIERS SECTION ##########################\n"
2690 // Look for new movers
2691 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2692 Movers::const_iterator const sysend = theSystemMovers().end();
2693 Movers::const_iterator it = theMovers().begin();
2694 Movers::const_iterator end = theMovers().end();
2696 for (; it != end; ++it) {
2697 Movers::const_iterator const sysit =
2698 find_if(sysbegin, sysend, SameMover(*it));
2699 if (sysit == sysend) {
2700 string const & fmt = it->first;
2701 string const & command =
2702 it->second.command();
2704 os << "\\copier " << fmt
2705 << " \"" << escapeCommand(command) << "\"\n";
2711 // We don't actually delete SpecialisedMover(s) from the
2712 // map, just clear their 'command', so there's no need
2713 // to test for anything else.
2720 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2722 // Why the switch you might ask. It is a trick to ensure that all
2723 // the elements in the LyXRCTags enum is handled. As you can see
2724 // there are no breaks at all. So it is just a huge fall-through.
2725 // The nice thing is that we will get a warning from the compiler
2726 // if we forget an element.
2727 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2729 case LyXRC::RC_LAST:
2730 case LyXRC::RC_ACCEPT_COMPOUND:
2731 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2732 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2734 case LyXRC::RC_ALT_LANG:
2735 case LyXRC::RC_PLAINTEXT_LINELEN:
2736 case LyXRC::RC_AUTOCORRECTION_MATH:
2737 case LyXRC::RC_AUTOREGIONDELETE:
2738 case LyXRC::RC_AUTORESET_OPTIONS:
2739 case LyXRC::RC_AUTOSAVE:
2740 case LyXRC::RC_AUTO_NUMBER:
2741 case LyXRC::RC_BACKUPDIR_PATH:
2742 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2743 case LyXRC::RC_BIBTEX_COMMAND:
2744 case LyXRC::RC_BINDFILE:
2745 case LyXRC::RC_CHECKLASTFILES:
2746 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2747 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2748 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2749 case LyXRC::RC_COMPLETION_INLINE_MATH:
2750 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2751 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2752 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2753 case LyXRC::RC_COMPLETION_POPUP_MATH:
2754 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2755 case LyXRC::RC_COMPLETION_MINLENGTH:
2756 case LyXRC::RC_USELASTFILEPOS:
2757 case LyXRC::RC_LOADSESSION:
2758 case LyXRC::RC_CHKTEX_COMMAND:
2759 case LyXRC::RC_CONVERTER:
2760 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2761 case LyXRC::RC_COPIER:
2762 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2763 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2764 case LyXRC::RC_DATE_INSERT_FORMAT:
2765 case LyXRC::RC_GUI_LANGUAGE:
2766 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2767 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2768 case LyXRC::RC_DEFFILE:
2769 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2770 case LyXRC::RC_DISPLAY_GRAPHICS:
2771 case LyXRC::RC_DOCUMENTPATH:
2772 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2773 FileName path(lyxrc_new.document_path);
2774 if (path.exists() && path.isDirectory())
2775 package().document_dir() = FileName(lyxrc.document_path);
2778 case LyXRC::RC_EDITOR_ALTERNATIVES:
2779 case LyXRC::RC_ESC_CHARS:
2780 case LyXRC::RC_EXAMPLEPATH:
2781 case LyXRC::RC_FONT_ENCODING:
2782 case LyXRC::RC_FILEFORMAT:
2783 case LyXRC::RC_GROUP_LAYOUTS:
2784 case LyXRC::RC_HUNSPELLDIR_PATH:
2785 case LyXRC::RC_ICON_SET:
2786 case LyXRC::RC_INDEX_ALTERNATIVES:
2787 case LyXRC::RC_INDEX_COMMAND:
2788 case LyXRC::RC_JBIBTEX_COMMAND:
2789 case LyXRC::RC_JINDEX_COMMAND:
2790 case LyXRC::RC_NOMENCL_COMMAND:
2791 case LyXRC::RC_INPUT:
2792 case LyXRC::RC_KBMAP:
2793 case LyXRC::RC_KBMAP_PRIMARY:
2794 case LyXRC::RC_KBMAP_SECONDARY:
2795 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2796 case LyXRC::RC_LANGUAGE_AUTO_END:
2797 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2798 case LyXRC::RC_LANGUAGE_COMMAND_END:
2799 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2800 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2801 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2802 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2803 case LyXRC::RC_LYXRCFORMAT:
2804 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2805 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2806 case LyXRC::RC_MACRO_EDIT_STYLE:
2807 case LyXRC::RC_MAKE_BACKUP:
2808 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2809 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2810 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2811 case LyXRC::RC_NUMLASTFILES:
2812 case LyXRC::RC_PARAGRAPH_MARKERS:
2813 case LyXRC::RC_PATH_PREFIX:
2814 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2815 prependEnvPath("PATH", lyxrc_new.path_prefix);
2816 // Resets python path
2817 support::os::python(true);
2820 case LyXRC::RC_PREVIEW:
2821 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2822 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2823 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2824 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2825 case LyXRC::RC_PRINTPAPERFLAG:
2826 case LyXRC::RC_SAVE_COMPRESSED:
2827 case LyXRC::RC_SAVE_ORIGIN:
2828 case LyXRC::RC_SCREEN_DPI:
2829 case LyXRC::RC_SCREEN_FONT_ROMAN:
2830 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2831 case LyXRC::RC_SCREEN_FONT_SANS:
2832 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2833 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2834 case LyXRC::RC_SCREEN_FONT_SIZES:
2835 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2836 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2837 case LyXRC::RC_GEOMETRY_SESSION:
2838 case LyXRC::RC_SCREEN_ZOOM:
2839 case LyXRC::RC_SERVERPIPE:
2840 case LyXRC::RC_SET_COLOR:
2841 case LyXRC::RC_SHOW_BANNER:
2842 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2843 case LyXRC::RC_SPELLCHECKER:
2844 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2847 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2848 case LyXRC::RC_SPELLCHECK_NOTES:
2849 case LyXRC::RC_SPLITINDEX_COMMAND:
2850 case LyXRC::RC_TEMPDIRPATH:
2851 case LyXRC::RC_TEMPLATEPATH:
2852 case LyXRC::RC_TEX_ALLOWS_SPACES:
2853 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2854 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2855 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2858 case LyXRC::RC_TEXINPUTS_PREFIX:
2859 case LyXRC::RC_THESAURUSDIRPATH:
2860 case LyXRC::RC_UIFILE:
2861 case LyXRC::RC_USER_EMAIL:
2862 case LyXRC::RC_USER_NAME:
2863 case LyXRC::RC_USE_CONVERTER_CACHE:
2864 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2865 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2866 case LyXRC::RC_USE_SYSTEM_COLORS:
2867 case LyXRC::RC_USE_TOOLTIP:
2868 case LyXRC::RC_USE_PIXMAP_CACHE:
2869 case LyXRC::RC_USE_QIMAGE:
2870 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2871 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2872 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2873 case LyXRC::RC_SINGLE_INSTANCE:
2874 case LyXRC::RC_SORT_LAYOUTS:
2875 case LyXRC::RC_FULL_SCREEN_LIMIT:
2876 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2877 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2878 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2879 case LyXRC::RC_FULL_SCREEN_TABBAR:
2880 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2881 case LyXRC::RC_FULL_SCREEN_WIDTH:
2882 case LyXRC::RC_VISUAL_CURSOR:
2883 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2884 case LyXRC::RC_VIEWER:
2885 case LyXRC::RC_VIEWER_ALTERNATIVES:
2886 case LyXRC::RC_FORWARD_SEARCH_DVI:
2887 case LyXRC::RC_FORWARD_SEARCH_PDF:
2888 case LyXRC::RC_EXPORT_OVERWRITE:
2889 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2890 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2891 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2892 case LyXRC::RC_CURSOR_WIDTH:
2899 string const LyXRC::getDescription(LyXRCTags tag)
2904 case RC_ACCEPT_COMPOUND:
2905 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2909 str = _("Specify an alternate language. The default is to use the language of the document.");
2912 case RC_PLAINTEXT_LINELEN:
2913 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.");
2916 case RC_AUTOREGIONDELETE:
2917 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2920 case RC_AUTORESET_OPTIONS:
2921 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2925 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2928 case RC_AUTO_NUMBER:
2931 case RC_BACKUPDIR_PATH:
2932 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.");
2935 case RC_BIBTEX_COMMAND:
2936 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2939 case RC_JBIBTEX_COMMAND:
2940 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2944 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2947 case RC_CHECKLASTFILES:
2948 str = _("Select to check whether the lastfiles still exist.");
2951 case RC_CHKTEX_COMMAND:
2952 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2958 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
2959 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
2962 case RC_CONVERTER_NEEDAUTH:
2963 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
2969 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2970 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.");
2973 case RC_CURSOR_WIDTH:
2974 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2977 case RC_SCROLL_BELOW_DOCUMENT:
2978 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");
2981 case RC_MAC_DONTSWAP_CTRL_META:
2982 str = _("Make Apple key act as Meta and Control key as Ctrl.");
2985 case RC_MAC_LIKE_CURSOR_MOVEMENT:
2986 str = _("Use the Mac OS X conventions for cursor movement");
2989 case RC_SHOW_MACRO_LABEL:
2990 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2993 case RC_DATE_INSERT_FORMAT:
2994 //xgettext:no-c-format
2995 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2999 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3002 case RC_DEFAULT_OTF_VIEW_FORMAT:
3003 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3006 case RC_DEFAULT_VIEW_FORMAT:
3007 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3010 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3011 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3014 case RC_DISPLAY_GRAPHICS:
3015 str = _("Select how LyX will display any graphics.");
3018 case RC_DOCUMENTPATH:
3019 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3023 str = _("Specify additional chars that can be part of a word.");
3026 case RC_EXAMPLEPATH:
3027 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3030 case RC_FONT_ENCODING:
3031 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3037 case RC_INDEX_COMMAND:
3038 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\".");
3041 case RC_JINDEX_COMMAND:
3042 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3045 case RC_NOMENCL_COMMAND:
3046 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3053 case RC_KBMAP_PRIMARY:
3054 case RC_KBMAP_SECONDARY:
3055 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.");
3058 case RC_LANGUAGE_AUTO_BEGIN:
3059 str = _("Select if a language switching command is needed at the beginning of the document.");
3062 case RC_LANGUAGE_AUTO_END:
3063 str = _("Select if a language switching command is needed at the end of the document.");
3066 case RC_LANGUAGE_COMMAND_BEGIN:
3067 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.");
3070 case RC_LANGUAGE_COMMAND_END:
3071 str = _("The LaTeX command for changing back to the language of the document.");
3074 case RC_LANGUAGE_COMMAND_LOCAL:
3075 str = _("The LaTeX command for local changing of the language.");
3078 case RC_LANGUAGE_GLOBAL_OPTIONS:
3079 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3082 case RC_LANGUAGE_CUSTOM_PACKAGE:
3083 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3086 case RC_LANGUAGE_PACKAGE_SELECTION:
3087 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3090 case RC_USELASTFILEPOS:
3091 str = _("De-select if you do not want LyX to scroll to saved position.");
3094 case RC_LOADSESSION:
3095 str = _("De-select to prevent loading files opened from the last LyX session.");
3098 case RC_MAKE_BACKUP:
3099 str = _("De-select if you don't want LyX to create backup files.");
3102 case RC_MARK_FOREIGN_LANGUAGE:
3103 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3106 case RC_MOUSE_WHEEL_SPEED:
3107 str = _("The scrolling speed of the mouse wheel.");
3110 case RC_COMPLETION_POPUP_DELAY:
3111 str = _("The completion popup delay.");
3114 case RC_COMPLETION_POPUP_MATH:
3115 str = _("Select to display the completion popup in math mode.");
3118 case RC_COMPLETION_POPUP_TEXT:
3119 str = _("Select to display the completion popup in text mode.");
3122 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3123 str = _("Show the completion popup without delay after non-unique completion attempt.");
3126 case RC_COMPLETION_POPUP_TEXT:
3127 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3130 case RC_COMPLETION_POPUP_DELAY:
3131 str = _("The inline completion delay.");
3134 case RC_COMPLETION_INLINE_MATH:
3135 str = _("Select to display the inline completion in math mode.");
3138 case RC_COMPLETION_INLINE_TEXT:
3139 str = _("Select to display the inline completion in text mode.");
3142 case RC_COMPLETION_INLINE_DOTS:
3143 str = _("Use \"...\" to shorten long completions.");
3146 case RC_AUTOCORRECTION_MATH:
3147 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3150 case RC_NUMLASTFILES:
3151 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3155 case RC_PATH_PREFIX:
3156 str = _("Specify those directories which should be "
3157 "prepended to the PATH environment variable.\n"
3158 "Use the OS native format.");
3162 str = _("Shows a typeset preview of things such as math");
3165 case RC_PREVIEW_HASHED_LABELS:
3166 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3169 case RC_PREVIEW_SCALE_FACTOR:
3170 str = _("Scale the preview size to suit.");
3173 case RC_PRINTLANDSCAPEFLAG:
3174 str = _("The option to print out in landscape.");
3177 case RC_PRINTPAPERDIMENSIONFLAG:
3178 str = _("Option to specify the dimensions of the print paper.");
3181 case RC_PRINTPAPERFLAG:
3182 str = _("The option to specify paper type.");
3185 case RC_VISUAL_CURSOR:
3186 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3189 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3190 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).");
3194 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3197 case RC_SCREEN_FONT_ROMAN:
3198 case RC_SCREEN_FONT_SANS:
3199 case RC_SCREEN_FONT_TYPEWRITER:
3200 str = _("The screen fonts used to display the text while editing.");
3203 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3204 case RC_SCREEN_FONT_SANS_FOUNDRY:
3205 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3208 case RC_SCREEN_FONT_SCALABLE:
3209 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.");
3212 case RC_SCREEN_FONT_SIZES:
3213 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3216 case RC_SCREEN_ZOOM:
3217 //xgettext:no-c-format
3218 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3221 case RC_GEOMETRY_SESSION:
3222 str = _("Allow session manager to save and restore windows geometry.");
3226 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3232 case RC_SHOW_BANNER:
3233 str = _("De-select if you don't want the startup banner.");
3236 case RC_TEMPDIRPATH:
3237 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3240 case RC_THESAURUSDIRPATH:
3241 str = _("This is the place where the files of the thesaurus library reside.");
3244 case RC_TEMPLATEPATH:
3245 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3248 case RC_TEX_ALLOWS_SPACES:
3251 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3254 case RC_TEXINPUTS_PREFIX:
3255 str = _("Specify those directories which should be "
3256 "prepended to the TEXINPUTS environment variable.\n"
3257 "A '.' represents the current document directory. "
3258 "Use the OS native format.");
3262 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3271 case RC_USE_USE_SYSTEM_COLORS:
3272 str = _("Enable use the system colors for some things like main window background and selection.");
3275 case RC_USE_TOOLTIP:
3276 str = _("Enable the automatic appearance of tool tips in the work area.");
3279 case RC_USE_PIXMAP_CACHE:
3280 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3283 case RC_VIEWDVI_PAPEROPTION:
3284 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3299 // The global instance
3302 // The global copy of the system lyxrc entries (everything except preferences)