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;
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_statusbar = true;
338 full_screen_scrollbar = true;
339 full_screen_width = 700;
341 completion_cursor_text = true;
342 completion_popup_math = true;
343 completion_popup_text = false;
344 completion_popup_delay = 2.0;
345 completion_popup_after_complete = true;
346 autocorrection_math = false;
347 completion_inline_math = true;
348 completion_inline_text = false;
349 completion_inline_dots = -1;
350 completion_inline_delay = 0.2;
351 default_decimal_point = ".";
352 default_length_unit = Length::CM;
354 close_buffer_with_last_view = "yes";
355 mouse_middlebutton_paste = true;
361 void oldFontFormat(string & family, string & foundry)
363 if (family.empty() || family[0] != '-')
365 foundry = token(family, '-', 1);
366 family = token(family, '-', 2);
374 bool LyXRC::read(FileName const & filename, bool check_format)
376 Lexer lexrc(lyxrcTags);
377 lexrc.setFile(filename);
378 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
379 ReturnValues retval = read(lexrc, check_format);
380 if (!check_format || retval != FormatMismatch)
381 return retval == ReadOK;
383 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
384 TempFile tmp("convert_lyxrc");
385 FileName const tempfile = tmp.name();
386 bool const success = prefs2prefs(filename, tempfile, false);
388 LYXERR0 ("Unable to convert " << filename.absFileName() <<
389 " to format " << LYXRC_FILEFORMAT);
392 // Keep this in the else branch, such that lexrc2 goes out
393 // of scope and releases the lock on tempfile before we
394 // attempt to remove it. This matters on Windows.
395 Lexer lexrc2(lyxrcTags);
396 lexrc2.setFile(tempfile);
397 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
398 retval = read(lexrc2, check_format);
400 return retval == ReadOK;
404 // don't need to worry about conversion, because this is always
405 // from an internal source
406 bool LyXRC::read(istream & is)
408 Lexer lexrc(lyxrcTags);
410 LYXERR(Debug::LYXRC, "Reading istream...");
411 return read(lexrc, false) == ReadOK;
415 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
417 if (lyxerr.debugging(Debug::PARSER))
418 lexrc.printTable(lyxerr);
423 // format prior to 2.0 and introduction of format tag
424 unsigned int format = 0;
426 while (lexrc.isOK()) {
427 // By using two switches we take advantage of the compiler
428 // telling us if we have missed a LyXRCTags element in
429 // the second switch.
430 // Note that this also shows a problem with Lexer since it
431 // helps us avoid taking advantage of the strictness of the
434 int le = lexrc.lex();
436 case Lexer::LEX_UNDEF:
437 lexrc.printError("Unknown tag `$$Token'");
439 case Lexer::LEX_FEOF:
444 switch (static_cast<LyXRCTags>(le)) {
447 format = lexrc.getInteger();
449 case RC_INPUT: // Include file
452 libFileSearch(string(),
454 if (read(tmp, check_format)) {
456 "Error reading included file: " + tmp.absFileName());
462 bind_file = os::internal_path(lexrc.getString());
467 def_file = os::internal_path(lexrc.getString());
472 ui_file = os::internal_path(lexrc.getString());
475 case RC_AUTORESET_OPTIONS:
476 lexrc >> auto_reset_options;
479 case RC_DISPLAY_GRAPHICS:
481 display_graphics = lexrc.getString() == "true";
484 case RC_TEX_EXPECTS_WINDOWS_PATHS:
485 lexrc >> windows_style_tex_paths;
488 case RC_TEX_ALLOWS_SPACES:
489 lexrc >> tex_allows_spaces;
492 case RC_TEXINPUTS_PREFIX:
493 lexrc >> texinputs_prefix;
500 case RC_KBMAP_PRIMARY:
502 string const kmap(os::internal_path(lexrc.getString()));
503 if (!libFileSearch("kbd", kmap, "kmap").empty()
505 primary_kbmap = kmap;
507 lexrc.printError("LyX: Keymap `$$Token' not found");
512 case RC_KBMAP_SECONDARY:
514 string const kmap(os::internal_path(lexrc.getString()));
515 if (!libFileSearch("kbd", kmap, "kmap").empty()
517 secondary_kbmap = kmap;
519 lexrc.printError("LyX: Keymap `$$Token' not found");
524 case RC_FONT_ENCODING:
528 case RC_PRINTLANDSCAPEFLAG:
529 lexrc >> print_landscape_flag;
532 case RC_PRINTPAPERDIMENSIONFLAG:
533 lexrc >> print_paper_dimension_flag;
536 case RC_PRINTPAPERFLAG:
537 lexrc >> print_paper_flag;
540 case RC_VIEWDVI_PAPEROPTION:
542 view_dvi_paper_option = lexrc.getString();
544 view_dvi_paper_option.erase();
547 case RC_CHKTEX_COMMAND:
548 if (lexrc.next(true)) {
549 chktex_command = lexrc.getString();
553 case RC_BIBTEX_ALTERNATIVES:
554 if (lexrc.next(true)) {
555 bibtex_alternatives.insert(lexrc.getString());
559 case RC_BIBTEX_COMMAND:
560 if (lexrc.next(true)) {
561 bibtex_command = lexrc.getString();
565 case RC_JBIBTEX_COMMAND:
566 if (lexrc.next(true)) {
567 jbibtex_command = lexrc.getString();
571 case RC_INDEX_ALTERNATIVES:
572 if (lexrc.next(true)) {
573 index_alternatives.insert(lexrc.getString());
577 case RC_INDEX_COMMAND:
578 if (lexrc.next(true)) {
579 index_command = lexrc.getString();
583 case RC_JINDEX_COMMAND:
584 if (lexrc.next(true)) {
585 jindex_command = lexrc.getString();
589 case RC_SPLITINDEX_COMMAND:
590 if (lexrc.next(true)) {
591 splitindex_command = lexrc.getString();
595 case RC_NOMENCL_COMMAND:
596 if (lexrc.next(true)) {
597 nomencl_command = lexrc.getString();
611 case RC_GEOMETRY_SESSION:
612 lexrc >> allow_geometry_session;
615 case RC_SCREEN_FONT_SIZES:
616 lexrc >> font_sizes[FONT_SIZE_TINY];
617 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
618 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
619 lexrc >> font_sizes[FONT_SIZE_SMALL];
620 lexrc >> font_sizes[FONT_SIZE_NORMAL];
621 lexrc >> font_sizes[FONT_SIZE_LARGE];
622 lexrc >> font_sizes[FONT_SIZE_LARGER];
623 lexrc >> font_sizes[FONT_SIZE_LARGEST];
624 lexrc >> font_sizes[FONT_SIZE_HUGE];
625 lexrc >> font_sizes[FONT_SIZE_HUGER];
628 case RC_SCREEN_FONT_SCALABLE:
629 lexrc >> use_scalable_fonts;
636 case RC_DOCUMENTPATH:
638 document_path = os::internal_path(lexrc.getString());
643 example_path = os::internal_path(lexrc.getString());
646 case RC_TEMPLATEPATH:
648 template_path = os::internal_path(lexrc.getString());
653 tempdir_path = os::internal_path(lexrc.getString());
656 case RC_THESAURUSDIRPATH:
658 thesaurusdir_path = os::internal_path(lexrc.getString());
661 case RC_HUNSPELLDIR_PATH:
663 hunspelldir_path = os::internal_path(lexrc.getString());
666 case RC_USELASTFILEPOS:
667 lexrc >> use_lastfilepos;
671 lexrc >> load_session;
674 case RC_MOUSE_WHEEL_SPEED:
675 lexrc >> mouse_wheel_speed;
678 case RC_COMPLETION_INLINE_DELAY:
679 lexrc >> completion_inline_delay;
682 case RC_COMPLETION_INLINE_MATH:
683 lexrc >> completion_inline_math;
686 case RC_COMPLETION_INLINE_TEXT:
687 lexrc >> completion_inline_text;
690 case RC_COMPLETION_INLINE_DOTS:
691 lexrc >> completion_inline_dots;
694 case RC_AUTOCORRECTION_MATH:
695 lexrc >> autocorrection_math;
698 case RC_COMPLETION_POPUP_DELAY:
699 lexrc >> completion_popup_delay;
702 case RC_COMPLETION_POPUP_MATH:
703 lexrc >> completion_popup_math;
706 case RC_COMPLETION_POPUP_TEXT:
707 lexrc >> completion_popup_text;
710 case RC_COMPLETION_CURSOR_TEXT:
711 lexrc >> completion_cursor_text;
714 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
715 lexrc >> completion_popup_after_complete;
718 case RC_COMPLETION_MINLENGTH:
719 lexrc >> completion_minlength;
722 case RC_NUMLASTFILES:
723 lexrc >> num_lastfiles;
726 case RC_CHECKLASTFILES:
727 lexrc >> check_lastfiles;
734 case RC_USE_SYSTEM_THEME_ICONS:
735 lexrc >> use_system_theme_icons;
738 case RC_SCREEN_FONT_ROMAN:
740 roman_font_name = lexrc.getString();
741 oldFontFormat(roman_font_name,
746 case RC_SCREEN_FONT_SANS:
748 sans_font_name = lexrc.getString();
749 oldFontFormat(sans_font_name, sans_font_foundry);
753 case RC_SCREEN_FONT_TYPEWRITER:
755 typewriter_font_name = lexrc.getString();
756 oldFontFormat(typewriter_font_name,
757 typewriter_font_foundry);
761 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
762 lexrc >> roman_font_foundry;
765 case RC_SCREEN_FONT_SANS_FOUNDRY:
766 lexrc >> sans_font_foundry;
769 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
770 lexrc >> typewriter_font_foundry;
775 lexrc.printError("Missing color tag.");
778 string lyx_name = lexrc.getString();
781 lexrc.printError("Missing color name for color: `$$Token'");
784 string x11_name = lexrc.getString();
786 ColorCode const col =
787 lcolor.getFromLyXName(lyx_name);
788 if (col == Color_none ||
789 col == Color_inherit ||
793 if (!lcolor.setColor(col, x11_name))
794 LYXERR0("Bad lyxrc set_color for " << lyx_name);
798 case RC_AUTOREGIONDELETE:
799 // Auto region delete defaults to true
800 lexrc >> auto_region_delete;
805 lyxpipes = os::internal_path(lexrc.getString());
808 case RC_CURSOR_FOLLOWS_SCROLLBAR:
809 lexrc >> cursor_follows_scrollbar;
812 case RC_CURSOR_WIDTH:
813 lexrc >> cursor_width;
816 case RC_SCROLL_BELOW_DOCUMENT:
817 lexrc >> scroll_below_document;
820 case RC_PARAGRAPH_MARKERS:
821 lexrc >> paragraph_markers;
824 case RC_MAC_DONTSWAP_CTRL_META:
825 lexrc >> mac_dontswap_ctrl_meta;
828 case RC_MAC_LIKE_CURSOR_MOVEMENT:
829 lexrc >> mac_like_cursor_movement;
832 case RC_MACRO_EDIT_STYLE:
834 switch (lexrc.getInteger()) {
835 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
836 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
837 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
842 case RC_DIALOGS_ICONIFY_WITH_MAIN:
843 lexrc >> dialogs_iconify_with_main;
846 case RC_PLAINTEXT_LINELEN:
847 lexrc >> plaintext_linelen;
849 // Spellchecker settings:
850 case RC_ACCEPT_COMPOUND:
851 lexrc >> spellchecker_accept_compound;
853 case RC_USE_SYSTEM_COLORS:
854 lexrc >> use_system_colors;
857 lexrc >> use_tooltip;
859 case RC_USE_PIXMAP_CACHE:
860 lexrc >> use_pixmap_cache;
865 case RC_SPELLCHECKER:
866 lexrc >> spellchecker;
869 lexrc >> spellchecker_alt_lang;
872 lexrc >> spellchecker_esc_chars;
874 case RC_SPELLCHECK_CONTINUOUSLY:
875 lexrc >> spellcheck_continuously;
877 case RC_SPELLCHECK_NOTES:
878 lexrc >> spellcheck_notes;
881 lexrc >> make_backup;
883 case RC_SAVE_COMPRESSED:
884 lexrc >> save_compressed;
887 lexrc >> save_origin;
889 case RC_BACKUPDIR_PATH:
891 backupdir_path = os::internal_path(lexrc.getString());
893 case RC_DEFAULT_DECIMAL_POINT:
894 lexrc >> default_decimal_point;
896 case RC_DEFAULT_LENGTH_UNIT:
898 default_length_unit = (Length::UNIT) lexrc.getInteger();
900 case RC_DATE_INSERT_FORMAT:
901 lexrc >> date_insert_format;
903 case RC_LANGUAGE_CUSTOM_PACKAGE:
904 lexrc >> language_custom_package;
906 case RC_LANGUAGE_AUTO_BEGIN:
907 lexrc >> language_auto_begin;
909 case RC_LANGUAGE_AUTO_END:
910 lexrc >> language_auto_end;
912 case RC_LANGUAGE_GLOBAL_OPTIONS:
913 lexrc >> language_global_options;
915 case RC_LANGUAGE_PACKAGE_SELECTION:
917 switch (lexrc.getInteger()) {
919 language_package_selection = LP_AUTO;
922 language_package_selection = LP_BABEL;
925 language_package_selection = LP_CUSTOM;
928 language_package_selection = LP_NONE;
933 case RC_LANGUAGE_COMMAND_BEGIN:
934 lexrc >> language_command_begin;
936 case RC_LANGUAGE_COMMAND_END:
937 lexrc >> language_command_end;
939 case RC_LANGUAGE_COMMAND_LOCAL:
940 lexrc >> language_command_local;
942 case RC_VISUAL_CURSOR:
943 lexrc >> visual_cursor;
945 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
946 lexrc >> close_buffer_with_last_view;
949 lexrc >> auto_number;
951 case RC_MARK_FOREIGN_LANGUAGE:
952 lexrc >> mark_foreign_language;
958 fmt = lexrc.getString();
959 if (lexrc.next(true))
960 command = lexrc.getString();
961 setMover(fmt, command);
966 string from, to, command, flags;
968 from = lexrc.getString();
970 to = lexrc.getString();
971 if (lexrc.next(true))
972 command = lexrc.getString();
974 flags = lexrc.getString();
976 theConverters().erase(from, to);
978 theConverters().add(from, to, command, flags);
981 // compatibility with versions older than 1.4.0 only
983 string format, command;
984 lexrc >> format >> command;
985 formats.setViewer(format, command);
988 case RC_FILEFORMAT: {
990 string format, extensions, shortcut;
991 docstring prettyname;
992 if (!(lexrc >> format >> extensions))
994 if (ok && lexrc.next(true))
995 prettyname = lexrc.getDocString();
999 if(!(lexrc >> shortcut))
1001 string viewer, editor;
1002 if (ok && lexrc.next(true))
1003 viewer = lexrc.getString();
1006 if (ok && lexrc.next(true))
1007 editor = lexrc.getString();
1011 if (!(lexrc >> flags >> mime))
1013 int flgs = Format::none;
1014 while (!flags.empty()) {
1016 flags = split(flags, flag, ',');
1017 if (flag == "document")
1018 flgs |= Format::document;
1019 else if (flag == "vector")
1020 flgs |= Format::vector;
1021 else if (flag == "zipped=native")
1022 flgs |= Format::zipped_native;
1023 else if (flag == "menu=export")
1024 flgs |= Format::export_menu;
1026 LYXERR0("Ignoring unknown flag `"
1027 << flag << "' for format `"
1031 LYXERR0("Syntax error in format " << format);
1032 else if (prettyname.empty()) {
1033 if (theConverters().formatIsUsed(format))
1034 LYXERR0("Can't delete format " << format);
1036 formats.erase(format);
1038 formats.add(format, extensions, prettyname,
1039 shortcut, viewer, editor, mime, flgs);
1043 case RC_VIEWER_ALTERNATIVES: {
1044 string format, command;
1045 if ((lexrc >> format) && lexrc.next(true)) {
1046 command = lexrc.getString();
1047 viewer_alternatives[format].insert(command);
1051 case RC_EDITOR_ALTERNATIVES: {
1052 string format, command;
1053 if ((lexrc >> format) && lexrc.next(true)) {
1054 command = lexrc.getString();
1055 editor_alternatives[format].insert(command);
1060 case RC_DEFAULT_OTF_VIEW_FORMAT:
1061 lexrc >> default_otf_view_format;
1064 case RC_DEFAULT_VIEW_FORMAT:
1065 lexrc >> default_view_format;
1068 case RC_GUI_LANGUAGE:
1069 lexrc >> gui_language;
1072 case RC_SHOW_BANNER:
1073 lexrc >> show_banner;
1078 string const tmp = lexrc.getString();
1079 if (tmp == "true" || tmp == "on")
1080 preview = PREVIEW_ON;
1081 else if (tmp == "no_math")
1082 preview = PREVIEW_NO_MATH;
1084 preview = PREVIEW_OFF;
1085 if (tmp != "false" && tmp != "off")
1086 LYXERR0("Unrecognized preview status \""
1092 case RC_PREVIEW_HASHED_LABELS:
1093 lexrc >> preview_hashed_labels;
1096 case RC_PREVIEW_SCALE_FACTOR:
1097 lexrc >> preview_scale_factor;
1104 lexrc >> user_email;
1107 case RC_PATH_PREFIX:
1108 lexrc >> path_prefix;
1111 case RC_USE_CONVERTER_CACHE:
1112 lexrc >> use_converter_cache;
1114 case RC_CONVERTER_CACHE_MAXAGE:
1115 lexrc >> converter_cache_maxage;
1118 case RC_SORT_LAYOUTS:
1119 lexrc >> sort_layouts;
1121 case RC_GROUP_LAYOUTS:
1122 lexrc >> group_layouts;
1124 case RC_FULL_SCREEN_LIMIT:
1125 lexrc >> full_screen_limit;
1127 case RC_FULL_SCREEN_TOOLBARS:
1128 lexrc >> full_screen_toolbars;
1130 case RC_FULL_SCREEN_SCROLLBAR:
1131 lexrc >> full_screen_scrollbar;
1133 case RC_FULL_SCREEN_STATUSBAR:
1134 lexrc >> full_screen_statusbar;
1136 case RC_FULL_SCREEN_TABBAR:
1137 lexrc >> full_screen_tabbar;
1139 case RC_FULL_SCREEN_MENUBAR:
1140 lexrc >> full_screen_menubar;
1142 case RC_FULL_SCREEN_WIDTH:
1143 lexrc >> full_screen_width;
1145 case RC_OPEN_BUFFERS_IN_TABS:
1146 lexrc >> open_buffers_in_tabs;
1148 case RC_SINGLE_CLOSE_TAB_BUTTON:
1149 lexrc >> single_close_tab_button;
1151 case RC_SINGLE_INSTANCE:
1152 lexrc >> single_instance;
1153 if (run_mode == PREFERRED)
1154 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1156 case RC_FORWARD_SEARCH_DVI:
1157 if (lexrc.next(true))
1158 forward_search_dvi = lexrc.getString();
1160 case RC_FORWARD_SEARCH_PDF:
1161 if (lexrc.next(true))
1162 forward_search_pdf = lexrc.getString();
1164 case RC_EXPORT_OVERWRITE:
1166 string const tmp = lexrc.getString();
1167 if (tmp == "all" || tmp == "true")
1168 export_overwrite = ALL_FILES;
1169 else if (tmp == "main")
1170 export_overwrite = MAIN_FILE;
1172 export_overwrite = NO_FILES;
1173 if (tmp != "ask" && tmp != "false")
1174 LYXERR0("Unrecognized export_overwrite status \""
1179 case RC_SCROLL_WHEEL_ZOOM:
1181 string const tmp = lexrc.getString();
1183 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1184 else if (tmp == "shift")
1185 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1186 else if (tmp == "alt")
1187 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1189 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1190 if (tmp != "off" && tmp != "false")
1191 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1197 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1198 lexrc >> mouse_middlebutton_paste;
1202 break; // this is just a dummy
1205 // This is triggered the first time through the loop unless
1206 // we hit a format tag.
1207 if (check_format && format != LYXRC_FILEFORMAT)
1208 return FormatMismatch;
1211 /// Update converters data-structures
1212 theConverters().update(formats);
1213 theConverters().buildGraph();
1219 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1221 ofstream ofs(filename.toFilesystemEncoding().c_str());
1223 write(ofs, ignore_system_lyxrc);
1227 void LyXRC::print() const
1229 if (lyxerr.debugging())
1230 write(lyxerr, false);
1238 typedef pair<string, SpecialisedMover> Data;
1240 SameMover(Data const & comparison)
1241 : comparison_(comparison) {}
1243 bool operator()(Data const & data) const
1245 return data.first == comparison_.first &&
1246 data.second.command() == comparison_.second.command();
1256 // Escape \ and " so that LyXLex can read the string later
1257 string escapeCommand(string const & str) {
1258 return subst(subst(str , "\\", "\\\\"),
1265 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1267 LyXRCTags tag = RC_LAST;
1269 if (!name.empty()) {
1270 for (int i = 0; i != lyxrcCount; ++i)
1271 if ("\\" + name == lyxrcTags[i].tag)
1272 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1276 os << "# LyX " << lyx_version
1277 << " generated this file. If you want to make your own\n"
1278 << "# modifications you should do them from inside LyX and save.\n\n"
1279 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1281 // Why the switch you might ask. It is a trick to ensure that all
1282 // the elements in the LyXRCTags enum are handled. As you can see
1283 // there are no breaks at all. So it is just a huge fall-through.
1284 // The nice thing is that we will get a warning from the compiler
1285 // if we forget an element.
1289 // input/include files are not done here
1290 case RC_LYXRCFORMAT:
1292 if (ignore_system_lyxrc ||
1293 bind_file != system_lyxrc.bind_file) {
1294 string const path = os::external_path(bind_file);
1295 os << "\\bind_file \"" << path << "\"\n";
1301 if (ignore_system_lyxrc ||
1302 def_file != system_lyxrc.def_file) {
1303 string const path = os::external_path(def_file);
1304 os << "\\def_file \"" << path << "\"\n";
1313 << "# MISC SECTION ######################################\n"
1315 // bind files are not done here.
1317 case RC_PATH_PREFIX:
1318 if (ignore_system_lyxrc ||
1319 path_prefix != system_lyxrc.path_prefix) {
1320 os << "\\path_prefix \"" << path_prefix << "\"\n";
1325 if (ignore_system_lyxrc ||
1326 ui_file != system_lyxrc.ui_file) {
1327 string const path = os::external_path(ui_file);
1328 os << "\\ui_file \"" << path << "\"\n";
1332 case RC_AUTOREGIONDELETE:
1333 if (ignore_system_lyxrc ||
1334 auto_region_delete != system_lyxrc.auto_region_delete) {
1335 os << "# Set to false to inhibit automatic replacement of\n"
1336 << "# the current selection.\n"
1337 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1342 case RC_AUTORESET_OPTIONS:
1343 if (ignore_system_lyxrc ||
1344 auto_reset_options != system_lyxrc.auto_reset_options) {
1345 os << "# Set to false to inhibit automatic reset of\n"
1346 << "# the class options to defaults on class change.\n"
1347 << "\\auto_reset_options "
1348 << convert<string>(auto_reset_options)
1354 if (ignore_system_lyxrc ||
1355 autosave != system_lyxrc.autosave) {
1356 os << "# The time interval between auto-saves in seconds.\n"
1357 << "\\autosave " << autosave << '\n';
1361 case RC_DISPLAY_GRAPHICS:
1362 if (ignore_system_lyxrc ||
1363 display_graphics != system_lyxrc.display_graphics) {
1364 os << "# Display graphics within LyX\n"
1366 << "\\display_graphics "
1367 << (display_graphics ? "true" : "false")
1372 case RC_SORT_LAYOUTS:
1373 if (ignore_system_lyxrc ||
1374 sort_layouts != system_lyxrc.sort_layouts) {
1375 os << "# Sort layouts alphabetically.\n"
1376 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1380 case RC_GROUP_LAYOUTS:
1381 if (ignore_system_lyxrc ||
1382 group_layouts != system_lyxrc.group_layouts) {
1383 os << "# Group layouts by their category.\n"
1384 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1388 case RC_VIEWDVI_PAPEROPTION:
1389 if (ignore_system_lyxrc ||
1390 view_dvi_paper_option
1391 != system_lyxrc.view_dvi_paper_option) {
1392 os << "# Options used to specify paper size to the\n"
1393 << "# view_dvi_command (e.g. -paper)\n"
1394 << "\\view_dvi_paper_option \""
1395 << view_dvi_paper_option << "\"\n";
1399 case RC_CHKTEX_COMMAND:
1400 if (ignore_system_lyxrc ||
1401 chktex_command != system_lyxrc.chktex_command) {
1402 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1406 case RC_BIBTEX_ALTERNATIVES: {
1407 CommandSet::const_iterator it = bibtex_alternatives.begin();
1408 CommandSet::const_iterator end = bibtex_alternatives.end();
1409 for ( ; it != end; ++it) {
1410 if (ignore_system_lyxrc
1411 || !system_lyxrc.bibtex_alternatives.count(*it))
1412 os << "\\bibtex_alternatives \""
1418 case RC_BIBTEX_COMMAND:
1419 if (ignore_system_lyxrc ||
1420 bibtex_command != system_lyxrc.bibtex_command) {
1421 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1425 case RC_JBIBTEX_COMMAND:
1426 if (ignore_system_lyxrc ||
1427 jbibtex_command != system_lyxrc.jbibtex_command) {
1428 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1432 case RC_INDEX_ALTERNATIVES: {
1433 CommandSet::const_iterator it = index_alternatives.begin();
1434 CommandSet::const_iterator end = index_alternatives.end();
1435 for ( ; it != end; ++it) {
1436 if (ignore_system_lyxrc
1437 || !system_lyxrc.index_alternatives.count(*it))
1438 os << "\\index_alternatives \""
1444 case RC_INDEX_COMMAND:
1445 if (ignore_system_lyxrc ||
1446 index_command != system_lyxrc.index_command) {
1447 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1451 case RC_JINDEX_COMMAND:
1452 if (ignore_system_lyxrc ||
1453 jindex_command != system_lyxrc.jindex_command) {
1454 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1458 case RC_SPLITINDEX_COMMAND:
1459 if (ignore_system_lyxrc ||
1460 splitindex_command != system_lyxrc.splitindex_command) {
1461 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1465 case RC_NOMENCL_COMMAND:
1466 if (ignore_system_lyxrc ||
1467 nomencl_command != system_lyxrc.nomencl_command) {
1468 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1472 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1473 // Don't write this setting to the preferences file,
1474 // but allow temporary changes (bug 7557).
1475 if (ignore_system_lyxrc) {
1476 os << "\\tex_expects_windows_paths "
1477 << convert<string>(windows_style_tex_paths) << '\n';
1481 case RC_TEX_ALLOWS_SPACES:
1482 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1483 os << "\\tex_allows_spaces "
1484 << convert<string>(tex_allows_spaces) << '\n';
1489 if (ignore_system_lyxrc ||
1490 use_kbmap != system_lyxrc.use_kbmap) {
1491 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1495 case RC_KBMAP_PRIMARY:
1496 if (ignore_system_lyxrc ||
1497 primary_kbmap != system_lyxrc.primary_kbmap) {
1498 string const path = os::external_path(primary_kbmap);
1499 os << "\\kbmap_primary \"" << path << "\"\n";
1503 case RC_KBMAP_SECONDARY:
1504 if (ignore_system_lyxrc ||
1505 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1506 string const path = os::external_path(secondary_kbmap);
1507 os << "\\kbmap_secondary \"" << path << "\"\n";
1512 if (ignore_system_lyxrc ||
1513 lyxpipes != system_lyxrc.lyxpipes) {
1514 string const path = os::external_path(lyxpipes);
1515 os << "\\serverpipe \"" << path << "\"\n";
1519 case RC_DATE_INSERT_FORMAT:
1520 if (ignore_system_lyxrc ||
1521 date_insert_format != system_lyxrc.date_insert_format) {
1522 os << "\\date_insert_format \"" << date_insert_format
1529 os << "\\user_name \"" << user_name << "\"\n";
1534 os << "\\user_email \"" << user_email << "\"\n";
1538 case RC_SHOW_BANNER:
1539 if (ignore_system_lyxrc ||
1540 show_banner != system_lyxrc.show_banner) {
1541 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1547 if (ignore_system_lyxrc ||
1548 preview != system_lyxrc.preview) {
1554 case PREVIEW_NO_MATH:
1561 os << "\\preview " << status << '\n';
1566 case RC_PREVIEW_HASHED_LABELS:
1567 if (ignore_system_lyxrc ||
1568 preview_hashed_labels !=
1569 system_lyxrc.preview_hashed_labels) {
1570 os << "\\preview_hashed_labels "
1571 << convert<string>(preview_hashed_labels) << '\n';
1576 case RC_PREVIEW_SCALE_FACTOR:
1577 if (ignore_system_lyxrc ||
1578 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1579 os << "\\preview_scale_factor "
1580 << preview_scale_factor << '\n';
1585 case RC_USE_CONVERTER_CACHE:
1586 if (ignore_system_lyxrc ||
1587 use_converter_cache != system_lyxrc.use_converter_cache) {
1588 os << "\\use_converter_cache "
1589 << convert<string>(use_converter_cache) << '\n';
1594 case RC_CONVERTER_CACHE_MAXAGE:
1595 if (ignore_system_lyxrc ||
1596 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1597 os << "\\converter_cache_maxage "
1598 << converter_cache_maxage << '\n';
1604 << "# SCREEN & FONTS SECTION ############################\n"
1608 if (ignore_system_lyxrc ||
1609 icon_set != system_lyxrc.icon_set) {
1610 os << "\\icon_set \"" << icon_set
1616 case RC_USE_SYSTEM_THEME_ICONS:
1617 if (ignore_system_lyxrc ||
1618 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1619 os << "\\use_system_theme_icons "
1620 << convert<string>(use_system_theme_icons)
1627 if (ignore_system_lyxrc ||
1628 dpi != system_lyxrc.dpi) {
1629 os << "\\screen_dpi " << dpi << '\n';
1633 case RC_SCREEN_ZOOM:
1634 if (ignore_system_lyxrc ||
1635 zoom != system_lyxrc.zoom) {
1636 os << "\\screen_zoom " << zoom << '\n';
1640 case RC_GEOMETRY_SESSION:
1641 if (ignore_system_lyxrc ||
1642 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1643 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1648 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1649 if (ignore_system_lyxrc ||
1650 cursor_follows_scrollbar
1651 != system_lyxrc.cursor_follows_scrollbar) {
1652 os << "\\cursor_follows_scrollbar "
1653 << convert<string>(cursor_follows_scrollbar) << '\n';
1657 case RC_CURSOR_WIDTH:
1658 if (ignore_system_lyxrc ||
1660 != system_lyxrc.cursor_width) {
1661 os << "\\cursor_width "
1662 << cursor_width << '\n';
1666 case RC_SCROLL_BELOW_DOCUMENT:
1667 if (ignore_system_lyxrc ||
1668 scroll_below_document
1669 != system_lyxrc.scroll_below_document) {
1670 os << "\\scroll_below_document "
1671 << convert<string>(scroll_below_document) << '\n';
1675 case RC_PARAGRAPH_MARKERS:
1676 if (ignore_system_lyxrc ||
1678 != system_lyxrc.paragraph_markers) {
1679 os << "\\paragraph_markers "
1680 << convert<string>(paragraph_markers) << '\n';
1684 case RC_MAC_DONTSWAP_CTRL_META:
1685 if (ignore_system_lyxrc ||
1686 mac_dontswap_ctrl_meta
1687 != system_lyxrc.mac_dontswap_ctrl_meta) {
1688 os << "\\mac_dontswap_ctrl_meta "
1689 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1693 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1694 if (ignore_system_lyxrc ||
1695 mac_like_cursor_movement
1696 != system_lyxrc.mac_like_cursor_movement) {
1697 os << "\\mac_like_cursor_movement "
1698 << convert<string>(mac_like_cursor_movement) << '\n';
1702 case RC_MACRO_EDIT_STYLE:
1703 if (ignore_system_lyxrc ||
1705 != system_lyxrc.macro_edit_style) {
1706 os << "\\macro_edit_style ";
1707 switch (macro_edit_style) {
1708 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1709 case MACRO_EDIT_INLINE: os << "1\n"; break;
1710 case MACRO_EDIT_LIST: os << "2\n"; break;
1715 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1716 if (ignore_system_lyxrc ||
1717 dialogs_iconify_with_main
1718 != system_lyxrc.dialogs_iconify_with_main) {
1719 os << "\\dialogs_iconify_with_main "
1720 << convert<string>(dialogs_iconify_with_main) << '\n';
1724 case RC_SCREEN_FONT_ROMAN:
1725 if (ignore_system_lyxrc ||
1726 roman_font_name != system_lyxrc.roman_font_name) {
1727 os << "\\screen_font_roman \"" << roman_font_name
1732 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1733 if (ignore_system_lyxrc ||
1734 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1735 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1740 case RC_SCREEN_FONT_SANS:
1741 if (ignore_system_lyxrc ||
1742 sans_font_name != system_lyxrc.sans_font_name) {
1743 os << "\\screen_font_sans \"" << sans_font_name
1748 case RC_SCREEN_FONT_SANS_FOUNDRY:
1749 if (ignore_system_lyxrc ||
1750 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1751 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1756 case RC_SCREEN_FONT_TYPEWRITER:
1757 if (ignore_system_lyxrc ||
1758 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1759 os << "\\screen_font_typewriter \""
1760 << typewriter_font_name << "\"\n";
1764 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1765 if (ignore_system_lyxrc ||
1766 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1767 os << "\\screen_font_typewriter_foundry \""
1768 << typewriter_font_foundry << "\"\n";
1773 case RC_SCREEN_FONT_SCALABLE:
1774 if (ignore_system_lyxrc ||
1775 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1776 os << "\\screen_font_scalable "
1777 << convert<string>(use_scalable_fonts)
1782 case RC_SCREEN_FONT_SIZES:
1783 if (ignore_system_lyxrc ||
1784 font_sizes[FONT_SIZE_TINY]
1785 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1786 font_sizes[FONT_SIZE_SCRIPT]
1787 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1788 font_sizes[FONT_SIZE_FOOTNOTE]
1789 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1790 font_sizes[FONT_SIZE_SMALL]
1791 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1792 font_sizes[FONT_SIZE_NORMAL]
1793 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1794 font_sizes[FONT_SIZE_LARGE]
1795 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1796 font_sizes[FONT_SIZE_LARGER]
1797 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1798 font_sizes[FONT_SIZE_LARGEST]
1799 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1800 font_sizes[FONT_SIZE_HUGE]
1801 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1802 font_sizes[FONT_SIZE_HUGER]
1803 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1804 streamsize old_prec = os.precision();
1805 os.setf(ios::fixed);
1807 os << "\\screen_font_sizes"
1808 << ' ' << font_sizes[FONT_SIZE_TINY]
1809 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1810 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1811 << ' ' << font_sizes[FONT_SIZE_SMALL]
1812 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1813 << ' ' << font_sizes[FONT_SIZE_LARGE]
1814 << ' ' << font_sizes[FONT_SIZE_LARGER]
1815 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1816 << ' ' << font_sizes[FONT_SIZE_HUGE]
1817 << ' ' << font_sizes[FONT_SIZE_HUGER]
1819 os.precision(old_prec);
1820 os.unsetf(ios::fixed);
1824 case RC_FULL_SCREEN_LIMIT:
1825 if (ignore_system_lyxrc ||
1826 full_screen_limit != system_lyxrc.full_screen_limit) {
1827 os << "\\fullscreen_limit "
1828 << convert<string>(full_screen_limit)
1833 case RC_FULL_SCREEN_TOOLBARS:
1834 if (ignore_system_lyxrc ||
1835 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1836 os << "\\fullscreen_toolbars "
1837 << convert<string>(full_screen_toolbars)
1842 case RC_FULL_SCREEN_SCROLLBAR:
1843 if (ignore_system_lyxrc ||
1844 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1845 os << "\\fullscreen_scrollbar "
1846 << convert<string>(full_screen_scrollbar)
1851 case RC_FULL_SCREEN_STATUSBAR:
1852 if (ignore_system_lyxrc ||
1853 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1854 os << "\\fullscreen_statusbar "
1855 << convert<string>(full_screen_statusbar)
1860 case RC_FULL_SCREEN_TABBAR:
1861 if (ignore_system_lyxrc ||
1862 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1863 os << "\\fullscreen_tabbar "
1864 << convert<string>(full_screen_tabbar)
1869 case RC_FULL_SCREEN_MENUBAR:
1870 if (ignore_system_lyxrc ||
1871 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1872 os << "\\fullscreen_menubar "
1873 << convert<string>(full_screen_menubar)
1878 case RC_FULL_SCREEN_WIDTH:
1879 if (ignore_system_lyxrc ||
1880 full_screen_width != system_lyxrc.full_screen_width) {
1881 os << "\\fullscreen_width "
1882 << convert<string>(full_screen_width)
1887 case RC_OPEN_BUFFERS_IN_TABS:
1888 if (ignore_system_lyxrc ||
1889 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1890 os << "\\open_buffers_in_tabs "
1891 << convert<string>(open_buffers_in_tabs)
1896 case RC_SINGLE_CLOSE_TAB_BUTTON:
1897 if (ignore_system_lyxrc ||
1898 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1899 os << "\\single_close_tab_button "
1900 << convert<string>(single_close_tab_button)
1905 case RC_SINGLE_INSTANCE:
1906 if (ignore_system_lyxrc ||
1907 single_instance != system_lyxrc.single_instance) {
1908 os << "\\single_instance "
1909 << convert<string>(single_instance)
1914 case RC_FORWARD_SEARCH_DVI:
1915 if (ignore_system_lyxrc ||
1916 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1917 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1921 case RC_FORWARD_SEARCH_PDF:
1922 if (ignore_system_lyxrc ||
1923 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1924 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1930 << "# COLOR SECTION ###################################\n"
1934 for (int i = 0; i < Color_ignore; ++i) {
1935 ColorCode lc = static_cast<ColorCode>(i);
1936 string const col = lcolor.getX11Name(lc);
1937 if (ignore_system_lyxrc
1938 || col != system_lcolor.getX11Name(lc)) {
1939 os << "\\set_color \""
1940 << lcolor.getLyXName(lc) << "\" \""
1948 << "# PRINTER SECTION ###################################\n"
1951 case RC_PRINTLANDSCAPEFLAG:
1952 if (ignore_system_lyxrc ||
1953 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1954 os << "\\print_landscape_flag \"" << print_landscape_flag
1960 case RC_PRINTPAPERFLAG:
1961 if (ignore_system_lyxrc ||
1962 print_paper_flag != system_lyxrc.print_paper_flag) {
1963 os << "\\print_paper_flag \"" << print_paper_flag
1969 case RC_PRINTPAPERDIMENSIONFLAG:
1970 if (ignore_system_lyxrc ||
1971 print_paper_dimension_flag
1972 != system_lyxrc.print_paper_dimension_flag) {
1973 os << "\\print_paper_dimension_flag \""
1974 << print_paper_dimension_flag << "\"\n";
1980 << "# TEX SECTION #######################################\n"
1983 case RC_TEXINPUTS_PREFIX:
1984 if (ignore_system_lyxrc ||
1985 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1986 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1991 case RC_FONT_ENCODING:
1992 if (ignore_system_lyxrc ||
1993 fontenc != system_lyxrc.fontenc) {
1994 os << "\\font_encoding \"" << fontenc << "\"\n";
2000 << "# FILE SECTION ######################################\n"
2003 case RC_DOCUMENTPATH:
2004 if (ignore_system_lyxrc ||
2005 document_path != system_lyxrc.document_path) {
2006 string const path = os::external_path(document_path);
2007 os << "\\document_path \"" << path << "\"\n";
2011 case RC_USELASTFILEPOS:
2012 if (ignore_system_lyxrc ||
2013 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2014 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2019 case RC_LOADSESSION:
2020 if (ignore_system_lyxrc ||
2021 load_session != system_lyxrc.load_session) {
2022 os << "\\load_session " << convert<string>(load_session)
2027 case RC_MOUSE_WHEEL_SPEED:
2028 if (ignore_system_lyxrc ||
2029 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2030 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2034 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2035 if (ignore_system_lyxrc ||
2036 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2037 os << "\\mouse_middlebutton_paste "
2038 << convert<string>(mouse_middlebutton_paste) << '\n';
2042 case RC_COMPLETION_INLINE_DELAY:
2043 if (ignore_system_lyxrc ||
2044 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2045 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2049 case RC_COMPLETION_INLINE_MATH:
2050 if (ignore_system_lyxrc ||
2051 completion_inline_math != system_lyxrc.completion_inline_math) {
2052 os << "\\completion_inline_math "
2053 << convert<string>(completion_inline_math) << '\n';
2057 case RC_COMPLETION_INLINE_TEXT:
2058 if (ignore_system_lyxrc ||
2059 completion_inline_text != system_lyxrc.completion_inline_text) {
2060 os << "\\completion_inline_text "
2061 << convert<string>(completion_inline_text) << '\n';
2065 case RC_COMPLETION_INLINE_DOTS:
2066 if (ignore_system_lyxrc ||
2067 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2068 os << "\\completion_inline_dots "
2069 << convert<string>(completion_inline_dots) << '\n';
2073 case RC_AUTOCORRECTION_MATH:
2074 if (ignore_system_lyxrc ||
2075 autocorrection_math != system_lyxrc.autocorrection_math) {
2076 os << "\\autocorrection_math "
2077 << convert<string>(autocorrection_math) << '\n';
2081 case RC_COMPLETION_POPUP_DELAY:
2082 if (ignore_system_lyxrc ||
2083 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2084 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2088 case RC_COMPLETION_POPUP_MATH:
2089 if (ignore_system_lyxrc ||
2090 completion_popup_math != system_lyxrc.completion_popup_math) {
2091 os << "\\completion_popup_math "
2092 << convert<string>(completion_popup_math) << '\n';
2096 case RC_COMPLETION_POPUP_TEXT:
2097 if (ignore_system_lyxrc ||
2098 completion_popup_text != system_lyxrc.completion_popup_text) {
2099 os << "\\completion_popup_text "
2100 << convert<string>(completion_popup_text) << '\n';
2104 case RC_COMPLETION_CURSOR_TEXT:
2105 if (ignore_system_lyxrc ||
2106 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2107 os << "\\completion_cursor_text "
2108 << convert<string>(completion_cursor_text) << '\n';
2112 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2113 if (ignore_system_lyxrc ||
2114 completion_popup_after_complete
2115 != system_lyxrc.completion_popup_after_complete) {
2116 os << "\\completion_popup_after_complete "
2117 << convert<string>(completion_popup_after_complete) << '\n';
2121 case RC_COMPLETION_MINLENGTH:
2122 if (ignore_system_lyxrc ||
2123 completion_minlength != system_lyxrc.completion_minlength) {
2124 os << "\\completion_minlength " << convert<string>(completion_minlength)
2130 case RC_NUMLASTFILES:
2131 if (ignore_system_lyxrc ||
2132 num_lastfiles != system_lyxrc.num_lastfiles) {
2133 os << "\\num_lastfiles " << num_lastfiles << '\n';
2137 case RC_CHECKLASTFILES:
2138 if (ignore_system_lyxrc ||
2139 check_lastfiles != system_lyxrc.check_lastfiles) {
2140 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2145 case RC_EXAMPLEPATH:
2146 if (ignore_system_lyxrc ||
2147 example_path != system_lyxrc.example_path) {
2148 string const path = os::external_path(example_path);
2149 os << "\\example_path \"" << path << "\"\n";
2153 case RC_TEMPLATEPATH:
2154 if (ignore_system_lyxrc ||
2155 template_path != system_lyxrc.template_path) {
2156 string const path = os::external_path(template_path);
2157 os << "\\template_path \"" << path << "\"\n";
2161 case RC_TEMPDIRPATH:
2162 if (ignore_system_lyxrc ||
2163 tempdir_path != system_lyxrc.tempdir_path) {
2164 string const path = os::external_path(tempdir_path);
2165 os << "\\tempdir_path \"" << path << "\"\n";
2169 case RC_THESAURUSDIRPATH:
2170 if (ignore_system_lyxrc ||
2171 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2172 string const path = os::external_path(thesaurusdir_path);
2173 os << "\\thesaurusdir_path \"" << path << "\"\n";
2177 case RC_HUNSPELLDIR_PATH:
2178 if (ignore_system_lyxrc ||
2179 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2180 string const path = os::external_path(hunspelldir_path);
2181 os << "\\hunspelldir_path \"" << path << "\"\n";
2185 case RC_PLAINTEXT_LINELEN:
2186 if (ignore_system_lyxrc ||
2187 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2188 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2192 case RC_MAKE_BACKUP:
2193 if (ignore_system_lyxrc ||
2194 make_backup != system_lyxrc.make_backup) {
2195 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2199 case RC_SAVE_COMPRESSED:
2200 if (ignore_system_lyxrc ||
2201 save_compressed != system_lyxrc.save_compressed) {
2202 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2206 case RC_SAVE_ORIGIN:
2207 if (ignore_system_lyxrc ||
2208 save_origin != system_lyxrc.save_origin) {
2209 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2213 case RC_BACKUPDIR_PATH:
2214 if (ignore_system_lyxrc ||
2215 backupdir_path != system_lyxrc.backupdir_path) {
2216 string const path = os::external_path(backupdir_path);
2217 os << "\\backupdir_path \"" << path << "\"\n";
2223 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2227 << "# SPELLCHECKER SECTION ##############################\n"
2230 case RC_ACCEPT_COMPOUND:
2231 if (ignore_system_lyxrc ||
2232 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2233 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2239 if (ignore_system_lyxrc ||
2240 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2241 os << "\\alternate_language \"" << spellchecker_alt_lang
2247 if (ignore_system_lyxrc ||
2248 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2249 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2253 case RC_USE_SYSTEM_COLORS:
2254 if (ignore_system_lyxrc ||
2255 use_system_colors != system_lyxrc.use_system_colors) {
2256 os << "\\use_system_colors "
2257 << convert<string>(use_system_colors)
2262 case RC_USE_TOOLTIP:
2263 if (ignore_system_lyxrc ||
2264 use_tooltip != system_lyxrc.use_tooltip) {
2265 os << "\\use_tooltip "
2266 << convert<string>(use_tooltip)
2271 case RC_USE_PIXMAP_CACHE:
2272 if (ignore_system_lyxrc ||
2273 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2274 os << "\\use_pixmap_cache "
2275 << convert<string>(use_pixmap_cache)
2281 if (ignore_system_lyxrc ||
2282 use_qimage != system_lyxrc.use_qimage) {
2283 os << "\\use_qimage "
2284 << convert<string>(use_qimage)
2291 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2294 case RC_DEFAULT_DECIMAL_POINT:
2295 if (ignore_system_lyxrc ||
2296 default_decimal_point != system_lyxrc.default_decimal_point) {
2297 os << "\\default_decimal_point " << default_decimal_point << '\n';
2302 case RC_DEFAULT_LENGTH_UNIT:
2303 if (ignore_system_lyxrc ||
2304 default_length_unit != system_lyxrc.default_length_unit) {
2305 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2310 case RC_SPELLCHECKER:
2311 if (ignore_system_lyxrc ||
2312 spellchecker != system_lyxrc.spellchecker) {
2313 os << "\\spellchecker " << spellchecker << '\n';
2318 case RC_SPELLCHECK_CONTINUOUSLY:
2319 if (ignore_system_lyxrc ||
2320 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2321 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2327 case RC_SPELLCHECK_NOTES:
2328 if (ignore_system_lyxrc ||
2329 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2330 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2336 case RC_VISUAL_CURSOR:
2337 if (ignore_system_lyxrc ||
2338 visual_cursor != system_lyxrc.visual_cursor) {
2339 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2343 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2344 if (ignore_system_lyxrc ||
2345 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2346 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2347 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2351 case RC_LANGUAGE_CUSTOM_PACKAGE:
2352 if (ignore_system_lyxrc ||
2353 language_custom_package != system_lyxrc.language_custom_package) {
2354 os << "\\language_custom_package \"" << language_custom_package
2359 case RC_LANGUAGE_GLOBAL_OPTIONS:
2360 if (ignore_system_lyxrc ||
2361 language_global_options
2362 != system_lyxrc.language_global_options) {
2363 os << "\\language_global_options \""
2364 << convert<string>(language_global_options)
2369 case RC_LANGUAGE_PACKAGE_SELECTION:
2370 if (ignore_system_lyxrc ||
2371 language_package_selection != system_lyxrc.language_package_selection) {
2372 os << "\\language_package_selection ";
2373 switch (language_package_selection) {
2390 case RC_LANGUAGE_COMMAND_BEGIN:
2391 if (ignore_system_lyxrc ||
2392 language_command_begin
2393 != system_lyxrc.language_command_begin) {
2394 os << "\\language_command_begin \""
2395 << language_command_begin
2400 case RC_LANGUAGE_COMMAND_END:
2401 if (ignore_system_lyxrc ||
2402 language_command_end
2403 != system_lyxrc.language_command_end) {
2404 os << "\\language_command_end \"" << language_command_end
2409 case RC_LANGUAGE_COMMAND_LOCAL:
2410 if (ignore_system_lyxrc ||
2411 language_command_local
2412 != system_lyxrc.language_command_local) {
2413 os << "\\language_command_local \""
2414 << language_command_local
2419 case RC_LANGUAGE_AUTO_BEGIN:
2420 if (ignore_system_lyxrc ||
2421 language_auto_begin != system_lyxrc.language_auto_begin) {
2422 os << "\\language_auto_begin "
2423 << convert<string>(language_auto_begin) << '\n';
2427 case RC_LANGUAGE_AUTO_END:
2428 if (ignore_system_lyxrc ||
2429 language_auto_end != system_lyxrc.language_auto_end) {
2430 os << "\\language_auto_end "
2431 << convert<string>(language_auto_end) << '\n';
2435 case RC_MARK_FOREIGN_LANGUAGE:
2436 if (ignore_system_lyxrc ||
2437 mark_foreign_language
2438 != system_lyxrc.mark_foreign_language) {
2439 os << "\\mark_foreign_language " <<
2440 convert<string>(mark_foreign_language) << '\n';
2446 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2449 case RC_AUTO_NUMBER:
2450 if (ignore_system_lyxrc ||
2451 auto_number != system_lyxrc.auto_number) {
2452 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2456 case RC_GUI_LANGUAGE:
2457 if (ignore_system_lyxrc ||
2458 gui_language != system_lyxrc.gui_language) {
2459 os << "\\gui_language " << gui_language << '\n';
2463 case RC_EXPORT_OVERWRITE:
2464 if (ignore_system_lyxrc ||
2465 export_overwrite != system_lyxrc.export_overwrite) {
2467 switch (export_overwrite) {
2478 os << "\\export_overwrite " << status << '\n';
2483 case RC_SCROLL_WHEEL_ZOOM:
2484 if (ignore_system_lyxrc ||
2485 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2487 switch (scroll_wheel_zoom) {
2488 case SCROLL_WHEEL_ZOOM_OFF:
2491 case SCROLL_WHEEL_ZOOM_CTRL:
2494 case SCROLL_WHEEL_ZOOM_SHIFT:
2497 case SCROLL_WHEEL_ZOOM_ALT:
2501 os << "\\scroll_wheel_zoom " << status << '\n';
2507 << "# FORMATS SECTION ##########################\n"
2511 // New/modified formats
2512 for (Formats::const_iterator cit = formats.begin();
2513 cit != formats.end(); ++cit) {
2514 Format const * format =
2515 system_formats.getFormat(cit->name());
2517 format->extensions() != cit->extensions() ||
2518 format->prettyname() != cit->prettyname() ||
2519 format->shortcut() != cit->shortcut() ||
2520 format->viewer() != cit->viewer() ||
2521 format->editor() != cit->editor() ||
2522 format->documentFormat() != cit->documentFormat() ||
2523 format->vectorFormat() != cit->vectorFormat() ||
2524 format->inExportMenu() != cit->inExportMenu() ||
2525 format->mime() != cit->mime()) {
2526 os << "\\format \"" << cit->name() << "\" \""
2527 << cit->extensions() << "\" \""
2528 << to_utf8(cit->prettyname()) << "\" \""
2529 << cit->shortcut() << "\" \""
2530 << escapeCommand(cit->viewer()) << "\" \""
2531 << escapeCommand(cit->editor()) << "\" \"";
2532 vector<string> flags;
2533 if (cit->documentFormat())
2534 flags.push_back("document");
2535 if (cit->vectorFormat())
2536 flags.push_back("vector");
2537 if (cit->zippedNative())
2538 flags.push_back("zipped=native");
2539 if (cit->inExportMenu())
2540 flags.push_back("menu=export");
2542 os << getStringFromVector(flags);
2543 os << "\" \"" << cit->mime() << "\"\n";
2547 // Look for deleted formats
2548 for (Formats::const_iterator cit = system_formats.begin();
2549 cit != system_formats.end(); ++cit)
2550 if (!formats.getFormat(cit->name()))
2551 os << "\\format \"" << cit->name()
2552 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2555 case RC_VIEWER_ALTERNATIVES: {
2556 Alternatives::const_iterator it = viewer_alternatives.begin();
2557 Alternatives::const_iterator const en = viewer_alternatives.end();
2558 Alternatives::const_iterator const sysend =
2559 system_lyxrc.viewer_alternatives.end();
2560 for (; it != en; ++it) {
2561 string const & fmt = it->first;
2562 CommandSet const & cmd = it->second;
2563 CommandSet::const_iterator sit = cmd.begin();
2564 CommandSet::const_iterator const sen = cmd.end();
2565 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2566 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2567 system_lyxrc.viewer_alternatives.find(fmt);
2568 for (; sit != sen; ++sit) {
2569 string const & cmd = *sit;
2570 if (ignore_system_lyxrc
2571 || sysfmt == sysend // format not found
2572 || sysfmt->second.count(cmd) == 0 // this command not found
2574 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2580 case RC_EDITOR_ALTERNATIVES: {
2581 Alternatives::const_iterator it = editor_alternatives.begin();
2582 Alternatives::const_iterator const en = editor_alternatives.end();
2583 Alternatives::const_iterator const sysend =
2584 system_lyxrc.editor_alternatives.end();
2585 for (; it != en; ++it) {
2586 string const & fmt = it->first;
2587 CommandSet const & cmd = it->second;
2588 CommandSet::const_iterator sit = cmd.begin();
2589 CommandSet::const_iterator const sen = cmd.end();
2590 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2591 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2592 system_lyxrc.editor_alternatives.find(fmt);
2593 for (; sit != sen; ++sit) {
2594 string const & cmd = *sit;
2595 if (ignore_system_lyxrc
2596 || sysfmt == sysend // format not found
2597 || sysfmt->second.count(cmd) == 0 // this command not found
2599 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2605 case RC_DEFAULT_OTF_VIEW_FORMAT:
2606 if ((ignore_system_lyxrc ||
2607 default_otf_view_format != system_lyxrc.default_otf_view_format)
2608 && !default_otf_view_format.empty()) {
2609 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2613 case RC_DEFAULT_VIEW_FORMAT:
2614 if (ignore_system_lyxrc ||
2615 default_view_format != system_lyxrc.default_view_format) {
2616 os << "\\default_view_format " << default_view_format << '\n';
2626 << "# CONVERTERS SECTION ##########################\n"
2630 // Look for new converters
2631 for (Converters::const_iterator cit = theConverters().begin();
2632 cit != theConverters().end(); ++cit) {
2633 Converter const * converter =
2634 theSystemConverters().getConverter(cit->from(),
2637 converter->command() != cit->command() ||
2638 converter->flags() != cit->flags())
2639 os << "\\converter \"" << cit->from() << "\" \""
2640 << cit->to() << "\" \""
2641 << escapeCommand(cit->command()) << "\" \""
2642 << cit->flags() << "\"\n";
2645 // New/modifed converters
2646 for (Converters::const_iterator cit = theSystemConverters().begin();
2647 cit != theSystemConverters().end(); ++cit)
2648 if (!theConverters().getConverter(cit->from(), cit->to()))
2649 os << "\\converter \"" << cit->from()
2650 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2657 << "# COPIERS SECTION ##########################\n"
2660 // Look for new movers
2661 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2662 Movers::const_iterator const sysend = theSystemMovers().end();
2663 Movers::const_iterator it = theMovers().begin();
2664 Movers::const_iterator end = theMovers().end();
2666 for (; it != end; ++it) {
2667 Movers::const_iterator const sysit =
2668 find_if(sysbegin, sysend, SameMover(*it));
2669 if (sysit == sysend) {
2670 string const & fmt = it->first;
2671 string const & command =
2672 it->second.command();
2674 os << "\\copier " << fmt
2675 << " \"" << escapeCommand(command) << "\"\n";
2681 // We don't actually delete SpecialisedMover(s) from the
2682 // map, just clear their 'command', so there's no need
2683 // to test for anything else.
2690 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2692 // Why the switch you might ask. It is a trick to ensure that all
2693 // the elements in the LyXRCTags enum is handled. As you can see
2694 // there are no breaks at all. So it is just a huge fall-through.
2695 // The nice thing is that we will get a warning from the compiler
2696 // if we forget an element.
2697 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2699 case LyXRC::RC_LAST:
2700 case LyXRC::RC_ACCEPT_COMPOUND:
2701 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2702 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2704 case LyXRC::RC_ALT_LANG:
2705 case LyXRC::RC_PLAINTEXT_LINELEN:
2706 case LyXRC::RC_AUTOCORRECTION_MATH:
2707 case LyXRC::RC_AUTOREGIONDELETE:
2708 case LyXRC::RC_AUTORESET_OPTIONS:
2709 case LyXRC::RC_AUTOSAVE:
2710 case LyXRC::RC_AUTO_NUMBER:
2711 case LyXRC::RC_BACKUPDIR_PATH:
2712 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2713 case LyXRC::RC_BIBTEX_COMMAND:
2714 case LyXRC::RC_BINDFILE:
2715 case LyXRC::RC_CHECKLASTFILES:
2716 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2717 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2718 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2719 case LyXRC::RC_COMPLETION_INLINE_MATH:
2720 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2721 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2722 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2723 case LyXRC::RC_COMPLETION_POPUP_MATH:
2724 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2725 case LyXRC::RC_COMPLETION_MINLENGTH:
2726 case LyXRC::RC_USELASTFILEPOS:
2727 case LyXRC::RC_LOADSESSION:
2728 case LyXRC::RC_CHKTEX_COMMAND:
2729 case LyXRC::RC_CONVERTER:
2730 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2731 case LyXRC::RC_COPIER:
2732 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2733 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2734 case LyXRC::RC_DATE_INSERT_FORMAT:
2735 case LyXRC::RC_GUI_LANGUAGE:
2736 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2737 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2738 case LyXRC::RC_DEFFILE:
2739 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2740 case LyXRC::RC_DISPLAY_GRAPHICS:
2741 case LyXRC::RC_DOCUMENTPATH:
2742 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2743 FileName path(lyxrc_new.document_path);
2744 if (path.exists() && path.isDirectory())
2745 package().document_dir() = FileName(lyxrc.document_path);
2748 case LyXRC::RC_EDITOR_ALTERNATIVES:
2749 case LyXRC::RC_ESC_CHARS:
2750 case LyXRC::RC_EXAMPLEPATH:
2751 case LyXRC::RC_FONT_ENCODING:
2752 case LyXRC::RC_FILEFORMAT:
2753 case LyXRC::RC_GROUP_LAYOUTS:
2754 case LyXRC::RC_HUNSPELLDIR_PATH:
2755 case LyXRC::RC_ICON_SET:
2756 case LyXRC::RC_INDEX_ALTERNATIVES:
2757 case LyXRC::RC_INDEX_COMMAND:
2758 case LyXRC::RC_JBIBTEX_COMMAND:
2759 case LyXRC::RC_JINDEX_COMMAND:
2760 case LyXRC::RC_NOMENCL_COMMAND:
2761 case LyXRC::RC_INPUT:
2762 case LyXRC::RC_KBMAP:
2763 case LyXRC::RC_KBMAP_PRIMARY:
2764 case LyXRC::RC_KBMAP_SECONDARY:
2765 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2766 case LyXRC::RC_LANGUAGE_AUTO_END:
2767 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2768 case LyXRC::RC_LANGUAGE_COMMAND_END:
2769 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2770 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2771 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2772 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2773 case LyXRC::RC_LYXRCFORMAT:
2774 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2775 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2776 case LyXRC::RC_MACRO_EDIT_STYLE:
2777 case LyXRC::RC_MAKE_BACKUP:
2778 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2779 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2780 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2781 case LyXRC::RC_NUMLASTFILES:
2782 case LyXRC::RC_PARAGRAPH_MARKERS:
2783 case LyXRC::RC_PATH_PREFIX:
2784 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2785 prependEnvPath("PATH", lyxrc_new.path_prefix);
2786 // Resets python path
2787 support::os::python(true);
2790 case LyXRC::RC_PREVIEW:
2791 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2792 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2793 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2794 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2795 case LyXRC::RC_PRINTPAPERFLAG:
2796 case LyXRC::RC_SAVE_COMPRESSED:
2797 case LyXRC::RC_SAVE_ORIGIN:
2798 case LyXRC::RC_SCREEN_DPI:
2799 case LyXRC::RC_SCREEN_FONT_ROMAN:
2800 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2801 case LyXRC::RC_SCREEN_FONT_SANS:
2802 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2803 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2804 case LyXRC::RC_SCREEN_FONT_SIZES:
2805 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2806 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2807 case LyXRC::RC_GEOMETRY_SESSION:
2808 case LyXRC::RC_SCREEN_ZOOM:
2809 case LyXRC::RC_SERVERPIPE:
2810 case LyXRC::RC_SET_COLOR:
2811 case LyXRC::RC_SHOW_BANNER:
2812 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2813 case LyXRC::RC_SPELLCHECKER:
2814 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2817 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2818 case LyXRC::RC_SPELLCHECK_NOTES:
2819 case LyXRC::RC_SPLITINDEX_COMMAND:
2820 case LyXRC::RC_TEMPDIRPATH:
2821 case LyXRC::RC_TEMPLATEPATH:
2822 case LyXRC::RC_TEX_ALLOWS_SPACES:
2823 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2824 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2825 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2828 case LyXRC::RC_TEXINPUTS_PREFIX:
2829 case LyXRC::RC_THESAURUSDIRPATH:
2830 case LyXRC::RC_UIFILE:
2831 case LyXRC::RC_USER_EMAIL:
2832 case LyXRC::RC_USER_NAME:
2833 case LyXRC::RC_USE_CONVERTER_CACHE:
2834 case LyXRC::RC_USE_SYSTEM_COLORS:
2835 case LyXRC::RC_USE_TOOLTIP:
2836 case LyXRC::RC_USE_PIXMAP_CACHE:
2837 case LyXRC::RC_USE_QIMAGE:
2838 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2839 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2840 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2841 case LyXRC::RC_SINGLE_INSTANCE:
2842 case LyXRC::RC_SORT_LAYOUTS:
2843 case LyXRC::RC_FULL_SCREEN_LIMIT:
2844 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2845 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2846 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2847 case LyXRC::RC_FULL_SCREEN_TABBAR:
2848 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2849 case LyXRC::RC_FULL_SCREEN_WIDTH:
2850 case LyXRC::RC_VISUAL_CURSOR:
2851 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2852 case LyXRC::RC_VIEWER:
2853 case LyXRC::RC_VIEWER_ALTERNATIVES:
2854 case LyXRC::RC_FORWARD_SEARCH_DVI:
2855 case LyXRC::RC_FORWARD_SEARCH_PDF:
2856 case LyXRC::RC_EXPORT_OVERWRITE:
2857 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2858 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2859 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2860 case LyXRC::RC_CURSOR_WIDTH:
2867 string const LyXRC::getDescription(LyXRCTags tag)
2872 case RC_ACCEPT_COMPOUND:
2873 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2877 str = _("Specify an alternate language. The default is to use the language of the document.");
2880 case RC_PLAINTEXT_LINELEN:
2881 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.");
2884 case RC_AUTOREGIONDELETE:
2885 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2888 case RC_AUTORESET_OPTIONS:
2889 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2893 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2896 case RC_AUTO_NUMBER:
2899 case RC_BACKUPDIR_PATH:
2900 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.");
2903 case RC_BIBTEX_COMMAND:
2904 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2907 case RC_JBIBTEX_COMMAND:
2908 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2912 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2915 case RC_CHECKLASTFILES:
2916 str = _("Select to check whether the lastfiles still exist.");
2919 case RC_CHKTEX_COMMAND:
2920 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2929 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2930 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.");
2933 case RC_CURSOR_WIDTH:
2934 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2937 case RC_SCROLL_BELOW_DOCUMENT:
2938 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");
2941 case RC_MAC_DONTSWAP_CTRL_META:
2942 str = _("Make Apple key act as Meta and Control key as Ctrl.");
2945 case RC_MAC_LIKE_CURSOR_MOVEMENT:
2946 str = _("Use the Mac OS X conventions for cursor movement");
2949 case RC_SHOW_MACRO_LABEL:
2950 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2953 case RC_DATE_INSERT_FORMAT:
2954 //xgettext:no-c-format
2955 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2959 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2962 case RC_DEFAULT_OTF_VIEW_FORMAT:
2963 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
2966 case RC_DEFAULT_VIEW_FORMAT:
2967 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2970 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2971 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2974 case RC_DISPLAY_GRAPHICS:
2975 str = _("Select how LyX will display any graphics.");
2978 case RC_DOCUMENTPATH:
2979 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2983 str = _("Specify additional chars that can be part of a word.");
2986 case RC_EXAMPLEPATH:
2987 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2990 case RC_FONT_ENCODING:
2991 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2997 case RC_INDEX_COMMAND:
2998 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\".");
3001 case RC_JINDEX_COMMAND:
3002 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3005 case RC_NOMENCL_COMMAND:
3006 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3013 case RC_KBMAP_PRIMARY:
3014 case RC_KBMAP_SECONDARY:
3015 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.");
3018 case RC_LANGUAGE_AUTO_BEGIN:
3019 str = _("Select if a language switching command is needed at the beginning of the document.");
3022 case RC_LANGUAGE_AUTO_END:
3023 str = _("Select if a language switching command is needed at the end of the document.");
3026 case RC_LANGUAGE_COMMAND_BEGIN:
3027 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.");
3030 case RC_LANGUAGE_COMMAND_END:
3031 str = _("The LaTeX command for changing back to the language of the document.");
3034 case RC_LANGUAGE_COMMAND_LOCAL:
3035 str = _("The LaTeX command for local changing of the language.");
3038 case RC_LANGUAGE_GLOBAL_OPTIONS:
3039 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3042 case RC_LANGUAGE_CUSTOM_PACKAGE:
3043 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3046 case RC_LANGUAGE_PACKAGE_SELECTION:
3047 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3050 case RC_USELASTFILEPOS:
3051 str = _("De-select if you do not want LyX to scroll to saved position.");
3054 case RC_LOADSESSION:
3055 str = _("De-select to prevent loading files opened from the last LyX session.");
3058 case RC_MAKE_BACKUP:
3059 str = _("De-select if you don't want LyX to create backup files.");
3062 case RC_MARK_FOREIGN_LANGUAGE:
3063 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3066 case RC_MOUSE_WHEEL_SPEED:
3067 str = _("The scrolling speed of the mouse wheel.");
3070 case RC_COMPLETION_POPUP_DELAY:
3071 str = _("The completion popup delay.");
3074 case RC_COMPLETION_POPUP_MATH:
3075 str = _("Select to display the completion popup in math mode.");
3078 case RC_COMPLETION_POPUP_TEXT:
3079 str = _("Select to display the completion popup in text mode.");
3082 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3083 str = _("Show the completion popup without delay after non-unique completion attempt.");
3086 case RC_COMPLETION_POPUP_TEXT:
3087 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3090 case RC_COMPLETION_POPUP_DELAY:
3091 str = _("The inline completion delay.");
3094 case RC_COMPLETION_INLINE_MATH:
3095 str = _("Select to display the inline completion in math mode.");
3098 case RC_COMPLETION_INLINE_TEXT:
3099 str = _("Select to display the inline completion in text mode.");
3102 case RC_COMPLETION_INLINE_DOTS:
3103 str = _("Use \"...\" to shorten long completions.");
3106 case RC_AUTOCORRECTION_MATH:
3107 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3110 case RC_NUMLASTFILES:
3111 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3115 case RC_PATH_PREFIX:
3116 str = _("Specify those directories which should be "
3117 "prepended to the PATH environment variable.\n"
3118 "Use the OS native format.");
3122 str = _("Shows a typeset preview of things such as math");
3125 case RC_PREVIEW_HASHED_LABELS:
3126 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3129 case RC_PREVIEW_SCALE_FACTOR:
3130 str = _("Scale the preview size to suit.");
3133 case RC_PRINTLANDSCAPEFLAG:
3134 str = _("The option to print out in landscape.");
3137 case RC_PRINTPAPERDIMENSIONFLAG:
3138 str = _("Option to specify the dimensions of the print paper.");
3141 case RC_PRINTPAPERFLAG:
3142 str = _("The option to specify paper type.");
3145 case RC_VISUAL_CURSOR:
3146 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3149 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3150 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).");
3154 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3157 case RC_SCREEN_FONT_ROMAN:
3158 case RC_SCREEN_FONT_SANS:
3159 case RC_SCREEN_FONT_TYPEWRITER:
3160 str = _("The screen fonts used to display the text while editing.");
3163 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3164 case RC_SCREEN_FONT_SANS_FOUNDRY:
3165 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3168 case RC_SCREEN_FONT_SCALABLE:
3169 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.");
3172 case RC_SCREEN_FONT_SIZES:
3173 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3176 case RC_SCREEN_ZOOM:
3177 //xgettext:no-c-format
3178 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3181 case RC_GEOMETRY_SESSION:
3182 str = _("Allow session manager to save and restore windows geometry.");
3186 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3192 case RC_SHOW_BANNER:
3193 str = _("De-select if you don't want the startup banner.");
3196 case RC_TEMPDIRPATH:
3197 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3200 case RC_THESAURUSDIRPATH:
3201 str = _("This is the place where the files of the thesaurus library reside.");
3204 case RC_TEMPLATEPATH:
3205 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3208 case RC_TEX_ALLOWS_SPACES:
3211 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3214 case RC_TEXINPUTS_PREFIX:
3215 str = _("Specify those directories which should be "
3216 "prepended to the TEXINPUTS environment variable.\n"
3217 "A '.' represents the current document directory. "
3218 "Use the OS native format.");
3222 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3231 case RC_USE_USE_SYSTEM_COLORS:
3232 str = _("Enable use the system colors for some things like main window background and selection.");
3235 case RC_USE_TOOLTIP:
3236 str = _("Enable the automatic appearance of tool tips in the work area.");
3239 case RC_USE_PIXMAP_CACHE:
3240 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3243 case RC_VIEWDVI_PAPEROPTION:
3244 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3259 // The global instance
3262 // The global copy of the system lyxrc entries (everything except preferences)