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.
22 #include "Converter.h"
23 #include "FontEnums.h"
29 #include "SpellChecker.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/FileName.h"
38 #include "support/filetools.h"
39 #include "support/gettext.h"
40 #include "support/lstrings.h"
41 #include "support/os.h"
42 #include "support/Package.h"
43 #include "support/TempFile.h"
44 #include "support/userinfo.h"
51 using namespace lyx::support;
55 namespace os = support::os;
59 // The format should also be updated in configure.py, and conversion code
60 // should be added to prefs2prefs_prefs.py.
61 static unsigned int const LYXRC_FILEFORMAT = 19; // rgh: remove print support
63 // when adding something to this array keep it sorted!
64 LexerKeyword lyxrcTags[] = {
65 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
66 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
67 { "\\alternate_language", LyXRC::RC_ALT_LANG },
68 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
69 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
70 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
71 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
72 { "\\autosave", LyXRC::RC_AUTOSAVE },
73 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
74 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
75 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
76 { "\\bind_file", LyXRC::RC_BINDFILE },
77 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
78 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
79 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
80 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
81 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
82 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
83 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
84 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
85 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
86 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
87 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
88 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
89 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
90 { "\\converter", LyXRC::RC_CONVERTER },
91 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
92 { "\\copier", LyXRC::RC_COPIER },
93 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
94 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
95 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
96 { "\\def_file", LyXRC::RC_DEFFILE },
97 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
98 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
99 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
100 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
101 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
102 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
103 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
104 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
105 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
106 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
107 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
108 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
109 { "\\format", LyXRC::RC_FILEFORMAT },
110 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
111 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
112 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
113 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
114 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
115 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
116 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
117 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
118 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
119 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
120 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
121 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
122 { "\\icon_set", LyXRC::RC_ICON_SET },
123 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
124 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
125 { "\\input", LyXRC::RC_INPUT },
126 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
127 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
128 { "\\kbmap", LyXRC::RC_KBMAP },
129 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
130 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
131 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
132 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
133 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
134 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
135 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
136 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
137 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
138 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
139 { "\\load_session", LyXRC::RC_LOADSESSION },
140 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
141 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
142 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
143 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
144 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
145 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
146 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
147 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
148 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
149 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
150 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
151 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
152 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
153 { "\\preview", LyXRC::RC_PREVIEW },
154 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
155 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
156 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
157 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
158 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
159 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
160 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
161 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
162 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
163 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
164 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
165 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
166 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
167 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
168 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
169 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
170 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
171 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
172 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
173 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
174 { "\\set_color", LyXRC::RC_SET_COLOR },
175 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
176 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
177 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
178 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
179 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
180 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
181 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
182 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
183 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
184 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
185 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
186 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
187 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
188 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
189 { "\\ui_file", LyXRC::RC_UIFILE },
190 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
191 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
192 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
193 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
194 // compatibility with versions older than 1.4.0 only
195 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
196 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
197 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
198 { "\\user_email", LyXRC::RC_USER_EMAIL },
199 { "\\user_name", LyXRC::RC_USER_NAME },
200 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
201 // compatibility with versions older than 1.4.0 only
202 { "\\viewer", LyXRC::RC_VIEWER},
203 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
204 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
205 { "format", LyXRC::RC_LYXRCFORMAT }
208 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
219 void LyXRC::setDefaults()
222 use_system_theme_icons = false;
224 def_file = "default";
226 // The current document directory
227 texinputs_prefix = ".";
228 print_landscape_flag = "-t landscape";
229 print_paper_flag = "-t";
230 print_paper_dimension_flag = "-T";
231 document_path.erase();
232 view_dvi_paper_option.erase();
233 default_view_format = "pdf2";
234 default_otf_view_format = "pdf4";
235 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
236 bibtex_command = "bibtex";
238 index_command = "makeindex -c -q";
239 nomencl_command = "makeindex -s nomencl.ist";
241 // Because a screen is typically wider than a piece of paper:
243 allow_geometry_session = true;
244 // Default LaTeX font size:
245 font_sizes[FONT_SIZE_TINY] = "5.0";
246 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
247 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
248 font_sizes[FONT_SIZE_SMALL] = "9.0";
249 font_sizes[FONT_SIZE_NORMAL] = "10.0";
250 font_sizes[FONT_SIZE_LARGE] = "12.0";
251 font_sizes[FONT_SIZE_LARGER] = "14.4";
252 font_sizes[FONT_SIZE_LARGEST] = "17.26";
253 font_sizes[FONT_SIZE_HUGE] = "20.74";
254 font_sizes[FONT_SIZE_HUGER] = "24.88";
255 use_scalable_fonts = true;
256 roman_font_name = "";
258 typewriter_font_name = "";
260 auto_region_delete = true;
261 auto_reset_options = false;
262 plaintext_linelen = 65;
263 mouse_wheel_speed = 1.0;
264 num_lastfiles = maxlastfiles;
265 check_lastfiles = true;
266 use_lastfilepos = true;
267 load_session = false;
269 save_compressed = false;
271 backupdir_path.erase();
272 display_graphics = true;
273 // Spellchecker settings:
274 // FIXME: this check should test the target platform (darwin)
275 #if defined(USE_MACOSX_PACKAGING)
276 spellchecker = "native";
277 #elif defined(USE_ASPELL)
278 spellchecker = "aspell";
279 #elif defined(USE_HUNSPELL)
280 spellchecker = "hunspell";
282 spellchecker = "aspell";
284 spellchecker_accept_compound = false;
285 spellcheck_continuously = false;
286 completion_minlength = 6;
287 spellcheck_notes = true;
289 visual_cursor = false;
291 mark_foreign_language = true;
292 language_auto_begin = true;
293 language_auto_end = true;
294 language_global_options = true;
295 language_package_selection = LP_AUTO;
296 language_custom_package = "\\usepackage{babel}";
297 language_command_begin = "\\selectlanguage{$$lang}";
298 language_command_local = "\\foreignlanguage{$$lang}{";
299 sort_layouts = false;
300 group_layouts = true;
301 gui_language = "auto";
303 windows_style_tex_paths = false;
304 tex_allows_spaces = false;
305 date_insert_format = "%x";
306 cursor_follows_scrollbar = false;
307 scroll_below_document = false;
308 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
309 paragraph_markers = false;
310 mac_dontswap_ctrl_meta = false;
311 mac_like_cursor_movement = false;
312 macro_edit_style = MACRO_EDIT_INLINE_BOX;
313 dialogs_iconify_with_main = false;
314 preview = PREVIEW_OFF;
315 preview_hashed_labels = false;
316 preview_scale_factor = 1.0;
317 use_converter_cache = true;
318 use_system_colors = false;
320 use_pixmap_cache = false;
322 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
323 user_name = to_utf8(support::user_name());
324 user_email = to_utf8(support::user_email());
325 open_buffers_in_tabs = true;
326 single_close_tab_button = false;
327 single_instance = true;
328 forward_search_dvi = string();
329 forward_search_pdf = string();
330 export_overwrite = NO_FILES;
332 // Fullscreen settings
333 full_screen_limit = false;
334 full_screen_toolbars = true;
335 full_screen_tabbar = true;
336 full_screen_menubar = true;
337 full_screen_scrollbar = true;
338 full_screen_width = 700;
340 completion_cursor_text = true;
341 completion_popup_math = true;
342 completion_popup_text = false;
343 completion_popup_delay = 2.0;
344 completion_popup_after_complete = true;
345 autocorrection_math = false;
346 completion_inline_math = true;
347 completion_inline_text = false;
348 completion_inline_dots = -1;
349 completion_inline_delay = 0.2;
350 default_decimal_point = ".";
351 default_length_unit = Length::CM;
353 close_buffer_with_last_view = "yes";
354 mouse_middlebutton_paste = true;
360 void oldFontFormat(string & family, string & foundry)
362 if (family.empty() || family[0] != '-')
364 foundry = token(family, '-', 1);
365 family = token(family, '-', 2);
373 bool LyXRC::read(FileName const & filename, bool check_format)
375 Lexer lexrc(lyxrcTags);
376 lexrc.setFile(filename);
377 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
378 ReturnValues retval = read(lexrc, check_format);
379 if (!check_format || retval != FormatMismatch)
380 return retval == ReadOK;
382 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
383 TempFile tmp("convert_lyxrc");
384 FileName const tempfile = tmp.name();
385 bool const success = prefs2prefs(filename, tempfile, false);
387 LYXERR0 ("Unable to convert " << filename.absFileName() <<
388 " to format " << LYXRC_FILEFORMAT);
391 // Keep this in the else branch, such that lexrc2 goes out
392 // of scope and releases the lock on tempfile before we
393 // attempt to remove it. This matters on Windows.
394 Lexer lexrc2(lyxrcTags);
395 lexrc2.setFile(tempfile);
396 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
397 retval = read(lexrc2, check_format);
399 return retval == ReadOK;
403 // don't need to worry about conversion, because this is always
404 // from an internal source
405 bool LyXRC::read(istream & is)
407 Lexer lexrc(lyxrcTags);
409 LYXERR(Debug::LYXRC, "Reading istream...");
410 return read(lexrc, false) == ReadOK;
414 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
416 if (lyxerr.debugging(Debug::PARSER))
417 lexrc.printTable(lyxerr);
422 // format prior to 2.0 and introduction of format tag
423 unsigned int format = 0;
425 while (lexrc.isOK()) {
426 // By using two switches we take advantage of the compiler
427 // telling us if we have missed a LyXRCTags element in
428 // the second switch.
429 // Note that this also shows a problem with Lexer since it
430 // helps us avoid taking advantage of the strictness of the
433 int le = lexrc.lex();
435 case Lexer::LEX_UNDEF:
436 lexrc.printError("Unknown tag `$$Token'");
438 case Lexer::LEX_FEOF:
443 switch (static_cast<LyXRCTags>(le)) {
446 format = lexrc.getInteger();
448 case RC_INPUT: // Include file
451 libFileSearch(string(),
453 if (read(tmp, check_format)) {
455 "Error reading included file: " + tmp.absFileName());
461 bind_file = os::internal_path(lexrc.getString());
466 def_file = os::internal_path(lexrc.getString());
471 ui_file = os::internal_path(lexrc.getString());
474 case RC_AUTORESET_OPTIONS:
475 lexrc >> auto_reset_options;
478 case RC_DISPLAY_GRAPHICS:
480 display_graphics = lexrc.getString() == "true";
483 case RC_TEX_EXPECTS_WINDOWS_PATHS:
484 lexrc >> windows_style_tex_paths;
487 case RC_TEX_ALLOWS_SPACES:
488 lexrc >> tex_allows_spaces;
491 case RC_TEXINPUTS_PREFIX:
492 lexrc >> texinputs_prefix;
499 case RC_KBMAP_PRIMARY:
501 string const kmap(os::internal_path(lexrc.getString()));
502 if (!libFileSearch("kbd", kmap, "kmap").empty()
504 primary_kbmap = kmap;
506 lexrc.printError("LyX: Keymap `$$Token' not found");
511 case RC_KBMAP_SECONDARY:
513 string const kmap(os::internal_path(lexrc.getString()));
514 if (!libFileSearch("kbd", kmap, "kmap").empty()
516 secondary_kbmap = kmap;
518 lexrc.printError("LyX: Keymap `$$Token' not found");
523 case RC_FONT_ENCODING:
527 case RC_PRINTLANDSCAPEFLAG:
528 lexrc >> print_landscape_flag;
531 case RC_PRINTPAPERDIMENSIONFLAG:
532 lexrc >> print_paper_dimension_flag;
535 case RC_PRINTPAPERFLAG:
536 lexrc >> print_paper_flag;
539 case RC_VIEWDVI_PAPEROPTION:
541 view_dvi_paper_option = lexrc.getString();
543 view_dvi_paper_option.erase();
546 case RC_CHKTEX_COMMAND:
547 if (lexrc.next(true)) {
548 chktex_command = lexrc.getString();
552 case RC_BIBTEX_ALTERNATIVES:
553 if (lexrc.next(true)) {
554 bibtex_alternatives.insert(lexrc.getString());
558 case RC_BIBTEX_COMMAND:
559 if (lexrc.next(true)) {
560 bibtex_command = lexrc.getString();
564 case RC_JBIBTEX_COMMAND:
565 if (lexrc.next(true)) {
566 jbibtex_command = lexrc.getString();
570 case RC_INDEX_ALTERNATIVES:
571 if (lexrc.next(true)) {
572 index_alternatives.insert(lexrc.getString());
576 case RC_INDEX_COMMAND:
577 if (lexrc.next(true)) {
578 index_command = lexrc.getString();
582 case RC_JINDEX_COMMAND:
583 if (lexrc.next(true)) {
584 jindex_command = lexrc.getString();
588 case RC_SPLITINDEX_COMMAND:
589 if (lexrc.next(true)) {
590 splitindex_command = lexrc.getString();
594 case RC_NOMENCL_COMMAND:
595 if (lexrc.next(true)) {
596 nomencl_command = lexrc.getString();
608 case RC_GEOMETRY_SESSION:
609 lexrc >> allow_geometry_session;
612 case RC_SCREEN_FONT_SIZES:
613 lexrc >> font_sizes[FONT_SIZE_TINY];
614 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
615 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
616 lexrc >> font_sizes[FONT_SIZE_SMALL];
617 lexrc >> font_sizes[FONT_SIZE_NORMAL];
618 lexrc >> font_sizes[FONT_SIZE_LARGE];
619 lexrc >> font_sizes[FONT_SIZE_LARGER];
620 lexrc >> font_sizes[FONT_SIZE_LARGEST];
621 lexrc >> font_sizes[FONT_SIZE_HUGE];
622 lexrc >> font_sizes[FONT_SIZE_HUGER];
625 case RC_SCREEN_FONT_SCALABLE:
626 lexrc >> use_scalable_fonts;
633 case RC_DOCUMENTPATH:
635 document_path = os::internal_path(lexrc.getString());
636 document_path = expandPath(document_path);
642 example_path = os::internal_path(lexrc.getString());
643 example_path = expandPath(example_path);
647 case RC_TEMPLATEPATH:
649 template_path = os::internal_path(lexrc.getString());
650 template_path = expandPath(template_path);
656 tempdir_path = os::internal_path(lexrc.getString());
657 tempdir_path = expandPath(tempdir_path);
661 case RC_THESAURUSDIRPATH:
663 thesaurusdir_path = os::internal_path(lexrc.getString());
664 thesaurusdir_path = expandPath(thesaurusdir_path);
668 case RC_HUNSPELLDIR_PATH:
670 hunspelldir_path = os::internal_path(lexrc.getString());
671 hunspelldir_path = expandPath(hunspelldir_path);
675 case RC_USELASTFILEPOS:
676 lexrc >> use_lastfilepos;
680 lexrc >> load_session;
683 case RC_MOUSE_WHEEL_SPEED:
684 lexrc >> mouse_wheel_speed;
687 case RC_COMPLETION_INLINE_DELAY:
688 lexrc >> completion_inline_delay;
691 case RC_COMPLETION_INLINE_MATH:
692 lexrc >> completion_inline_math;
695 case RC_COMPLETION_INLINE_TEXT:
696 lexrc >> completion_inline_text;
699 case RC_COMPLETION_INLINE_DOTS:
700 lexrc >> completion_inline_dots;
703 case RC_AUTOCORRECTION_MATH:
704 lexrc >> autocorrection_math;
707 case RC_COMPLETION_POPUP_DELAY:
708 lexrc >> completion_popup_delay;
711 case RC_COMPLETION_POPUP_MATH:
712 lexrc >> completion_popup_math;
715 case RC_COMPLETION_POPUP_TEXT:
716 lexrc >> completion_popup_text;
719 case RC_COMPLETION_CURSOR_TEXT:
720 lexrc >> completion_cursor_text;
723 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
724 lexrc >> completion_popup_after_complete;
727 case RC_COMPLETION_MINLENGTH:
728 lexrc >> completion_minlength;
731 case RC_NUMLASTFILES:
732 lexrc >> num_lastfiles;
735 case RC_CHECKLASTFILES:
736 lexrc >> check_lastfiles;
743 case RC_USE_SYSTEM_THEME_ICONS:
744 lexrc >> use_system_theme_icons;
747 case RC_SCREEN_FONT_ROMAN:
749 roman_font_name = lexrc.getString();
750 oldFontFormat(roman_font_name,
755 case RC_SCREEN_FONT_SANS:
757 sans_font_name = lexrc.getString();
758 oldFontFormat(sans_font_name, sans_font_foundry);
762 case RC_SCREEN_FONT_TYPEWRITER:
764 typewriter_font_name = lexrc.getString();
765 oldFontFormat(typewriter_font_name,
766 typewriter_font_foundry);
770 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
771 lexrc >> roman_font_foundry;
774 case RC_SCREEN_FONT_SANS_FOUNDRY:
775 lexrc >> sans_font_foundry;
778 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
779 lexrc >> typewriter_font_foundry;
784 lexrc.printError("Missing color tag.");
787 string lyx_name = lexrc.getString();
790 lexrc.printError("Missing color name for color: `$$Token'");
793 string x11_name = lexrc.getString();
795 ColorCode const col =
796 lcolor.getFromLyXName(lyx_name);
797 if (col == Color_none ||
798 col == Color_inherit ||
802 if (!lcolor.setColor(col, x11_name))
803 LYXERR0("Bad lyxrc set_color for " << lyx_name);
807 case RC_AUTOREGIONDELETE:
808 // Auto region delete defaults to true
809 lexrc >> auto_region_delete;
814 lyxpipes = os::internal_path(lexrc.getString());
815 lyxpipes = expandPath(lyxpipes);
819 case RC_CURSOR_FOLLOWS_SCROLLBAR:
820 lexrc >> cursor_follows_scrollbar;
823 case RC_CURSOR_WIDTH:
824 lexrc >> cursor_width;
827 case RC_SCROLL_BELOW_DOCUMENT:
828 lexrc >> scroll_below_document;
831 case RC_PARAGRAPH_MARKERS:
832 lexrc >> paragraph_markers;
835 case RC_MAC_DONTSWAP_CTRL_META:
836 lexrc >> mac_dontswap_ctrl_meta;
839 case RC_MAC_LIKE_CURSOR_MOVEMENT:
840 lexrc >> mac_like_cursor_movement;
843 case RC_MACRO_EDIT_STYLE:
845 switch (lexrc.getInteger()) {
846 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
847 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
848 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
853 case RC_DIALOGS_ICONIFY_WITH_MAIN:
854 lexrc >> dialogs_iconify_with_main;
857 case RC_PLAINTEXT_LINELEN:
858 lexrc >> plaintext_linelen;
860 // Spellchecker settings:
861 case RC_ACCEPT_COMPOUND:
862 lexrc >> spellchecker_accept_compound;
864 case RC_USE_SYSTEM_COLORS:
865 lexrc >> use_system_colors;
868 lexrc >> use_tooltip;
870 case RC_USE_PIXMAP_CACHE:
871 lexrc >> use_pixmap_cache;
876 case RC_SPELLCHECKER:
877 lexrc >> spellchecker;
880 lexrc >> spellchecker_alt_lang;
883 lexrc >> spellchecker_esc_chars;
885 case RC_SPELLCHECK_CONTINUOUSLY:
886 lexrc >> spellcheck_continuously;
888 case RC_SPELLCHECK_NOTES:
889 lexrc >> spellcheck_notes;
892 lexrc >> make_backup;
894 case RC_SAVE_COMPRESSED:
895 lexrc >> save_compressed;
898 lexrc >> save_origin;
900 case RC_BACKUPDIR_PATH:
902 backupdir_path = os::internal_path(lexrc.getString());
903 backupdir_path = expandPath(backupdir_path);
906 case RC_DEFAULT_DECIMAL_POINT:
907 lexrc >> default_decimal_point;
909 case RC_DEFAULT_LENGTH_UNIT:
911 default_length_unit = (Length::UNIT) lexrc.getInteger();
913 case RC_DATE_INSERT_FORMAT:
914 lexrc >> date_insert_format;
916 case RC_LANGUAGE_CUSTOM_PACKAGE:
917 lexrc >> language_custom_package;
919 case RC_LANGUAGE_AUTO_BEGIN:
920 lexrc >> language_auto_begin;
922 case RC_LANGUAGE_AUTO_END:
923 lexrc >> language_auto_end;
925 case RC_LANGUAGE_GLOBAL_OPTIONS:
926 lexrc >> language_global_options;
928 case RC_LANGUAGE_PACKAGE_SELECTION:
930 switch (lexrc.getInteger()) {
932 language_package_selection = LP_AUTO;
935 language_package_selection = LP_BABEL;
938 language_package_selection = LP_CUSTOM;
941 language_package_selection = LP_NONE;
946 case RC_LANGUAGE_COMMAND_BEGIN:
947 lexrc >> language_command_begin;
949 case RC_LANGUAGE_COMMAND_END:
950 lexrc >> language_command_end;
952 case RC_LANGUAGE_COMMAND_LOCAL:
953 lexrc >> language_command_local;
955 case RC_VISUAL_CURSOR:
956 lexrc >> visual_cursor;
958 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
959 lexrc >> close_buffer_with_last_view;
962 lexrc >> auto_number;
964 case RC_MARK_FOREIGN_LANGUAGE:
965 lexrc >> mark_foreign_language;
971 fmt = lexrc.getString();
972 if (lexrc.next(true))
973 command = lexrc.getString();
974 setMover(fmt, command);
979 string from, to, command, flags;
981 from = lexrc.getString();
983 to = lexrc.getString();
984 if (lexrc.next(true))
985 command = lexrc.getString();
987 flags = lexrc.getString();
989 theConverters().erase(from, to);
991 theConverters().add(from, to, command, flags);
994 // compatibility with versions older than 1.4.0 only
996 string format, command;
997 lexrc >> format >> command;
998 formats.setViewer(format, command);
1001 case RC_FILEFORMAT: {
1003 string format, extensions, prettyname, shortcut;
1004 if (!(lexrc >> format >> extensions))
1006 if (ok && lexrc.next(true))
1007 prettyname = lexrc.getString();
1011 if(!(lexrc >> shortcut))
1013 string viewer, editor;
1014 if (ok && lexrc.next(true))
1015 viewer = lexrc.getString();
1018 if (ok && lexrc.next(true))
1019 editor = lexrc.getString();
1023 if (!(lexrc >> flags >> mime))
1025 int flgs = Format::none;
1026 while (!flags.empty()) {
1028 flags = split(flags, flag, ',');
1029 if (flag == "document")
1030 flgs |= Format::document;
1031 else if (flag == "vector")
1032 flgs |= Format::vector;
1033 else if (flag == "zipped=native")
1034 flgs |= Format::zipped_native;
1035 else if (flag == "menu=export")
1036 flgs |= Format::export_menu;
1038 LYXERR0("Ignoring unknown flag `"
1039 << flag << "' for format `"
1043 LYXERR0("Syntax error in format " << format);
1044 else if (prettyname.empty()) {
1045 if (theConverters().formatIsUsed(format))
1046 LYXERR0("Can't delete format " << format);
1048 formats.erase(format);
1050 formats.add(format, extensions, prettyname,
1051 shortcut, viewer, editor, mime, flgs);
1055 case RC_VIEWER_ALTERNATIVES: {
1056 string format, command;
1059 viewer_alternatives[format].insert(command);
1062 case RC_EDITOR_ALTERNATIVES: {
1063 string format, command;
1066 editor_alternatives[format].insert(command);
1070 case RC_DEFAULT_OTF_VIEW_FORMAT:
1071 lexrc >> default_otf_view_format;
1074 case RC_DEFAULT_VIEW_FORMAT:
1075 lexrc >> default_view_format;
1078 case RC_GUI_LANGUAGE:
1079 lexrc >> gui_language;
1082 case RC_SHOW_BANNER:
1083 lexrc >> show_banner;
1088 string const tmp = lexrc.getString();
1089 if (tmp == "true" || tmp == "on")
1090 preview = PREVIEW_ON;
1091 else if (tmp == "no_math")
1092 preview = PREVIEW_NO_MATH;
1094 preview = PREVIEW_OFF;
1095 if (tmp != "false" && tmp != "off")
1096 LYXERR0("Unrecognized preview status \""
1102 case RC_PREVIEW_HASHED_LABELS:
1103 lexrc >> preview_hashed_labels;
1106 case RC_PREVIEW_SCALE_FACTOR:
1107 lexrc >> preview_scale_factor;
1114 lexrc >> user_email;
1117 case RC_PATH_PREFIX:
1118 lexrc >> path_prefix;
1121 case RC_USE_CONVERTER_CACHE:
1122 lexrc >> use_converter_cache;
1124 case RC_CONVERTER_CACHE_MAXAGE:
1125 lexrc >> converter_cache_maxage;
1128 case RC_SORT_LAYOUTS:
1129 lexrc >> sort_layouts;
1131 case RC_GROUP_LAYOUTS:
1132 lexrc >> group_layouts;
1134 case RC_FULL_SCREEN_LIMIT:
1135 lexrc >> full_screen_limit;
1137 case RC_FULL_SCREEN_TOOLBARS:
1138 lexrc >> full_screen_toolbars;
1140 case RC_FULL_SCREEN_SCROLLBAR:
1141 lexrc >> full_screen_scrollbar;
1143 case RC_FULL_SCREEN_STATUSBAR:
1144 lexrc >> full_screen_statusbar;
1146 case RC_FULL_SCREEN_TABBAR:
1147 lexrc >> full_screen_tabbar;
1149 case RC_FULL_SCREEN_MENUBAR:
1150 lexrc >> full_screen_menubar;
1152 case RC_FULL_SCREEN_WIDTH:
1153 lexrc >> full_screen_width;
1155 case RC_OPEN_BUFFERS_IN_TABS:
1156 lexrc >> open_buffers_in_tabs;
1158 case RC_SINGLE_CLOSE_TAB_BUTTON:
1159 lexrc >> single_close_tab_button;
1161 case RC_SINGLE_INSTANCE:
1162 lexrc >> single_instance;
1163 if (run_mode == PREFERRED)
1164 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1166 case RC_FORWARD_SEARCH_DVI:
1167 if (lexrc.next(true))
1168 forward_search_dvi = lexrc.getString();
1170 case RC_FORWARD_SEARCH_PDF:
1171 if (lexrc.next(true))
1172 forward_search_pdf = lexrc.getString();
1174 case RC_EXPORT_OVERWRITE:
1176 string const tmp = lexrc.getString();
1177 if (tmp == "all" || tmp == "true")
1178 export_overwrite = ALL_FILES;
1179 else if (tmp == "main")
1180 export_overwrite = MAIN_FILE;
1182 export_overwrite = NO_FILES;
1183 if (tmp != "ask" && tmp != "false")
1184 LYXERR0("Unrecognized export_overwrite status \""
1189 case RC_SCROLL_WHEEL_ZOOM:
1191 string const tmp = lexrc.getString();
1193 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1194 else if (tmp == "shift")
1195 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1196 else if (tmp == "alt")
1197 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1199 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1200 if (tmp != "off" && tmp != "false")
1201 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1207 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1208 lexrc >> mouse_middlebutton_paste;
1212 break; // this is just a dummy
1215 // This is triggered the first time through the loop unless
1216 // we hit a format tag.
1217 if (check_format && format != LYXRC_FILEFORMAT)
1218 return FormatMismatch;
1221 /// Update converters data-structures
1222 theConverters().update(formats);
1223 theConverters().buildGraph();
1229 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1231 ofstream ofs(filename.toFilesystemEncoding().c_str());
1233 write(ofs, ignore_system_lyxrc);
1237 void LyXRC::print() const
1239 if (lyxerr.debugging())
1240 write(lyxerr, false);
1248 typedef pair<string, SpecialisedMover> Data;
1250 SameMover(Data const & comparison)
1251 : comparison_(comparison) {}
1253 bool operator()(Data const & data) const
1255 return data.first == comparison_.first &&
1256 data.second.command() == comparison_.second.command();
1266 // Escape \ and " so that LyXLex can read the string later
1267 string escapeCommand(string const & str) {
1268 return subst(subst(str , "\\", "\\\\"),
1275 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1277 LyXRCTags tag = RC_LAST;
1279 if (!name.empty()) {
1280 for (int i = 0; i != lyxrcCount; ++i)
1281 if ("\\" + name == lyxrcTags[i].tag)
1282 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1286 os << "# LyX " << lyx_version
1287 << " generated this file. If you want to make your own\n"
1288 << "# modifications you should do them from inside LyX and save.\n\n"
1289 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1291 // Why the switch you might ask. It is a trick to ensure that all
1292 // the elements in the LyXRCTags enum are handled. As you can see
1293 // there are no breaks at all. So it is just a huge fall-through.
1294 // The nice thing is that we will get a warning from the compiler
1295 // if we forget an element.
1299 // input/include files are not done here
1300 case RC_LYXRCFORMAT:
1302 if (ignore_system_lyxrc ||
1303 bind_file != system_lyxrc.bind_file) {
1304 string const path = os::external_path(bind_file);
1305 os << "\\bind_file \"" << path << "\"\n";
1311 if (ignore_system_lyxrc ||
1312 def_file != system_lyxrc.def_file) {
1313 string const path = os::external_path(def_file);
1314 os << "\\def_file \"" << path << "\"\n";
1323 << "# MISC SECTION ######################################\n"
1325 // bind files are not done here.
1327 case RC_PATH_PREFIX:
1328 if (ignore_system_lyxrc ||
1329 path_prefix != system_lyxrc.path_prefix) {
1330 os << "\\path_prefix \"" << path_prefix << "\"\n";
1335 if (ignore_system_lyxrc ||
1336 ui_file != system_lyxrc.ui_file) {
1337 string const path = os::external_path(ui_file);
1338 os << "\\ui_file \"" << path << "\"\n";
1342 case RC_AUTOREGIONDELETE:
1343 if (ignore_system_lyxrc ||
1344 auto_region_delete != system_lyxrc.auto_region_delete) {
1345 os << "# Set to false to inhibit automatic replacement of\n"
1346 << "# the current selection.\n"
1347 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1352 case RC_AUTORESET_OPTIONS:
1353 if (ignore_system_lyxrc ||
1354 auto_reset_options != system_lyxrc.auto_reset_options) {
1355 os << "# Set to false to inhibit automatic reset of\n"
1356 << "# the class options to defaults on class change.\n"
1357 << "\\auto_reset_options "
1358 << convert<string>(auto_reset_options)
1364 if (ignore_system_lyxrc ||
1365 autosave != system_lyxrc.autosave) {
1366 os << "# The time interval between auto-saves in seconds.\n"
1367 << "\\autosave " << autosave << '\n';
1371 case RC_DISPLAY_GRAPHICS:
1372 if (ignore_system_lyxrc ||
1373 display_graphics != system_lyxrc.display_graphics) {
1374 os << "# Display graphics within LyX\n"
1376 << "\\display_graphics "
1377 << (display_graphics ? "true" : "false")
1382 case RC_SORT_LAYOUTS:
1383 if (ignore_system_lyxrc ||
1384 sort_layouts != system_lyxrc.sort_layouts) {
1385 os << "# Sort layouts alphabetically.\n"
1386 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1390 case RC_GROUP_LAYOUTS:
1391 if (ignore_system_lyxrc ||
1392 group_layouts != system_lyxrc.group_layouts) {
1393 os << "# Group layouts by their category.\n"
1394 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1398 case RC_VIEWDVI_PAPEROPTION:
1399 if (ignore_system_lyxrc ||
1400 view_dvi_paper_option
1401 != system_lyxrc.view_dvi_paper_option) {
1402 os << "# Options used to specify paper size to the\n"
1403 << "# view_dvi_command (e.g. -paper)\n"
1404 << "\\view_dvi_paper_option \""
1405 << view_dvi_paper_option << "\"\n";
1409 case RC_CHKTEX_COMMAND:
1410 if (ignore_system_lyxrc ||
1411 chktex_command != system_lyxrc.chktex_command) {
1412 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1416 case RC_BIBTEX_ALTERNATIVES: {
1417 CommandSet::const_iterator it = bibtex_alternatives.begin();
1418 CommandSet::const_iterator end = bibtex_alternatives.end();
1419 for ( ; it != end; ++it) {
1420 if (ignore_system_lyxrc
1421 || !system_lyxrc.bibtex_alternatives.count(*it))
1422 os << "\\bibtex_alternatives \""
1428 case RC_BIBTEX_COMMAND:
1429 if (ignore_system_lyxrc ||
1430 bibtex_command != system_lyxrc.bibtex_command) {
1431 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1435 case RC_JBIBTEX_COMMAND:
1436 if (ignore_system_lyxrc ||
1437 jbibtex_command != system_lyxrc.jbibtex_command) {
1438 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1442 case RC_INDEX_ALTERNATIVES: {
1443 CommandSet::const_iterator it = index_alternatives.begin();
1444 CommandSet::const_iterator end = index_alternatives.end();
1445 for ( ; it != end; ++it) {
1446 if (ignore_system_lyxrc
1447 || !system_lyxrc.index_alternatives.count(*it))
1448 os << "\\index_alternatives \""
1454 case RC_INDEX_COMMAND:
1455 if (ignore_system_lyxrc ||
1456 index_command != system_lyxrc.index_command) {
1457 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1461 case RC_JINDEX_COMMAND:
1462 if (ignore_system_lyxrc ||
1463 jindex_command != system_lyxrc.jindex_command) {
1464 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1468 case RC_SPLITINDEX_COMMAND:
1469 if (ignore_system_lyxrc ||
1470 splitindex_command != system_lyxrc.splitindex_command) {
1471 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1475 case RC_NOMENCL_COMMAND:
1476 if (ignore_system_lyxrc ||
1477 nomencl_command != system_lyxrc.nomencl_command) {
1478 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1482 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1483 // Don't write this setting to the preferences file,
1484 // but allow temporary changes (bug 7557).
1485 if (ignore_system_lyxrc) {
1486 os << "\\tex_expects_windows_paths "
1487 << convert<string>(windows_style_tex_paths) << '\n';
1491 case RC_TEX_ALLOWS_SPACES:
1492 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1493 os << "\\tex_allows_spaces "
1494 << convert<string>(tex_allows_spaces) << '\n';
1499 if (ignore_system_lyxrc ||
1500 use_kbmap != system_lyxrc.use_kbmap) {
1501 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1505 case RC_KBMAP_PRIMARY:
1506 if (ignore_system_lyxrc ||
1507 primary_kbmap != system_lyxrc.primary_kbmap) {
1508 string const path = os::external_path(primary_kbmap);
1509 os << "\\kbmap_primary \"" << path << "\"\n";
1513 case RC_KBMAP_SECONDARY:
1514 if (ignore_system_lyxrc ||
1515 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1516 string const path = os::external_path(secondary_kbmap);
1517 os << "\\kbmap_secondary \"" << path << "\"\n";
1522 if (ignore_system_lyxrc ||
1523 lyxpipes != system_lyxrc.lyxpipes) {
1524 string const path = os::external_path(lyxpipes);
1525 os << "\\serverpipe \"" << path << "\"\n";
1529 case RC_DATE_INSERT_FORMAT:
1530 if (ignore_system_lyxrc ||
1531 date_insert_format != system_lyxrc.date_insert_format) {
1532 os << "\\date_insert_format \"" << date_insert_format
1539 os << "\\user_name \"" << user_name << "\"\n";
1544 os << "\\user_email \"" << user_email << "\"\n";
1548 case RC_SHOW_BANNER:
1549 if (ignore_system_lyxrc ||
1550 show_banner != system_lyxrc.show_banner) {
1551 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1557 if (ignore_system_lyxrc ||
1558 preview != system_lyxrc.preview) {
1564 case PREVIEW_NO_MATH:
1571 os << "\\preview " << status << '\n';
1576 case RC_PREVIEW_HASHED_LABELS:
1577 if (ignore_system_lyxrc ||
1578 preview_hashed_labels !=
1579 system_lyxrc.preview_hashed_labels) {
1580 os << "\\preview_hashed_labels "
1581 << convert<string>(preview_hashed_labels) << '\n';
1586 case RC_PREVIEW_SCALE_FACTOR:
1587 if (ignore_system_lyxrc ||
1588 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1589 os << "\\preview_scale_factor "
1590 << preview_scale_factor << '\n';
1595 case RC_USE_CONVERTER_CACHE:
1596 if (ignore_system_lyxrc ||
1597 use_converter_cache != system_lyxrc.use_converter_cache) {
1598 os << "\\use_converter_cache "
1599 << convert<string>(use_converter_cache) << '\n';
1604 case RC_CONVERTER_CACHE_MAXAGE:
1605 if (ignore_system_lyxrc ||
1606 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1607 os << "\\converter_cache_maxage "
1608 << converter_cache_maxage << '\n';
1614 << "# SCREEN & FONTS SECTION ############################\n"
1618 if (ignore_system_lyxrc ||
1619 icon_set != system_lyxrc.icon_set) {
1620 os << "\\icon_set \"" << icon_set
1626 case RC_USE_SYSTEM_THEME_ICONS:
1627 if (ignore_system_lyxrc ||
1628 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1629 os << "\\use_system_theme_icons "
1630 << convert<string>(use_system_theme_icons)
1637 if (ignore_system_lyxrc ||
1638 dpi != system_lyxrc.dpi) {
1639 os << "\\screen_dpi " << dpi << '\n';
1643 case RC_SCREEN_ZOOM:
1644 if (ignore_system_lyxrc ||
1645 zoom != system_lyxrc.zoom) {
1646 os << "\\screen_zoom " << zoom << '\n';
1650 case RC_GEOMETRY_SESSION:
1651 if (ignore_system_lyxrc ||
1652 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1653 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1658 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1659 if (ignore_system_lyxrc ||
1660 cursor_follows_scrollbar
1661 != system_lyxrc.cursor_follows_scrollbar) {
1662 os << "\\cursor_follows_scrollbar "
1663 << convert<string>(cursor_follows_scrollbar) << '\n';
1667 case RC_CURSOR_WIDTH:
1668 if (ignore_system_lyxrc ||
1670 != system_lyxrc.cursor_width) {
1671 os << "\\cursor_width "
1672 << cursor_width << '\n';
1676 case RC_SCROLL_BELOW_DOCUMENT:
1677 if (ignore_system_lyxrc ||
1678 scroll_below_document
1679 != system_lyxrc.scroll_below_document) {
1680 os << "\\scroll_below_document "
1681 << convert<string>(scroll_below_document) << '\n';
1685 case RC_PARAGRAPH_MARKERS:
1686 if (ignore_system_lyxrc ||
1688 != system_lyxrc.paragraph_markers) {
1689 os << "\\paragraph_markers "
1690 << convert<string>(paragraph_markers) << '\n';
1694 case RC_MAC_DONTSWAP_CTRL_META:
1695 if (ignore_system_lyxrc ||
1696 mac_dontswap_ctrl_meta
1697 != system_lyxrc.mac_dontswap_ctrl_meta) {
1698 os << "\\mac_dontswap_ctrl_meta "
1699 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1703 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1704 if (ignore_system_lyxrc ||
1705 mac_like_cursor_movement
1706 != system_lyxrc.mac_like_cursor_movement) {
1707 os << "\\mac_like_cursor_movement "
1708 << convert<string>(mac_like_cursor_movement) << '\n';
1712 case RC_MACRO_EDIT_STYLE:
1713 if (ignore_system_lyxrc ||
1715 != system_lyxrc.macro_edit_style) {
1716 os << "\\macro_edit_style ";
1717 switch (macro_edit_style) {
1718 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1719 case MACRO_EDIT_INLINE: os << "1\n"; break;
1720 case MACRO_EDIT_LIST: os << "2\n"; break;
1725 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1726 if (ignore_system_lyxrc ||
1727 dialogs_iconify_with_main
1728 != system_lyxrc.dialogs_iconify_with_main) {
1729 os << "\\dialogs_iconify_with_main "
1730 << convert<string>(dialogs_iconify_with_main) << '\n';
1734 case RC_SCREEN_FONT_ROMAN:
1735 if (ignore_system_lyxrc ||
1736 roman_font_name != system_lyxrc.roman_font_name) {
1737 os << "\\screen_font_roman \"" << roman_font_name
1742 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1743 if (ignore_system_lyxrc ||
1744 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1745 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1750 case RC_SCREEN_FONT_SANS:
1751 if (ignore_system_lyxrc ||
1752 sans_font_name != system_lyxrc.sans_font_name) {
1753 os << "\\screen_font_sans \"" << sans_font_name
1758 case RC_SCREEN_FONT_SANS_FOUNDRY:
1759 if (ignore_system_lyxrc ||
1760 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1761 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1766 case RC_SCREEN_FONT_TYPEWRITER:
1767 if (ignore_system_lyxrc ||
1768 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1769 os << "\\screen_font_typewriter \""
1770 << typewriter_font_name << "\"\n";
1774 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1775 if (ignore_system_lyxrc ||
1776 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1777 os << "\\screen_font_typewriter_foundry \""
1778 << typewriter_font_foundry << "\"\n";
1783 case RC_SCREEN_FONT_SCALABLE:
1784 if (ignore_system_lyxrc ||
1785 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1786 os << "\\screen_font_scalable "
1787 << convert<string>(use_scalable_fonts)
1792 case RC_SCREEN_FONT_SIZES:
1793 if (ignore_system_lyxrc ||
1794 font_sizes[FONT_SIZE_TINY]
1795 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1796 font_sizes[FONT_SIZE_SCRIPT]
1797 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1798 font_sizes[FONT_SIZE_FOOTNOTE]
1799 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1800 font_sizes[FONT_SIZE_SMALL]
1801 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1802 font_sizes[FONT_SIZE_NORMAL]
1803 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1804 font_sizes[FONT_SIZE_LARGE]
1805 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1806 font_sizes[FONT_SIZE_LARGER]
1807 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1808 font_sizes[FONT_SIZE_LARGEST]
1809 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1810 font_sizes[FONT_SIZE_HUGE]
1811 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1812 font_sizes[FONT_SIZE_HUGER]
1813 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1814 streamsize old_prec = os.precision();
1815 os.setf(ios::fixed);
1817 os << "\\screen_font_sizes"
1818 << ' ' << font_sizes[FONT_SIZE_TINY]
1819 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1820 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1821 << ' ' << font_sizes[FONT_SIZE_SMALL]
1822 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1823 << ' ' << font_sizes[FONT_SIZE_LARGE]
1824 << ' ' << font_sizes[FONT_SIZE_LARGER]
1825 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1826 << ' ' << font_sizes[FONT_SIZE_HUGE]
1827 << ' ' << font_sizes[FONT_SIZE_HUGER]
1829 os.precision(old_prec);
1830 os.unsetf(ios::fixed);
1834 case RC_FULL_SCREEN_LIMIT:
1835 if (ignore_system_lyxrc ||
1836 full_screen_limit != system_lyxrc.full_screen_limit) {
1837 os << "\\fullscreen_limit "
1838 << convert<string>(full_screen_limit)
1843 case RC_FULL_SCREEN_TOOLBARS:
1844 if (ignore_system_lyxrc ||
1845 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1846 os << "\\fullscreen_toolbars "
1847 << convert<string>(full_screen_toolbars)
1852 case RC_FULL_SCREEN_SCROLLBAR:
1853 if (ignore_system_lyxrc ||
1854 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1855 os << "\\fullscreen_scrollbar "
1856 << convert<string>(full_screen_scrollbar)
1861 case RC_FULL_SCREEN_STATUSBAR:
1862 if (ignore_system_lyxrc ||
1863 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1864 os << "\\fullscreen_statusbar "
1865 << convert<string>(full_screen_statusbar)
1870 case RC_FULL_SCREEN_TABBAR:
1871 if (ignore_system_lyxrc ||
1872 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1873 os << "\\fullscreen_tabbar "
1874 << convert<string>(full_screen_tabbar)
1879 case RC_FULL_SCREEN_MENUBAR:
1880 if (ignore_system_lyxrc ||
1881 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1882 os << "\\fullscreen_menubar "
1883 << convert<string>(full_screen_menubar)
1888 case RC_FULL_SCREEN_WIDTH:
1889 if (ignore_system_lyxrc ||
1890 full_screen_width != system_lyxrc.full_screen_width) {
1891 os << "\\fullscreen_width "
1892 << convert<string>(full_screen_width)
1897 case RC_OPEN_BUFFERS_IN_TABS:
1898 if (ignore_system_lyxrc ||
1899 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1900 os << "\\open_buffers_in_tabs "
1901 << convert<string>(open_buffers_in_tabs)
1906 case RC_SINGLE_CLOSE_TAB_BUTTON:
1907 if (ignore_system_lyxrc ||
1908 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1909 os << "\\single_close_tab_button "
1910 << convert<string>(single_close_tab_button)
1915 case RC_SINGLE_INSTANCE:
1916 if (ignore_system_lyxrc ||
1917 single_instance != system_lyxrc.single_instance) {
1918 os << "\\single_instance "
1919 << convert<string>(single_instance)
1924 case RC_FORWARD_SEARCH_DVI:
1925 if (ignore_system_lyxrc ||
1926 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1927 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1931 case RC_FORWARD_SEARCH_PDF:
1932 if (ignore_system_lyxrc ||
1933 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1934 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1940 << "# COLOR SECTION ###################################\n"
1944 for (int i = 0; i < Color_ignore; ++i) {
1945 ColorCode lc = static_cast<ColorCode>(i);
1946 string const col = lcolor.getX11Name(lc);
1947 if (ignore_system_lyxrc
1948 || col != system_lcolor.getX11Name(lc)) {
1949 os << "\\set_color \""
1950 << lcolor.getLyXName(lc) << "\" \""
1958 << "# PRINTER SECTION ###################################\n"
1961 case RC_PRINTLANDSCAPEFLAG:
1962 if (ignore_system_lyxrc ||
1963 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1964 os << "\\print_landscape_flag \"" << print_landscape_flag
1970 case RC_PRINTPAPERFLAG:
1971 if (ignore_system_lyxrc ||
1972 print_paper_flag != system_lyxrc.print_paper_flag) {
1973 os << "\\print_paper_flag \"" << print_paper_flag
1979 case RC_PRINTPAPERDIMENSIONFLAG:
1980 if (ignore_system_lyxrc ||
1981 print_paper_dimension_flag
1982 != system_lyxrc.print_paper_dimension_flag) {
1983 os << "\\print_paper_dimension_flag \""
1984 << print_paper_dimension_flag << "\"\n";
1990 << "# TEX SECTION #######################################\n"
1993 case RC_TEXINPUTS_PREFIX:
1994 if (ignore_system_lyxrc ||
1995 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1996 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2001 case RC_FONT_ENCODING:
2002 if (ignore_system_lyxrc ||
2003 fontenc != system_lyxrc.fontenc) {
2004 os << "\\font_encoding \"" << fontenc << "\"\n";
2010 << "# FILE SECTION ######################################\n"
2013 case RC_DOCUMENTPATH:
2014 if (ignore_system_lyxrc ||
2015 document_path != system_lyxrc.document_path) {
2016 string const path = os::external_path(document_path);
2017 os << "\\document_path \"" << path << "\"\n";
2021 case RC_USELASTFILEPOS:
2022 if (ignore_system_lyxrc ||
2023 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2024 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2029 case RC_LOADSESSION:
2030 if (ignore_system_lyxrc ||
2031 load_session != system_lyxrc.load_session) {
2032 os << "\\load_session " << convert<string>(load_session)
2037 case RC_MOUSE_WHEEL_SPEED:
2038 if (ignore_system_lyxrc ||
2039 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2040 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2044 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2045 if (ignore_system_lyxrc ||
2046 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2047 os << "\\mouse_middlebutton_paste "
2048 << convert<string>(mouse_middlebutton_paste) << '\n';
2052 case RC_COMPLETION_INLINE_DELAY:
2053 if (ignore_system_lyxrc ||
2054 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2055 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2059 case RC_COMPLETION_INLINE_MATH:
2060 if (ignore_system_lyxrc ||
2061 completion_inline_math != system_lyxrc.completion_inline_math) {
2062 os << "\\completion_inline_math "
2063 << convert<string>(completion_inline_math) << '\n';
2067 case RC_COMPLETION_INLINE_TEXT:
2068 if (ignore_system_lyxrc ||
2069 completion_inline_text != system_lyxrc.completion_inline_text) {
2070 os << "\\completion_inline_text "
2071 << convert<string>(completion_inline_text) << '\n';
2075 case RC_COMPLETION_INLINE_DOTS:
2076 if (ignore_system_lyxrc ||
2077 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2078 os << "\\completion_inline_dots "
2079 << convert<string>(completion_inline_dots) << '\n';
2083 case RC_AUTOCORRECTION_MATH:
2084 if (ignore_system_lyxrc ||
2085 autocorrection_math != system_lyxrc.autocorrection_math) {
2086 os << "\\autocorrection_math "
2087 << convert<string>(autocorrection_math) << '\n';
2091 case RC_COMPLETION_POPUP_DELAY:
2092 if (ignore_system_lyxrc ||
2093 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2094 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2098 case RC_COMPLETION_POPUP_MATH:
2099 if (ignore_system_lyxrc ||
2100 completion_popup_math != system_lyxrc.completion_popup_math) {
2101 os << "\\completion_popup_math "
2102 << convert<string>(completion_popup_math) << '\n';
2106 case RC_COMPLETION_POPUP_TEXT:
2107 if (ignore_system_lyxrc ||
2108 completion_popup_text != system_lyxrc.completion_popup_text) {
2109 os << "\\completion_popup_text "
2110 << convert<string>(completion_popup_text) << '\n';
2114 case RC_COMPLETION_CURSOR_TEXT:
2115 if (ignore_system_lyxrc ||
2116 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2117 os << "\\completion_cursor_text "
2118 << convert<string>(completion_cursor_text) << '\n';
2122 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2123 if (ignore_system_lyxrc ||
2124 completion_popup_after_complete
2125 != system_lyxrc.completion_popup_after_complete) {
2126 os << "\\completion_popup_after_complete "
2127 << convert<string>(completion_popup_after_complete) << '\n';
2131 case RC_COMPLETION_MINLENGTH:
2132 if (ignore_system_lyxrc ||
2133 completion_minlength != system_lyxrc.completion_minlength) {
2134 os << "\\completion_minlength " << convert<string>(completion_minlength)
2140 case RC_NUMLASTFILES:
2141 if (ignore_system_lyxrc ||
2142 num_lastfiles != system_lyxrc.num_lastfiles) {
2143 os << "\\num_lastfiles " << num_lastfiles << '\n';
2147 case RC_CHECKLASTFILES:
2148 if (ignore_system_lyxrc ||
2149 check_lastfiles != system_lyxrc.check_lastfiles) {
2150 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2155 case RC_EXAMPLEPATH:
2156 if (ignore_system_lyxrc ||
2157 example_path != system_lyxrc.example_path) {
2158 string const path = os::external_path(example_path);
2159 os << "\\example_path \"" << path << "\"\n";
2163 case RC_TEMPLATEPATH:
2164 if (ignore_system_lyxrc ||
2165 template_path != system_lyxrc.template_path) {
2166 string const path = os::external_path(template_path);
2167 os << "\\template_path \"" << path << "\"\n";
2171 case RC_TEMPDIRPATH:
2172 if (ignore_system_lyxrc ||
2173 tempdir_path != system_lyxrc.tempdir_path) {
2174 string const path = os::external_path(tempdir_path);
2175 os << "\\tempdir_path \"" << path << "\"\n";
2179 case RC_THESAURUSDIRPATH:
2180 if (ignore_system_lyxrc ||
2181 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2182 string const path = os::external_path(thesaurusdir_path);
2183 os << "\\thesaurusdir_path \"" << path << "\"\n";
2187 case RC_HUNSPELLDIR_PATH:
2188 if (ignore_system_lyxrc ||
2189 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2190 string const path = os::external_path(hunspelldir_path);
2191 os << "\\hunspelldir_path \"" << path << "\"\n";
2195 case RC_PLAINTEXT_LINELEN:
2196 if (ignore_system_lyxrc ||
2197 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2198 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2202 case RC_MAKE_BACKUP:
2203 if (ignore_system_lyxrc ||
2204 make_backup != system_lyxrc.make_backup) {
2205 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2209 case RC_SAVE_COMPRESSED:
2210 if (ignore_system_lyxrc ||
2211 save_compressed != system_lyxrc.save_compressed) {
2212 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2216 case RC_SAVE_ORIGIN:
2217 if (ignore_system_lyxrc ||
2218 save_origin != system_lyxrc.save_origin) {
2219 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2223 case RC_BACKUPDIR_PATH:
2224 if (ignore_system_lyxrc ||
2225 backupdir_path != system_lyxrc.backupdir_path) {
2226 string const path = os::external_path(backupdir_path);
2227 os << "\\backupdir_path \"" << path << "\"\n";
2233 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2237 << "# SPELLCHECKER SECTION ##############################\n"
2240 case RC_ACCEPT_COMPOUND:
2241 if (ignore_system_lyxrc ||
2242 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2243 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2249 if (ignore_system_lyxrc ||
2250 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2251 os << "\\alternate_language \"" << spellchecker_alt_lang
2257 if (ignore_system_lyxrc ||
2258 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2259 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2263 case RC_USE_SYSTEM_COLORS:
2264 if (ignore_system_lyxrc ||
2265 use_system_colors != system_lyxrc.use_system_colors) {
2266 os << "\\use_system_colors "
2267 << convert<string>(use_system_colors)
2272 case RC_USE_TOOLTIP:
2273 if (ignore_system_lyxrc ||
2274 use_tooltip != system_lyxrc.use_tooltip) {
2275 os << "\\use_tooltip "
2276 << convert<string>(use_tooltip)
2281 case RC_USE_PIXMAP_CACHE:
2282 if (ignore_system_lyxrc ||
2283 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2284 os << "\\use_pixmap_cache "
2285 << convert<string>(use_pixmap_cache)
2291 if (ignore_system_lyxrc ||
2292 use_qimage != system_lyxrc.use_qimage) {
2293 os << "\\use_qimage "
2294 << convert<string>(use_qimage)
2301 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2306 case RC_DEFAULT_DECIMAL_POINT:
2307 if (ignore_system_lyxrc ||
2308 default_decimal_point != system_lyxrc.default_decimal_point) {
2309 os << "\\default_decimal_point " << default_decimal_point << '\n';
2314 case RC_DEFAULT_LENGTH_UNIT:
2315 if (ignore_system_lyxrc ||
2316 default_length_unit != system_lyxrc.default_length_unit) {
2317 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2322 case RC_SPELLCHECKER:
2323 if (ignore_system_lyxrc ||
2324 spellchecker != system_lyxrc.spellchecker) {
2325 os << "\\spellchecker " << spellchecker << '\n';
2330 case RC_SPELLCHECK_CONTINUOUSLY:
2331 if (ignore_system_lyxrc ||
2332 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2333 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2339 case RC_SPELLCHECK_NOTES:
2340 if (ignore_system_lyxrc ||
2341 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2342 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2348 case RC_VISUAL_CURSOR:
2349 if (ignore_system_lyxrc ||
2350 visual_cursor != system_lyxrc.visual_cursor) {
2351 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2355 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2356 if (ignore_system_lyxrc ||
2357 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2358 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2359 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2363 case RC_LANGUAGE_CUSTOM_PACKAGE:
2364 if (ignore_system_lyxrc ||
2365 language_custom_package != system_lyxrc.language_custom_package) {
2366 os << "\\language_custom_package \"" << language_custom_package
2371 case RC_LANGUAGE_GLOBAL_OPTIONS:
2372 if (ignore_system_lyxrc ||
2373 language_global_options
2374 != system_lyxrc.language_global_options) {
2375 os << "\\language_global_options \""
2376 << convert<string>(language_global_options)
2381 case RC_LANGUAGE_PACKAGE_SELECTION:
2382 if (ignore_system_lyxrc ||
2383 language_package_selection != system_lyxrc.language_package_selection) {
2384 os << "\\language_package_selection ";
2385 switch (language_package_selection) {
2402 case RC_LANGUAGE_COMMAND_BEGIN:
2403 if (ignore_system_lyxrc ||
2404 language_command_begin
2405 != system_lyxrc.language_command_begin) {
2406 os << "\\language_command_begin \""
2407 << language_command_begin
2412 case RC_LANGUAGE_COMMAND_END:
2413 if (ignore_system_lyxrc ||
2414 language_command_end
2415 != system_lyxrc.language_command_end) {
2416 os << "\\language_command_end \"" << language_command_end
2421 case RC_LANGUAGE_COMMAND_LOCAL:
2422 if (ignore_system_lyxrc ||
2423 language_command_local
2424 != system_lyxrc.language_command_local) {
2425 os << "\\language_command_local \""
2426 << language_command_local
2431 case RC_LANGUAGE_AUTO_BEGIN:
2432 if (ignore_system_lyxrc ||
2433 language_auto_begin != system_lyxrc.language_auto_begin) {
2434 os << "\\language_auto_begin "
2435 << convert<string>(language_auto_begin) << '\n';
2439 case RC_LANGUAGE_AUTO_END:
2440 if (ignore_system_lyxrc ||
2441 language_auto_end != system_lyxrc.language_auto_end) {
2442 os << "\\language_auto_end "
2443 << convert<string>(language_auto_end) << '\n';
2447 case RC_MARK_FOREIGN_LANGUAGE:
2448 if (ignore_system_lyxrc ||
2449 mark_foreign_language
2450 != system_lyxrc.mark_foreign_language) {
2451 os << "\\mark_foreign_language " <<
2452 convert<string>(mark_foreign_language) << '\n';
2458 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2461 case RC_AUTO_NUMBER:
2462 if (ignore_system_lyxrc ||
2463 auto_number != system_lyxrc.auto_number) {
2464 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2468 case RC_GUI_LANGUAGE:
2469 if (ignore_system_lyxrc ||
2470 gui_language != system_lyxrc.gui_language) {
2471 os << "\\gui_language " << gui_language << '\n';
2475 case RC_EXPORT_OVERWRITE:
2476 if (ignore_system_lyxrc ||
2477 export_overwrite != system_lyxrc.export_overwrite) {
2479 switch (export_overwrite) {
2490 os << "\\export_overwrite " << status << '\n';
2495 case RC_SCROLL_WHEEL_ZOOM:
2496 if (ignore_system_lyxrc ||
2497 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2499 switch (scroll_wheel_zoom) {
2500 case SCROLL_WHEEL_ZOOM_OFF:
2503 case SCROLL_WHEEL_ZOOM_CTRL:
2506 case SCROLL_WHEEL_ZOOM_SHIFT:
2509 case SCROLL_WHEEL_ZOOM_ALT:
2513 os << "\\scroll_wheel_zoom " << status << '\n';
2519 << "# FORMATS SECTION ##########################\n"
2523 // New/modified formats
2524 for (Formats::const_iterator cit = formats.begin();
2525 cit != formats.end(); ++cit) {
2526 Format const * format =
2527 system_formats.getFormat(cit->name());
2529 format->extensions() != cit->extensions() ||
2530 format->prettyname() != cit->prettyname() ||
2531 format->shortcut() != cit->shortcut() ||
2532 format->viewer() != cit->viewer() ||
2533 format->editor() != cit->editor() ||
2534 format->documentFormat() != cit->documentFormat() ||
2535 format->vectorFormat() != cit->vectorFormat() ||
2536 format->inExportMenu() != cit->inExportMenu() ||
2537 format->mime() != cit->mime()) {
2538 os << "\\format \"" << cit->name() << "\" \""
2539 << cit->extensions() << "\" \""
2540 << cit->prettyname() << "\" \""
2541 << cit->shortcut() << "\" \""
2542 << escapeCommand(cit->viewer()) << "\" \""
2543 << escapeCommand(cit->editor()) << "\" \"";
2544 vector<string> flags;
2545 if (cit->documentFormat())
2546 flags.push_back("document");
2547 if (cit->vectorFormat())
2548 flags.push_back("vector");
2549 if (cit->zippedNative())
2550 flags.push_back("zipped=native");
2551 if (cit->inExportMenu())
2552 flags.push_back("menu=export");
2554 os << getStringFromVector(flags);
2555 os << "\" \"" << cit->mime() << "\"\n";
2559 // Look for deleted formats
2560 for (Formats::const_iterator cit = system_formats.begin();
2561 cit != system_formats.end(); ++cit)
2562 if (!formats.getFormat(cit->name()))
2563 os << "\\format \"" << cit->name()
2564 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2567 case RC_VIEWER_ALTERNATIVES: {
2568 Alternatives::const_iterator it = viewer_alternatives.begin();
2569 Alternatives::const_iterator const en = viewer_alternatives.end();
2570 Alternatives::const_iterator const sysend =
2571 system_lyxrc.viewer_alternatives.end();
2572 for (; it != en; ++it) {
2573 string const & fmt = it->first;
2574 CommandSet const & cmd = it->second;
2575 CommandSet::const_iterator sit = cmd.begin();
2576 CommandSet::const_iterator const sen = cmd.end();
2577 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2578 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2579 system_lyxrc.viewer_alternatives.find(fmt);
2580 for (; sit != sen; ++sit) {
2581 string const & cmd = *sit;
2582 if (ignore_system_lyxrc
2583 || sysfmt == sysend // format not found
2584 || sysfmt->second.count(cmd) == 0 // this command not found
2586 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2592 case RC_EDITOR_ALTERNATIVES: {
2593 Alternatives::const_iterator it = editor_alternatives.begin();
2594 Alternatives::const_iterator const en = editor_alternatives.end();
2595 Alternatives::const_iterator const sysend =
2596 system_lyxrc.editor_alternatives.end();
2597 for (; it != en; ++it) {
2598 string const & fmt = it->first;
2599 CommandSet const & cmd = it->second;
2600 CommandSet::const_iterator sit = cmd.begin();
2601 CommandSet::const_iterator const sen = cmd.end();
2602 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2603 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2604 system_lyxrc.editor_alternatives.find(fmt);
2605 for (; sit != sen; ++sit) {
2606 string const & cmd = *sit;
2607 if (ignore_system_lyxrc
2608 || sysfmt == sysend // format not found
2609 || sysfmt->second.count(cmd) == 0 // this command not found
2611 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2617 case RC_DEFAULT_OTF_VIEW_FORMAT:
2618 if ((ignore_system_lyxrc ||
2619 default_otf_view_format != system_lyxrc.default_otf_view_format)
2620 && !default_otf_view_format.empty()) {
2621 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2625 case RC_DEFAULT_VIEW_FORMAT:
2626 if (ignore_system_lyxrc ||
2627 default_view_format != system_lyxrc.default_view_format) {
2628 os << "\\default_view_format " << default_view_format << '\n';
2638 << "# CONVERTERS SECTION ##########################\n"
2642 // Look for new converters
2643 for (Converters::const_iterator cit = theConverters().begin();
2644 cit != theConverters().end(); ++cit) {
2645 Converter const * converter =
2646 theSystemConverters().getConverter(cit->from(),
2649 converter->command() != cit->command() ||
2650 converter->flags() != cit->flags())
2651 os << "\\converter \"" << cit->from() << "\" \""
2652 << cit->to() << "\" \""
2653 << escapeCommand(cit->command()) << "\" \""
2654 << cit->flags() << "\"\n";
2657 // New/modifed converters
2658 for (Converters::const_iterator cit = theSystemConverters().begin();
2659 cit != theSystemConverters().end(); ++cit)
2660 if (!theConverters().getConverter(cit->from(), cit->to()))
2661 os << "\\converter \"" << cit->from()
2662 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2669 << "# COPIERS SECTION ##########################\n"
2672 // Look for new movers
2673 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2674 Movers::const_iterator const sysend = theSystemMovers().end();
2675 Movers::const_iterator it = theMovers().begin();
2676 Movers::const_iterator end = theMovers().end();
2678 for (; it != end; ++it) {
2679 Movers::const_iterator const sysit =
2680 find_if(sysbegin, sysend, SameMover(*it));
2681 if (sysit == sysend) {
2682 string const & fmt = it->first;
2683 string const & command =
2684 it->second.command();
2686 os << "\\copier " << fmt
2687 << " \"" << escapeCommand(command) << "\"\n";
2693 // We don't actually delete SpecialisedMover(s) from the
2694 // map, just clear their 'command', so there's no need
2695 // to test for anything else.
2702 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2704 // Why the switch you might ask. It is a trick to ensure that all
2705 // the elements in the LyXRCTags enum is handled. As you can see
2706 // there are no breaks at all. So it is just a huge fall-through.
2707 // The nice thing is that we will get a warning from the compiler
2708 // if we forget an element.
2709 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2711 case LyXRC::RC_LAST:
2712 case LyXRC::RC_ACCEPT_COMPOUND:
2713 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2714 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2715 case LyXRC::RC_ALT_LANG:
2716 case LyXRC::RC_PLAINTEXT_LINELEN:
2717 case LyXRC::RC_AUTOCORRECTION_MATH:
2718 case LyXRC::RC_AUTOREGIONDELETE:
2719 case LyXRC::RC_AUTORESET_OPTIONS:
2720 case LyXRC::RC_AUTOSAVE:
2721 case LyXRC::RC_AUTO_NUMBER:
2722 case LyXRC::RC_BACKUPDIR_PATH:
2723 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2724 case LyXRC::RC_BIBTEX_COMMAND:
2725 case LyXRC::RC_BINDFILE:
2726 case LyXRC::RC_CHECKLASTFILES:
2727 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2728 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2729 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2730 case LyXRC::RC_COMPLETION_INLINE_MATH:
2731 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2732 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2733 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2734 case LyXRC::RC_COMPLETION_POPUP_MATH:
2735 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2736 case LyXRC::RC_COMPLETION_MINLENGTH:
2737 case LyXRC::RC_USELASTFILEPOS:
2738 case LyXRC::RC_LOADSESSION:
2739 case LyXRC::RC_CHKTEX_COMMAND:
2740 case LyXRC::RC_CONVERTER:
2741 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2742 case LyXRC::RC_COPIER:
2743 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2744 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2745 case LyXRC::RC_DATE_INSERT_FORMAT:
2746 case LyXRC::RC_GUI_LANGUAGE:
2747 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2748 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2749 case LyXRC::RC_DEFFILE:
2750 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2751 case LyXRC::RC_DISPLAY_GRAPHICS:
2752 case LyXRC::RC_DOCUMENTPATH:
2753 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2754 FileName path(lyxrc_new.document_path);
2755 if (path.exists() && path.isDirectory())
2756 package().document_dir() = FileName(lyxrc.document_path);
2758 case LyXRC::RC_EDITOR_ALTERNATIVES:
2759 case LyXRC::RC_ESC_CHARS:
2760 case LyXRC::RC_EXAMPLEPATH:
2761 case LyXRC::RC_FONT_ENCODING:
2762 case LyXRC::RC_FILEFORMAT:
2763 case LyXRC::RC_GROUP_LAYOUTS:
2764 case LyXRC::RC_HUNSPELLDIR_PATH:
2765 case LyXRC::RC_ICON_SET:
2766 case LyXRC::RC_INDEX_ALTERNATIVES:
2767 case LyXRC::RC_INDEX_COMMAND:
2768 case LyXRC::RC_JBIBTEX_COMMAND:
2769 case LyXRC::RC_JINDEX_COMMAND:
2770 case LyXRC::RC_NOMENCL_COMMAND:
2771 case LyXRC::RC_INPUT:
2772 case LyXRC::RC_KBMAP:
2773 case LyXRC::RC_KBMAP_PRIMARY:
2774 case LyXRC::RC_KBMAP_SECONDARY:
2775 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2776 case LyXRC::RC_LANGUAGE_AUTO_END:
2777 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2778 case LyXRC::RC_LANGUAGE_COMMAND_END:
2779 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2780 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2781 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2782 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2783 case LyXRC::RC_LYXRCFORMAT:
2784 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2785 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2786 case LyXRC::RC_MACRO_EDIT_STYLE:
2787 case LyXRC::RC_MAKE_BACKUP:
2788 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2789 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2790 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2791 case LyXRC::RC_NUMLASTFILES:
2792 case LyXRC::RC_PARAGRAPH_MARKERS:
2793 case LyXRC::RC_PATH_PREFIX:
2794 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2795 prependEnvPath("PATH", lyxrc_new.path_prefix);
2796 // Resets python path
2797 support::os::python(true);
2799 case LyXRC::RC_PREVIEW:
2800 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2801 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2802 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2803 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2804 case LyXRC::RC_PRINTPAPERFLAG:
2805 case LyXRC::RC_SAVE_COMPRESSED:
2806 case LyXRC::RC_SAVE_ORIGIN:
2807 case LyXRC::RC_SCREEN_DPI:
2808 case LyXRC::RC_SCREEN_FONT_ROMAN:
2809 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2810 case LyXRC::RC_SCREEN_FONT_SANS:
2811 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2812 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2813 case LyXRC::RC_SCREEN_FONT_SIZES:
2814 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2815 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2816 case LyXRC::RC_GEOMETRY_SESSION:
2817 case LyXRC::RC_SCREEN_ZOOM:
2818 case LyXRC::RC_SERVERPIPE:
2819 case LyXRC::RC_SET_COLOR:
2820 case LyXRC::RC_SHOW_BANNER:
2821 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2822 case LyXRC::RC_SPELLCHECKER:
2823 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2825 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2826 case LyXRC::RC_SPELLCHECK_NOTES:
2827 case LyXRC::RC_SPLITINDEX_COMMAND:
2828 case LyXRC::RC_TEMPDIRPATH:
2829 case LyXRC::RC_TEMPLATEPATH:
2830 case LyXRC::RC_TEX_ALLOWS_SPACES:
2831 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2832 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2833 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2835 case LyXRC::RC_TEXINPUTS_PREFIX:
2836 case LyXRC::RC_THESAURUSDIRPATH:
2837 case LyXRC::RC_UIFILE:
2838 case LyXRC::RC_USER_EMAIL:
2839 case LyXRC::RC_USER_NAME:
2840 case LyXRC::RC_USE_CONVERTER_CACHE:
2841 case LyXRC::RC_USE_SYSTEM_COLORS:
2842 case LyXRC::RC_USE_TOOLTIP:
2843 case LyXRC::RC_USE_PIXMAP_CACHE:
2844 case LyXRC::RC_USE_QIMAGE:
2845 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2846 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2847 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2848 case LyXRC::RC_SINGLE_INSTANCE:
2849 case LyXRC::RC_SORT_LAYOUTS:
2850 case LyXRC::RC_FULL_SCREEN_LIMIT:
2851 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2852 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2853 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2854 case LyXRC::RC_FULL_SCREEN_TABBAR:
2855 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2856 case LyXRC::RC_FULL_SCREEN_WIDTH:
2857 case LyXRC::RC_VISUAL_CURSOR:
2858 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2859 case LyXRC::RC_VIEWER:
2860 case LyXRC::RC_VIEWER_ALTERNATIVES:
2861 case LyXRC::RC_FORWARD_SEARCH_DVI:
2862 case LyXRC::RC_FORWARD_SEARCH_PDF:
2863 case LyXRC::RC_EXPORT_OVERWRITE:
2864 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2865 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2866 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2867 case LyXRC::RC_CURSOR_WIDTH:
2874 string const LyXRC::getDescription(LyXRCTags tag)
2879 case RC_ACCEPT_COMPOUND:
2880 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2884 str = _("Specify an alternate language. The default is to use the language of the document.");
2887 case RC_PLAINTEXT_LINELEN:
2888 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.");
2891 case RC_AUTOREGIONDELETE:
2892 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2895 case RC_AUTORESET_OPTIONS:
2896 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2900 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2903 case RC_AUTO_NUMBER:
2906 case RC_BACKUPDIR_PATH:
2907 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.");
2910 case RC_BIBTEX_COMMAND:
2911 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2914 case RC_JBIBTEX_COMMAND:
2915 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2919 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2922 case RC_CHECKLASTFILES:
2923 str = _("Select to check whether the lastfiles still exist.");
2926 case RC_CHKTEX_COMMAND:
2927 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2936 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2937 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.");
2940 case RC_CURSOR_WIDTH:
2941 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2944 case RC_SCROLL_BELOW_DOCUMENT:
2945 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");
2948 case RC_MAC_DONTSWAP_CTRL_META:
2949 str = _("Make Apple key act as Meta and Control key as Ctrl.");
2952 case RC_MAC_LIKE_CURSOR_MOVEMENT:
2953 str = _("Use the Mac OS X conventions for cursor movement");
2956 case RC_SHOW_MACRO_LABEL:
2957 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2960 case RC_DATE_INSERT_FORMAT:
2961 //xgettext:no-c-format
2962 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2966 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2969 case RC_DEFAULT_OTF_VIEW_FORMAT:
2970 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
2973 case RC_DEFAULT_VIEW_FORMAT:
2974 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2977 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2978 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2981 case RC_DISPLAY_GRAPHICS:
2982 str = _("Select how LyX will display any graphics.");
2985 case RC_DOCUMENTPATH:
2986 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2990 str = _("Specify additional chars that can be part of a word.");
2993 case RC_EXAMPLEPATH:
2994 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2997 case RC_FONT_ENCODING:
2998 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3004 case RC_INDEX_COMMAND:
3005 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\".");
3008 case RC_JINDEX_COMMAND:
3009 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3012 case RC_NOMENCL_COMMAND:
3013 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3020 case RC_KBMAP_PRIMARY:
3021 case RC_KBMAP_SECONDARY:
3022 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.");
3025 case RC_LANGUAGE_AUTO_BEGIN:
3026 str = _("Select if a language switching command is needed at the beginning of the document.");
3029 case RC_LANGUAGE_AUTO_END:
3030 str = _("Select if a language switching command is needed at the end of the document.");
3033 case RC_LANGUAGE_COMMAND_BEGIN:
3034 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.");
3037 case RC_LANGUAGE_COMMAND_END:
3038 str = _("The LaTeX command for changing back to the language of the document.");
3041 case RC_LANGUAGE_COMMAND_LOCAL:
3042 str = _("The LaTeX command for local changing of the language.");
3045 case RC_LANGUAGE_GLOBAL_OPTIONS:
3046 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3049 case RC_LANGUAGE_CUSTOM_PACKAGE:
3050 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3053 case RC_LANGUAGE_PACKAGE_SELECTION:
3054 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3057 case RC_USELASTFILEPOS:
3058 str = _("De-select if you do not want LyX to scroll to saved position.");
3061 case RC_LOADSESSION:
3062 str = _("De-select to prevent loading files opened from the last LyX session.");
3065 case RC_MAKE_BACKUP:
3066 str = _("De-select if you don't want LyX to create backup files.");
3069 case RC_MARK_FOREIGN_LANGUAGE:
3070 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3073 case RC_MOUSE_WHEEL_SPEED:
3074 str = bformat(_("The scrolling speed of the mouse wheel."),
3078 case RC_COMPLETION_POPUP_DELAY:
3079 str = _("The completion popup delay.");
3082 case RC_COMPLETION_POPUP_MATH:
3083 str = _("Select to display the completion popup in math mode.");
3086 case RC_COMPLETION_POPUP_TEXT:
3087 str = _("Select to display the completion popup in text mode.");
3090 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3091 str = _("Show the completion popup without delay after non-unique completion attempt.");
3094 case RC_COMPLETION_POPUP_TEXT:
3095 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3098 case RC_COMPLETION_POPUP_DELAY:
3099 str = _("The inline completion delay.");
3102 case RC_COMPLETION_INLINE_MATH:
3103 str = _("Select to display the inline completion in math mode.");
3106 case RC_COMPLETION_INLINE_TEXT:
3107 str = _("Select to display the inline completion in text mode.");
3110 case RC_COMPLETION_INLINE_DOTS:
3111 str = _("Use \"...\" to shorten long completions.");
3114 case RC_AUTOCORRECTION_MATH:
3115 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3118 case RC_NUMLASTFILES:
3119 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3123 case RC_PATH_PREFIX:
3124 str = _("Specify those directories which should be "
3125 "prepended to the PATH environment variable.\n"
3126 "Use the OS native format.");
3130 str = _("Shows a typeset preview of things such as math");
3133 case RC_PREVIEW_HASHED_LABELS:
3134 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3137 case RC_PREVIEW_SCALE_FACTOR:
3138 str = _("Scale the preview size to suit.");
3141 case RC_PRINTLANDSCAPEFLAG:
3142 str = _("The option to print out in landscape.");
3145 case RC_PRINTPAPERDIMENSIONFLAG:
3146 str = _("Option to specify the dimensions of the print paper.");
3149 case RC_PRINTPAPERFLAG:
3150 str = _("The option to specify paper type.");
3153 case RC_VISUAL_CURSOR:
3154 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3157 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3158 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).");
3162 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3165 case RC_SCREEN_FONT_ROMAN:
3166 case RC_SCREEN_FONT_SANS:
3167 case RC_SCREEN_FONT_TYPEWRITER:
3168 str = _("The screen fonts used to display the text while editing.");
3171 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3172 case RC_SCREEN_FONT_SANS_FOUNDRY:
3173 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3176 case RC_SCREEN_FONT_SCALABLE:
3177 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.");
3180 case RC_SCREEN_FONT_SIZES:
3181 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3184 case RC_SCREEN_ZOOM:
3185 //xgettext:no-c-format
3186 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3189 case RC_GEOMETRY_SESSION:
3190 str = _("Allow session manager to save and restore windows geometry.");
3194 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3200 case RC_SHOW_BANNER:
3201 str = _("De-select if you don't want the startup banner.");
3204 case RC_TEMPDIRPATH:
3205 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3208 case RC_THESAURUSDIRPATH:
3209 str = _("This is the place where the files of the thesaurus library reside.");
3212 case RC_TEMPLATEPATH:
3213 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3216 case RC_TEX_ALLOWS_SPACES:
3219 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3222 case RC_TEXINPUTS_PREFIX:
3223 str = _("Specify those directories which should be "
3224 "prepended to the TEXINPUTS environment variable.\n"
3225 "A '.' represents the current document directory. "
3226 "Use the OS native format.");
3230 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3239 case RC_USE_USE_SYSTEM_COLORS:
3240 str = _("Enable use the system colors for some things like main window background and selection.");
3243 case RC_USE_TOOLTIP:
3244 str = _("Enable the automatic appearance of tool tips in the work area.");
3247 case RC_USE_PIXMAP_CACHE:
3248 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3251 case RC_VIEWDVI_PAPEROPTION:
3252 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3267 // The global instance
3270 // The global copy of the system lyxrc entries (everything except preferences)