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());
639 document_path = expandPath(document_path);
645 example_path = os::internal_path(lexrc.getString());
646 example_path = expandPath(example_path);
650 case RC_TEMPLATEPATH:
652 template_path = os::internal_path(lexrc.getString());
653 template_path = expandPath(template_path);
659 tempdir_path = os::internal_path(lexrc.getString());
660 tempdir_path = expandPath(tempdir_path);
664 case RC_THESAURUSDIRPATH:
666 thesaurusdir_path = os::internal_path(lexrc.getString());
667 thesaurusdir_path = expandPath(thesaurusdir_path);
671 case RC_HUNSPELLDIR_PATH:
673 hunspelldir_path = os::internal_path(lexrc.getString());
674 hunspelldir_path = expandPath(hunspelldir_path);
678 case RC_USELASTFILEPOS:
679 lexrc >> use_lastfilepos;
683 lexrc >> load_session;
686 case RC_MOUSE_WHEEL_SPEED:
687 lexrc >> mouse_wheel_speed;
690 case RC_COMPLETION_INLINE_DELAY:
691 lexrc >> completion_inline_delay;
694 case RC_COMPLETION_INLINE_MATH:
695 lexrc >> completion_inline_math;
698 case RC_COMPLETION_INLINE_TEXT:
699 lexrc >> completion_inline_text;
702 case RC_COMPLETION_INLINE_DOTS:
703 lexrc >> completion_inline_dots;
706 case RC_AUTOCORRECTION_MATH:
707 lexrc >> autocorrection_math;
710 case RC_COMPLETION_POPUP_DELAY:
711 lexrc >> completion_popup_delay;
714 case RC_COMPLETION_POPUP_MATH:
715 lexrc >> completion_popup_math;
718 case RC_COMPLETION_POPUP_TEXT:
719 lexrc >> completion_popup_text;
722 case RC_COMPLETION_CURSOR_TEXT:
723 lexrc >> completion_cursor_text;
726 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
727 lexrc >> completion_popup_after_complete;
730 case RC_COMPLETION_MINLENGTH:
731 lexrc >> completion_minlength;
734 case RC_NUMLASTFILES:
735 lexrc >> num_lastfiles;
738 case RC_CHECKLASTFILES:
739 lexrc >> check_lastfiles;
746 case RC_USE_SYSTEM_THEME_ICONS:
747 lexrc >> use_system_theme_icons;
750 case RC_SCREEN_FONT_ROMAN:
752 roman_font_name = lexrc.getString();
753 oldFontFormat(roman_font_name,
758 case RC_SCREEN_FONT_SANS:
760 sans_font_name = lexrc.getString();
761 oldFontFormat(sans_font_name, sans_font_foundry);
765 case RC_SCREEN_FONT_TYPEWRITER:
767 typewriter_font_name = lexrc.getString();
768 oldFontFormat(typewriter_font_name,
769 typewriter_font_foundry);
773 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
774 lexrc >> roman_font_foundry;
777 case RC_SCREEN_FONT_SANS_FOUNDRY:
778 lexrc >> sans_font_foundry;
781 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
782 lexrc >> typewriter_font_foundry;
787 lexrc.printError("Missing color tag.");
790 string lyx_name = lexrc.getString();
793 lexrc.printError("Missing color name for color: `$$Token'");
796 string x11_name = lexrc.getString();
798 ColorCode const col =
799 lcolor.getFromLyXName(lyx_name);
800 if (col == Color_none ||
801 col == Color_inherit ||
805 if (!lcolor.setColor(col, x11_name))
806 LYXERR0("Bad lyxrc set_color for " << lyx_name);
810 case RC_AUTOREGIONDELETE:
811 // Auto region delete defaults to true
812 lexrc >> auto_region_delete;
817 lyxpipes = os::internal_path(lexrc.getString());
818 lyxpipes = expandPath(lyxpipes);
822 case RC_CURSOR_FOLLOWS_SCROLLBAR:
823 lexrc >> cursor_follows_scrollbar;
826 case RC_CURSOR_WIDTH:
827 lexrc >> cursor_width;
830 case RC_SCROLL_BELOW_DOCUMENT:
831 lexrc >> scroll_below_document;
834 case RC_PARAGRAPH_MARKERS:
835 lexrc >> paragraph_markers;
838 case RC_MAC_DONTSWAP_CTRL_META:
839 lexrc >> mac_dontswap_ctrl_meta;
842 case RC_MAC_LIKE_CURSOR_MOVEMENT:
843 lexrc >> mac_like_cursor_movement;
846 case RC_MACRO_EDIT_STYLE:
848 switch (lexrc.getInteger()) {
849 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
850 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
851 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
856 case RC_DIALOGS_ICONIFY_WITH_MAIN:
857 lexrc >> dialogs_iconify_with_main;
860 case RC_PLAINTEXT_LINELEN:
861 lexrc >> plaintext_linelen;
863 // Spellchecker settings:
864 case RC_ACCEPT_COMPOUND:
865 lexrc >> spellchecker_accept_compound;
867 case RC_USE_SYSTEM_COLORS:
868 lexrc >> use_system_colors;
871 lexrc >> use_tooltip;
873 case RC_USE_PIXMAP_CACHE:
874 lexrc >> use_pixmap_cache;
879 case RC_SPELLCHECKER:
880 lexrc >> spellchecker;
883 lexrc >> spellchecker_alt_lang;
886 lexrc >> spellchecker_esc_chars;
888 case RC_SPELLCHECK_CONTINUOUSLY:
889 lexrc >> spellcheck_continuously;
891 case RC_SPELLCHECK_NOTES:
892 lexrc >> spellcheck_notes;
895 lexrc >> make_backup;
897 case RC_SAVE_COMPRESSED:
898 lexrc >> save_compressed;
901 lexrc >> save_origin;
903 case RC_BACKUPDIR_PATH:
905 backupdir_path = os::internal_path(lexrc.getString());
906 backupdir_path = expandPath(backupdir_path);
909 case RC_DEFAULT_DECIMAL_POINT:
910 lexrc >> default_decimal_point;
912 case RC_DEFAULT_LENGTH_UNIT:
914 default_length_unit = (Length::UNIT) lexrc.getInteger();
916 case RC_DATE_INSERT_FORMAT:
917 lexrc >> date_insert_format;
919 case RC_LANGUAGE_CUSTOM_PACKAGE:
920 lexrc >> language_custom_package;
922 case RC_LANGUAGE_AUTO_BEGIN:
923 lexrc >> language_auto_begin;
925 case RC_LANGUAGE_AUTO_END:
926 lexrc >> language_auto_end;
928 case RC_LANGUAGE_GLOBAL_OPTIONS:
929 lexrc >> language_global_options;
931 case RC_LANGUAGE_PACKAGE_SELECTION:
933 switch (lexrc.getInteger()) {
935 language_package_selection = LP_AUTO;
938 language_package_selection = LP_BABEL;
941 language_package_selection = LP_CUSTOM;
944 language_package_selection = LP_NONE;
949 case RC_LANGUAGE_COMMAND_BEGIN:
950 lexrc >> language_command_begin;
952 case RC_LANGUAGE_COMMAND_END:
953 lexrc >> language_command_end;
955 case RC_LANGUAGE_COMMAND_LOCAL:
956 lexrc >> language_command_local;
958 case RC_VISUAL_CURSOR:
959 lexrc >> visual_cursor;
961 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
962 lexrc >> close_buffer_with_last_view;
965 lexrc >> auto_number;
967 case RC_MARK_FOREIGN_LANGUAGE:
968 lexrc >> mark_foreign_language;
974 fmt = lexrc.getString();
975 if (lexrc.next(true))
976 command = lexrc.getString();
977 setMover(fmt, command);
982 string from, to, command, flags;
984 from = lexrc.getString();
986 to = lexrc.getString();
987 if (lexrc.next(true))
988 command = lexrc.getString();
990 flags = lexrc.getString();
992 theConverters().erase(from, to);
994 theConverters().add(from, to, command, flags);
997 // compatibility with versions older than 1.4.0 only
999 string format, command;
1000 lexrc >> format >> command;
1001 formats.setViewer(format, command);
1004 case RC_FILEFORMAT: {
1006 string format, extensions, prettyname, shortcut;
1007 if (!(lexrc >> format >> extensions))
1009 if (ok && lexrc.next(true))
1010 prettyname = lexrc.getString();
1014 if(!(lexrc >> shortcut))
1016 string viewer, editor;
1017 if (ok && lexrc.next(true))
1018 viewer = lexrc.getString();
1021 if (ok && lexrc.next(true))
1022 editor = lexrc.getString();
1026 if (!(lexrc >> flags >> mime))
1028 int flgs = Format::none;
1029 while (!flags.empty()) {
1031 flags = split(flags, flag, ',');
1032 if (flag == "document")
1033 flgs |= Format::document;
1034 else if (flag == "vector")
1035 flgs |= Format::vector;
1036 else if (flag == "zipped=native")
1037 flgs |= Format::zipped_native;
1038 else if (flag == "menu=export")
1039 flgs |= Format::export_menu;
1041 LYXERR0("Ignoring unknown flag `"
1042 << flag << "' for format `"
1046 LYXERR0("Syntax error in format " << format);
1047 else if (prettyname.empty()) {
1048 if (theConverters().formatIsUsed(format))
1049 LYXERR0("Can't delete format " << format);
1051 formats.erase(format);
1053 formats.add(format, extensions, prettyname,
1054 shortcut, viewer, editor, mime, flgs);
1058 case RC_VIEWER_ALTERNATIVES: {
1059 string format, command;
1060 if ((lexrc >> format) && lexrc.next(true)) {
1061 command = lexrc.getString();
1062 viewer_alternatives[format].insert(command);
1066 case RC_EDITOR_ALTERNATIVES: {
1067 string format, command;
1068 if ((lexrc >> format) && lexrc.next(true)) {
1069 command = lexrc.getString();
1070 editor_alternatives[format].insert(command);
1075 case RC_DEFAULT_OTF_VIEW_FORMAT:
1076 lexrc >> default_otf_view_format;
1079 case RC_DEFAULT_VIEW_FORMAT:
1080 lexrc >> default_view_format;
1083 case RC_GUI_LANGUAGE:
1084 lexrc >> gui_language;
1087 case RC_SHOW_BANNER:
1088 lexrc >> show_banner;
1093 string const tmp = lexrc.getString();
1094 if (tmp == "true" || tmp == "on")
1095 preview = PREVIEW_ON;
1096 else if (tmp == "no_math")
1097 preview = PREVIEW_NO_MATH;
1099 preview = PREVIEW_OFF;
1100 if (tmp != "false" && tmp != "off")
1101 LYXERR0("Unrecognized preview status \""
1107 case RC_PREVIEW_HASHED_LABELS:
1108 lexrc >> preview_hashed_labels;
1111 case RC_PREVIEW_SCALE_FACTOR:
1112 lexrc >> preview_scale_factor;
1119 lexrc >> user_email;
1122 case RC_PATH_PREFIX:
1123 lexrc >> path_prefix;
1126 case RC_USE_CONVERTER_CACHE:
1127 lexrc >> use_converter_cache;
1129 case RC_CONVERTER_CACHE_MAXAGE:
1130 lexrc >> converter_cache_maxage;
1133 case RC_SORT_LAYOUTS:
1134 lexrc >> sort_layouts;
1136 case RC_GROUP_LAYOUTS:
1137 lexrc >> group_layouts;
1139 case RC_FULL_SCREEN_LIMIT:
1140 lexrc >> full_screen_limit;
1142 case RC_FULL_SCREEN_TOOLBARS:
1143 lexrc >> full_screen_toolbars;
1145 case RC_FULL_SCREEN_SCROLLBAR:
1146 lexrc >> full_screen_scrollbar;
1148 case RC_FULL_SCREEN_STATUSBAR:
1149 lexrc >> full_screen_statusbar;
1151 case RC_FULL_SCREEN_TABBAR:
1152 lexrc >> full_screen_tabbar;
1154 case RC_FULL_SCREEN_MENUBAR:
1155 lexrc >> full_screen_menubar;
1157 case RC_FULL_SCREEN_WIDTH:
1158 lexrc >> full_screen_width;
1160 case RC_OPEN_BUFFERS_IN_TABS:
1161 lexrc >> open_buffers_in_tabs;
1163 case RC_SINGLE_CLOSE_TAB_BUTTON:
1164 lexrc >> single_close_tab_button;
1166 case RC_SINGLE_INSTANCE:
1167 lexrc >> single_instance;
1168 if (run_mode == PREFERRED)
1169 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1171 case RC_FORWARD_SEARCH_DVI:
1172 if (lexrc.next(true))
1173 forward_search_dvi = lexrc.getString();
1175 case RC_FORWARD_SEARCH_PDF:
1176 if (lexrc.next(true))
1177 forward_search_pdf = lexrc.getString();
1179 case RC_EXPORT_OVERWRITE:
1181 string const tmp = lexrc.getString();
1182 if (tmp == "all" || tmp == "true")
1183 export_overwrite = ALL_FILES;
1184 else if (tmp == "main")
1185 export_overwrite = MAIN_FILE;
1187 export_overwrite = NO_FILES;
1188 if (tmp != "ask" && tmp != "false")
1189 LYXERR0("Unrecognized export_overwrite status \""
1194 case RC_SCROLL_WHEEL_ZOOM:
1196 string const tmp = lexrc.getString();
1198 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1199 else if (tmp == "shift")
1200 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1201 else if (tmp == "alt")
1202 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1204 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1205 if (tmp != "off" && tmp != "false")
1206 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1212 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1213 lexrc >> mouse_middlebutton_paste;
1217 break; // this is just a dummy
1220 // This is triggered the first time through the loop unless
1221 // we hit a format tag.
1222 if (check_format && format != LYXRC_FILEFORMAT)
1223 return FormatMismatch;
1226 /// Update converters data-structures
1227 theConverters().update(formats);
1228 theConverters().buildGraph();
1234 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1236 ofstream ofs(filename.toFilesystemEncoding().c_str());
1238 write(ofs, ignore_system_lyxrc);
1242 void LyXRC::print() const
1244 if (lyxerr.debugging())
1245 write(lyxerr, false);
1253 typedef pair<string, SpecialisedMover> Data;
1255 SameMover(Data const & comparison)
1256 : comparison_(comparison) {}
1258 bool operator()(Data const & data) const
1260 return data.first == comparison_.first &&
1261 data.second.command() == comparison_.second.command();
1271 // Escape \ and " so that LyXLex can read the string later
1272 string escapeCommand(string const & str) {
1273 return subst(subst(str , "\\", "\\\\"),
1280 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1282 LyXRCTags tag = RC_LAST;
1284 if (!name.empty()) {
1285 for (int i = 0; i != lyxrcCount; ++i)
1286 if ("\\" + name == lyxrcTags[i].tag)
1287 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1291 os << "# LyX " << lyx_version
1292 << " generated this file. If you want to make your own\n"
1293 << "# modifications you should do them from inside LyX and save.\n\n"
1294 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1296 // Why the switch you might ask. It is a trick to ensure that all
1297 // the elements in the LyXRCTags enum are handled. As you can see
1298 // there are no breaks at all. So it is just a huge fall-through.
1299 // The nice thing is that we will get a warning from the compiler
1300 // if we forget an element.
1304 // input/include files are not done here
1305 case RC_LYXRCFORMAT:
1307 if (ignore_system_lyxrc ||
1308 bind_file != system_lyxrc.bind_file) {
1309 string const path = os::external_path(bind_file);
1310 os << "\\bind_file \"" << path << "\"\n";
1316 if (ignore_system_lyxrc ||
1317 def_file != system_lyxrc.def_file) {
1318 string const path = os::external_path(def_file);
1319 os << "\\def_file \"" << path << "\"\n";
1328 << "# MISC SECTION ######################################\n"
1330 // bind files are not done here.
1332 case RC_PATH_PREFIX:
1333 if (ignore_system_lyxrc ||
1334 path_prefix != system_lyxrc.path_prefix) {
1335 os << "\\path_prefix \"" << path_prefix << "\"\n";
1340 if (ignore_system_lyxrc ||
1341 ui_file != system_lyxrc.ui_file) {
1342 string const path = os::external_path(ui_file);
1343 os << "\\ui_file \"" << path << "\"\n";
1347 case RC_AUTOREGIONDELETE:
1348 if (ignore_system_lyxrc ||
1349 auto_region_delete != system_lyxrc.auto_region_delete) {
1350 os << "# Set to false to inhibit automatic replacement of\n"
1351 << "# the current selection.\n"
1352 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1357 case RC_AUTORESET_OPTIONS:
1358 if (ignore_system_lyxrc ||
1359 auto_reset_options != system_lyxrc.auto_reset_options) {
1360 os << "# Set to false to inhibit automatic reset of\n"
1361 << "# the class options to defaults on class change.\n"
1362 << "\\auto_reset_options "
1363 << convert<string>(auto_reset_options)
1369 if (ignore_system_lyxrc ||
1370 autosave != system_lyxrc.autosave) {
1371 os << "# The time interval between auto-saves in seconds.\n"
1372 << "\\autosave " << autosave << '\n';
1376 case RC_DISPLAY_GRAPHICS:
1377 if (ignore_system_lyxrc ||
1378 display_graphics != system_lyxrc.display_graphics) {
1379 os << "# Display graphics within LyX\n"
1381 << "\\display_graphics "
1382 << (display_graphics ? "true" : "false")
1387 case RC_SORT_LAYOUTS:
1388 if (ignore_system_lyxrc ||
1389 sort_layouts != system_lyxrc.sort_layouts) {
1390 os << "# Sort layouts alphabetically.\n"
1391 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1395 case RC_GROUP_LAYOUTS:
1396 if (ignore_system_lyxrc ||
1397 group_layouts != system_lyxrc.group_layouts) {
1398 os << "# Group layouts by their category.\n"
1399 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1403 case RC_VIEWDVI_PAPEROPTION:
1404 if (ignore_system_lyxrc ||
1405 view_dvi_paper_option
1406 != system_lyxrc.view_dvi_paper_option) {
1407 os << "# Options used to specify paper size to the\n"
1408 << "# view_dvi_command (e.g. -paper)\n"
1409 << "\\view_dvi_paper_option \""
1410 << view_dvi_paper_option << "\"\n";
1414 case RC_CHKTEX_COMMAND:
1415 if (ignore_system_lyxrc ||
1416 chktex_command != system_lyxrc.chktex_command) {
1417 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1421 case RC_BIBTEX_ALTERNATIVES: {
1422 CommandSet::const_iterator it = bibtex_alternatives.begin();
1423 CommandSet::const_iterator end = bibtex_alternatives.end();
1424 for ( ; it != end; ++it) {
1425 if (ignore_system_lyxrc
1426 || !system_lyxrc.bibtex_alternatives.count(*it))
1427 os << "\\bibtex_alternatives \""
1433 case RC_BIBTEX_COMMAND:
1434 if (ignore_system_lyxrc ||
1435 bibtex_command != system_lyxrc.bibtex_command) {
1436 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1440 case RC_JBIBTEX_COMMAND:
1441 if (ignore_system_lyxrc ||
1442 jbibtex_command != system_lyxrc.jbibtex_command) {
1443 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1447 case RC_INDEX_ALTERNATIVES: {
1448 CommandSet::const_iterator it = index_alternatives.begin();
1449 CommandSet::const_iterator end = index_alternatives.end();
1450 for ( ; it != end; ++it) {
1451 if (ignore_system_lyxrc
1452 || !system_lyxrc.index_alternatives.count(*it))
1453 os << "\\index_alternatives \""
1459 case RC_INDEX_COMMAND:
1460 if (ignore_system_lyxrc ||
1461 index_command != system_lyxrc.index_command) {
1462 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1466 case RC_JINDEX_COMMAND:
1467 if (ignore_system_lyxrc ||
1468 jindex_command != system_lyxrc.jindex_command) {
1469 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1473 case RC_SPLITINDEX_COMMAND:
1474 if (ignore_system_lyxrc ||
1475 splitindex_command != system_lyxrc.splitindex_command) {
1476 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1480 case RC_NOMENCL_COMMAND:
1481 if (ignore_system_lyxrc ||
1482 nomencl_command != system_lyxrc.nomencl_command) {
1483 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1487 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1488 // Don't write this setting to the preferences file,
1489 // but allow temporary changes (bug 7557).
1490 if (ignore_system_lyxrc) {
1491 os << "\\tex_expects_windows_paths "
1492 << convert<string>(windows_style_tex_paths) << '\n';
1496 case RC_TEX_ALLOWS_SPACES:
1497 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1498 os << "\\tex_allows_spaces "
1499 << convert<string>(tex_allows_spaces) << '\n';
1504 if (ignore_system_lyxrc ||
1505 use_kbmap != system_lyxrc.use_kbmap) {
1506 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1510 case RC_KBMAP_PRIMARY:
1511 if (ignore_system_lyxrc ||
1512 primary_kbmap != system_lyxrc.primary_kbmap) {
1513 string const path = os::external_path(primary_kbmap);
1514 os << "\\kbmap_primary \"" << path << "\"\n";
1518 case RC_KBMAP_SECONDARY:
1519 if (ignore_system_lyxrc ||
1520 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1521 string const path = os::external_path(secondary_kbmap);
1522 os << "\\kbmap_secondary \"" << path << "\"\n";
1527 if (ignore_system_lyxrc ||
1528 lyxpipes != system_lyxrc.lyxpipes) {
1529 string const path = os::external_path(lyxpipes);
1530 os << "\\serverpipe \"" << path << "\"\n";
1534 case RC_DATE_INSERT_FORMAT:
1535 if (ignore_system_lyxrc ||
1536 date_insert_format != system_lyxrc.date_insert_format) {
1537 os << "\\date_insert_format \"" << date_insert_format
1544 os << "\\user_name \"" << user_name << "\"\n";
1549 os << "\\user_email \"" << user_email << "\"\n";
1553 case RC_SHOW_BANNER:
1554 if (ignore_system_lyxrc ||
1555 show_banner != system_lyxrc.show_banner) {
1556 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1562 if (ignore_system_lyxrc ||
1563 preview != system_lyxrc.preview) {
1569 case PREVIEW_NO_MATH:
1576 os << "\\preview " << status << '\n';
1581 case RC_PREVIEW_HASHED_LABELS:
1582 if (ignore_system_lyxrc ||
1583 preview_hashed_labels !=
1584 system_lyxrc.preview_hashed_labels) {
1585 os << "\\preview_hashed_labels "
1586 << convert<string>(preview_hashed_labels) << '\n';
1591 case RC_PREVIEW_SCALE_FACTOR:
1592 if (ignore_system_lyxrc ||
1593 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1594 os << "\\preview_scale_factor "
1595 << preview_scale_factor << '\n';
1600 case RC_USE_CONVERTER_CACHE:
1601 if (ignore_system_lyxrc ||
1602 use_converter_cache != system_lyxrc.use_converter_cache) {
1603 os << "\\use_converter_cache "
1604 << convert<string>(use_converter_cache) << '\n';
1609 case RC_CONVERTER_CACHE_MAXAGE:
1610 if (ignore_system_lyxrc ||
1611 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1612 os << "\\converter_cache_maxage "
1613 << converter_cache_maxage << '\n';
1619 << "# SCREEN & FONTS SECTION ############################\n"
1623 if (ignore_system_lyxrc ||
1624 icon_set != system_lyxrc.icon_set) {
1625 os << "\\icon_set \"" << icon_set
1631 case RC_USE_SYSTEM_THEME_ICONS:
1632 if (ignore_system_lyxrc ||
1633 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1634 os << "\\use_system_theme_icons "
1635 << convert<string>(use_system_theme_icons)
1642 if (ignore_system_lyxrc ||
1643 dpi != system_lyxrc.dpi) {
1644 os << "\\screen_dpi " << dpi << '\n';
1648 case RC_SCREEN_ZOOM:
1649 if (ignore_system_lyxrc ||
1650 zoom != system_lyxrc.zoom) {
1651 os << "\\screen_zoom " << zoom << '\n';
1655 case RC_GEOMETRY_SESSION:
1656 if (ignore_system_lyxrc ||
1657 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1658 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1663 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1664 if (ignore_system_lyxrc ||
1665 cursor_follows_scrollbar
1666 != system_lyxrc.cursor_follows_scrollbar) {
1667 os << "\\cursor_follows_scrollbar "
1668 << convert<string>(cursor_follows_scrollbar) << '\n';
1672 case RC_CURSOR_WIDTH:
1673 if (ignore_system_lyxrc ||
1675 != system_lyxrc.cursor_width) {
1676 os << "\\cursor_width "
1677 << cursor_width << '\n';
1681 case RC_SCROLL_BELOW_DOCUMENT:
1682 if (ignore_system_lyxrc ||
1683 scroll_below_document
1684 != system_lyxrc.scroll_below_document) {
1685 os << "\\scroll_below_document "
1686 << convert<string>(scroll_below_document) << '\n';
1690 case RC_PARAGRAPH_MARKERS:
1691 if (ignore_system_lyxrc ||
1693 != system_lyxrc.paragraph_markers) {
1694 os << "\\paragraph_markers "
1695 << convert<string>(paragraph_markers) << '\n';
1699 case RC_MAC_DONTSWAP_CTRL_META:
1700 if (ignore_system_lyxrc ||
1701 mac_dontswap_ctrl_meta
1702 != system_lyxrc.mac_dontswap_ctrl_meta) {
1703 os << "\\mac_dontswap_ctrl_meta "
1704 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1708 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1709 if (ignore_system_lyxrc ||
1710 mac_like_cursor_movement
1711 != system_lyxrc.mac_like_cursor_movement) {
1712 os << "\\mac_like_cursor_movement "
1713 << convert<string>(mac_like_cursor_movement) << '\n';
1717 case RC_MACRO_EDIT_STYLE:
1718 if (ignore_system_lyxrc ||
1720 != system_lyxrc.macro_edit_style) {
1721 os << "\\macro_edit_style ";
1722 switch (macro_edit_style) {
1723 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1724 case MACRO_EDIT_INLINE: os << "1\n"; break;
1725 case MACRO_EDIT_LIST: os << "2\n"; break;
1730 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1731 if (ignore_system_lyxrc ||
1732 dialogs_iconify_with_main
1733 != system_lyxrc.dialogs_iconify_with_main) {
1734 os << "\\dialogs_iconify_with_main "
1735 << convert<string>(dialogs_iconify_with_main) << '\n';
1739 case RC_SCREEN_FONT_ROMAN:
1740 if (ignore_system_lyxrc ||
1741 roman_font_name != system_lyxrc.roman_font_name) {
1742 os << "\\screen_font_roman \"" << roman_font_name
1747 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1748 if (ignore_system_lyxrc ||
1749 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1750 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1755 case RC_SCREEN_FONT_SANS:
1756 if (ignore_system_lyxrc ||
1757 sans_font_name != system_lyxrc.sans_font_name) {
1758 os << "\\screen_font_sans \"" << sans_font_name
1763 case RC_SCREEN_FONT_SANS_FOUNDRY:
1764 if (ignore_system_lyxrc ||
1765 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1766 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1771 case RC_SCREEN_FONT_TYPEWRITER:
1772 if (ignore_system_lyxrc ||
1773 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1774 os << "\\screen_font_typewriter \""
1775 << typewriter_font_name << "\"\n";
1779 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1780 if (ignore_system_lyxrc ||
1781 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1782 os << "\\screen_font_typewriter_foundry \""
1783 << typewriter_font_foundry << "\"\n";
1788 case RC_SCREEN_FONT_SCALABLE:
1789 if (ignore_system_lyxrc ||
1790 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1791 os << "\\screen_font_scalable "
1792 << convert<string>(use_scalable_fonts)
1797 case RC_SCREEN_FONT_SIZES:
1798 if (ignore_system_lyxrc ||
1799 font_sizes[FONT_SIZE_TINY]
1800 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1801 font_sizes[FONT_SIZE_SCRIPT]
1802 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1803 font_sizes[FONT_SIZE_FOOTNOTE]
1804 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1805 font_sizes[FONT_SIZE_SMALL]
1806 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1807 font_sizes[FONT_SIZE_NORMAL]
1808 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1809 font_sizes[FONT_SIZE_LARGE]
1810 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1811 font_sizes[FONT_SIZE_LARGER]
1812 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1813 font_sizes[FONT_SIZE_LARGEST]
1814 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1815 font_sizes[FONT_SIZE_HUGE]
1816 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1817 font_sizes[FONT_SIZE_HUGER]
1818 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1819 streamsize old_prec = os.precision();
1820 os.setf(ios::fixed);
1822 os << "\\screen_font_sizes"
1823 << ' ' << font_sizes[FONT_SIZE_TINY]
1824 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1825 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1826 << ' ' << font_sizes[FONT_SIZE_SMALL]
1827 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1828 << ' ' << font_sizes[FONT_SIZE_LARGE]
1829 << ' ' << font_sizes[FONT_SIZE_LARGER]
1830 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1831 << ' ' << font_sizes[FONT_SIZE_HUGE]
1832 << ' ' << font_sizes[FONT_SIZE_HUGER]
1834 os.precision(old_prec);
1835 os.unsetf(ios::fixed);
1839 case RC_FULL_SCREEN_LIMIT:
1840 if (ignore_system_lyxrc ||
1841 full_screen_limit != system_lyxrc.full_screen_limit) {
1842 os << "\\fullscreen_limit "
1843 << convert<string>(full_screen_limit)
1848 case RC_FULL_SCREEN_TOOLBARS:
1849 if (ignore_system_lyxrc ||
1850 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1851 os << "\\fullscreen_toolbars "
1852 << convert<string>(full_screen_toolbars)
1857 case RC_FULL_SCREEN_SCROLLBAR:
1858 if (ignore_system_lyxrc ||
1859 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1860 os << "\\fullscreen_scrollbar "
1861 << convert<string>(full_screen_scrollbar)
1866 case RC_FULL_SCREEN_STATUSBAR:
1867 if (ignore_system_lyxrc ||
1868 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1869 os << "\\fullscreen_statusbar "
1870 << convert<string>(full_screen_statusbar)
1875 case RC_FULL_SCREEN_TABBAR:
1876 if (ignore_system_lyxrc ||
1877 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1878 os << "\\fullscreen_tabbar "
1879 << convert<string>(full_screen_tabbar)
1884 case RC_FULL_SCREEN_MENUBAR:
1885 if (ignore_system_lyxrc ||
1886 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1887 os << "\\fullscreen_menubar "
1888 << convert<string>(full_screen_menubar)
1893 case RC_FULL_SCREEN_WIDTH:
1894 if (ignore_system_lyxrc ||
1895 full_screen_width != system_lyxrc.full_screen_width) {
1896 os << "\\fullscreen_width "
1897 << convert<string>(full_screen_width)
1902 case RC_OPEN_BUFFERS_IN_TABS:
1903 if (ignore_system_lyxrc ||
1904 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1905 os << "\\open_buffers_in_tabs "
1906 << convert<string>(open_buffers_in_tabs)
1911 case RC_SINGLE_CLOSE_TAB_BUTTON:
1912 if (ignore_system_lyxrc ||
1913 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1914 os << "\\single_close_tab_button "
1915 << convert<string>(single_close_tab_button)
1920 case RC_SINGLE_INSTANCE:
1921 if (ignore_system_lyxrc ||
1922 single_instance != system_lyxrc.single_instance) {
1923 os << "\\single_instance "
1924 << convert<string>(single_instance)
1929 case RC_FORWARD_SEARCH_DVI:
1930 if (ignore_system_lyxrc ||
1931 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1932 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1936 case RC_FORWARD_SEARCH_PDF:
1937 if (ignore_system_lyxrc ||
1938 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1939 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1945 << "# COLOR SECTION ###################################\n"
1949 for (int i = 0; i < Color_ignore; ++i) {
1950 ColorCode lc = static_cast<ColorCode>(i);
1951 string const col = lcolor.getX11Name(lc);
1952 if (ignore_system_lyxrc
1953 || col != system_lcolor.getX11Name(lc)) {
1954 os << "\\set_color \""
1955 << lcolor.getLyXName(lc) << "\" \""
1963 << "# PRINTER SECTION ###################################\n"
1966 case RC_PRINTLANDSCAPEFLAG:
1967 if (ignore_system_lyxrc ||
1968 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1969 os << "\\print_landscape_flag \"" << print_landscape_flag
1975 case RC_PRINTPAPERFLAG:
1976 if (ignore_system_lyxrc ||
1977 print_paper_flag != system_lyxrc.print_paper_flag) {
1978 os << "\\print_paper_flag \"" << print_paper_flag
1984 case RC_PRINTPAPERDIMENSIONFLAG:
1985 if (ignore_system_lyxrc ||
1986 print_paper_dimension_flag
1987 != system_lyxrc.print_paper_dimension_flag) {
1988 os << "\\print_paper_dimension_flag \""
1989 << print_paper_dimension_flag << "\"\n";
1995 << "# TEX SECTION #######################################\n"
1998 case RC_TEXINPUTS_PREFIX:
1999 if (ignore_system_lyxrc ||
2000 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2001 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2006 case RC_FONT_ENCODING:
2007 if (ignore_system_lyxrc ||
2008 fontenc != system_lyxrc.fontenc) {
2009 os << "\\font_encoding \"" << fontenc << "\"\n";
2015 << "# FILE SECTION ######################################\n"
2018 case RC_DOCUMENTPATH:
2019 if (ignore_system_lyxrc ||
2020 document_path != system_lyxrc.document_path) {
2021 string const path = os::external_path(document_path);
2022 os << "\\document_path \"" << path << "\"\n";
2026 case RC_USELASTFILEPOS:
2027 if (ignore_system_lyxrc ||
2028 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2029 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2034 case RC_LOADSESSION:
2035 if (ignore_system_lyxrc ||
2036 load_session != system_lyxrc.load_session) {
2037 os << "\\load_session " << convert<string>(load_session)
2042 case RC_MOUSE_WHEEL_SPEED:
2043 if (ignore_system_lyxrc ||
2044 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2045 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2049 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2050 if (ignore_system_lyxrc ||
2051 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2052 os << "\\mouse_middlebutton_paste "
2053 << convert<string>(mouse_middlebutton_paste) << '\n';
2057 case RC_COMPLETION_INLINE_DELAY:
2058 if (ignore_system_lyxrc ||
2059 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2060 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2064 case RC_COMPLETION_INLINE_MATH:
2065 if (ignore_system_lyxrc ||
2066 completion_inline_math != system_lyxrc.completion_inline_math) {
2067 os << "\\completion_inline_math "
2068 << convert<string>(completion_inline_math) << '\n';
2072 case RC_COMPLETION_INLINE_TEXT:
2073 if (ignore_system_lyxrc ||
2074 completion_inline_text != system_lyxrc.completion_inline_text) {
2075 os << "\\completion_inline_text "
2076 << convert<string>(completion_inline_text) << '\n';
2080 case RC_COMPLETION_INLINE_DOTS:
2081 if (ignore_system_lyxrc ||
2082 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2083 os << "\\completion_inline_dots "
2084 << convert<string>(completion_inline_dots) << '\n';
2088 case RC_AUTOCORRECTION_MATH:
2089 if (ignore_system_lyxrc ||
2090 autocorrection_math != system_lyxrc.autocorrection_math) {
2091 os << "\\autocorrection_math "
2092 << convert<string>(autocorrection_math) << '\n';
2096 case RC_COMPLETION_POPUP_DELAY:
2097 if (ignore_system_lyxrc ||
2098 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2099 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2103 case RC_COMPLETION_POPUP_MATH:
2104 if (ignore_system_lyxrc ||
2105 completion_popup_math != system_lyxrc.completion_popup_math) {
2106 os << "\\completion_popup_math "
2107 << convert<string>(completion_popup_math) << '\n';
2111 case RC_COMPLETION_POPUP_TEXT:
2112 if (ignore_system_lyxrc ||
2113 completion_popup_text != system_lyxrc.completion_popup_text) {
2114 os << "\\completion_popup_text "
2115 << convert<string>(completion_popup_text) << '\n';
2119 case RC_COMPLETION_CURSOR_TEXT:
2120 if (ignore_system_lyxrc ||
2121 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2122 os << "\\completion_cursor_text "
2123 << convert<string>(completion_cursor_text) << '\n';
2127 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2128 if (ignore_system_lyxrc ||
2129 completion_popup_after_complete
2130 != system_lyxrc.completion_popup_after_complete) {
2131 os << "\\completion_popup_after_complete "
2132 << convert<string>(completion_popup_after_complete) << '\n';
2136 case RC_COMPLETION_MINLENGTH:
2137 if (ignore_system_lyxrc ||
2138 completion_minlength != system_lyxrc.completion_minlength) {
2139 os << "\\completion_minlength " << convert<string>(completion_minlength)
2145 case RC_NUMLASTFILES:
2146 if (ignore_system_lyxrc ||
2147 num_lastfiles != system_lyxrc.num_lastfiles) {
2148 os << "\\num_lastfiles " << num_lastfiles << '\n';
2152 case RC_CHECKLASTFILES:
2153 if (ignore_system_lyxrc ||
2154 check_lastfiles != system_lyxrc.check_lastfiles) {
2155 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2160 case RC_EXAMPLEPATH:
2161 if (ignore_system_lyxrc ||
2162 example_path != system_lyxrc.example_path) {
2163 string const path = os::external_path(example_path);
2164 os << "\\example_path \"" << path << "\"\n";
2168 case RC_TEMPLATEPATH:
2169 if (ignore_system_lyxrc ||
2170 template_path != system_lyxrc.template_path) {
2171 string const path = os::external_path(template_path);
2172 os << "\\template_path \"" << path << "\"\n";
2176 case RC_TEMPDIRPATH:
2177 if (ignore_system_lyxrc ||
2178 tempdir_path != system_lyxrc.tempdir_path) {
2179 string const path = os::external_path(tempdir_path);
2180 os << "\\tempdir_path \"" << path << "\"\n";
2184 case RC_THESAURUSDIRPATH:
2185 if (ignore_system_lyxrc ||
2186 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2187 string const path = os::external_path(thesaurusdir_path);
2188 os << "\\thesaurusdir_path \"" << path << "\"\n";
2192 case RC_HUNSPELLDIR_PATH:
2193 if (ignore_system_lyxrc ||
2194 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2195 string const path = os::external_path(hunspelldir_path);
2196 os << "\\hunspelldir_path \"" << path << "\"\n";
2200 case RC_PLAINTEXT_LINELEN:
2201 if (ignore_system_lyxrc ||
2202 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2203 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2207 case RC_MAKE_BACKUP:
2208 if (ignore_system_lyxrc ||
2209 make_backup != system_lyxrc.make_backup) {
2210 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2214 case RC_SAVE_COMPRESSED:
2215 if (ignore_system_lyxrc ||
2216 save_compressed != system_lyxrc.save_compressed) {
2217 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2221 case RC_SAVE_ORIGIN:
2222 if (ignore_system_lyxrc ||
2223 save_origin != system_lyxrc.save_origin) {
2224 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2228 case RC_BACKUPDIR_PATH:
2229 if (ignore_system_lyxrc ||
2230 backupdir_path != system_lyxrc.backupdir_path) {
2231 string const path = os::external_path(backupdir_path);
2232 os << "\\backupdir_path \"" << path << "\"\n";
2238 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2242 << "# SPELLCHECKER SECTION ##############################\n"
2245 case RC_ACCEPT_COMPOUND:
2246 if (ignore_system_lyxrc ||
2247 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2248 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2254 if (ignore_system_lyxrc ||
2255 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2256 os << "\\alternate_language \"" << spellchecker_alt_lang
2262 if (ignore_system_lyxrc ||
2263 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2264 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2268 case RC_USE_SYSTEM_COLORS:
2269 if (ignore_system_lyxrc ||
2270 use_system_colors != system_lyxrc.use_system_colors) {
2271 os << "\\use_system_colors "
2272 << convert<string>(use_system_colors)
2277 case RC_USE_TOOLTIP:
2278 if (ignore_system_lyxrc ||
2279 use_tooltip != system_lyxrc.use_tooltip) {
2280 os << "\\use_tooltip "
2281 << convert<string>(use_tooltip)
2286 case RC_USE_PIXMAP_CACHE:
2287 if (ignore_system_lyxrc ||
2288 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2289 os << "\\use_pixmap_cache "
2290 << convert<string>(use_pixmap_cache)
2296 if (ignore_system_lyxrc ||
2297 use_qimage != system_lyxrc.use_qimage) {
2298 os << "\\use_qimage "
2299 << convert<string>(use_qimage)
2306 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2309 case RC_DEFAULT_DECIMAL_POINT:
2310 if (ignore_system_lyxrc ||
2311 default_decimal_point != system_lyxrc.default_decimal_point) {
2312 os << "\\default_decimal_point " << default_decimal_point << '\n';
2317 case RC_DEFAULT_LENGTH_UNIT:
2318 if (ignore_system_lyxrc ||
2319 default_length_unit != system_lyxrc.default_length_unit) {
2320 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2325 case RC_SPELLCHECKER:
2326 if (ignore_system_lyxrc ||
2327 spellchecker != system_lyxrc.spellchecker) {
2328 os << "\\spellchecker " << spellchecker << '\n';
2333 case RC_SPELLCHECK_CONTINUOUSLY:
2334 if (ignore_system_lyxrc ||
2335 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2336 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2342 case RC_SPELLCHECK_NOTES:
2343 if (ignore_system_lyxrc ||
2344 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2345 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2351 case RC_VISUAL_CURSOR:
2352 if (ignore_system_lyxrc ||
2353 visual_cursor != system_lyxrc.visual_cursor) {
2354 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2358 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2359 if (ignore_system_lyxrc ||
2360 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2361 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2362 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2366 case RC_LANGUAGE_CUSTOM_PACKAGE:
2367 if (ignore_system_lyxrc ||
2368 language_custom_package != system_lyxrc.language_custom_package) {
2369 os << "\\language_custom_package \"" << language_custom_package
2374 case RC_LANGUAGE_GLOBAL_OPTIONS:
2375 if (ignore_system_lyxrc ||
2376 language_global_options
2377 != system_lyxrc.language_global_options) {
2378 os << "\\language_global_options \""
2379 << convert<string>(language_global_options)
2384 case RC_LANGUAGE_PACKAGE_SELECTION:
2385 if (ignore_system_lyxrc ||
2386 language_package_selection != system_lyxrc.language_package_selection) {
2387 os << "\\language_package_selection ";
2388 switch (language_package_selection) {
2405 case RC_LANGUAGE_COMMAND_BEGIN:
2406 if (ignore_system_lyxrc ||
2407 language_command_begin
2408 != system_lyxrc.language_command_begin) {
2409 os << "\\language_command_begin \""
2410 << language_command_begin
2415 case RC_LANGUAGE_COMMAND_END:
2416 if (ignore_system_lyxrc ||
2417 language_command_end
2418 != system_lyxrc.language_command_end) {
2419 os << "\\language_command_end \"" << language_command_end
2424 case RC_LANGUAGE_COMMAND_LOCAL:
2425 if (ignore_system_lyxrc ||
2426 language_command_local
2427 != system_lyxrc.language_command_local) {
2428 os << "\\language_command_local \""
2429 << language_command_local
2434 case RC_LANGUAGE_AUTO_BEGIN:
2435 if (ignore_system_lyxrc ||
2436 language_auto_begin != system_lyxrc.language_auto_begin) {
2437 os << "\\language_auto_begin "
2438 << convert<string>(language_auto_begin) << '\n';
2442 case RC_LANGUAGE_AUTO_END:
2443 if (ignore_system_lyxrc ||
2444 language_auto_end != system_lyxrc.language_auto_end) {
2445 os << "\\language_auto_end "
2446 << convert<string>(language_auto_end) << '\n';
2450 case RC_MARK_FOREIGN_LANGUAGE:
2451 if (ignore_system_lyxrc ||
2452 mark_foreign_language
2453 != system_lyxrc.mark_foreign_language) {
2454 os << "\\mark_foreign_language " <<
2455 convert<string>(mark_foreign_language) << '\n';
2461 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2464 case RC_AUTO_NUMBER:
2465 if (ignore_system_lyxrc ||
2466 auto_number != system_lyxrc.auto_number) {
2467 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2471 case RC_GUI_LANGUAGE:
2472 if (ignore_system_lyxrc ||
2473 gui_language != system_lyxrc.gui_language) {
2474 os << "\\gui_language " << gui_language << '\n';
2478 case RC_EXPORT_OVERWRITE:
2479 if (ignore_system_lyxrc ||
2480 export_overwrite != system_lyxrc.export_overwrite) {
2482 switch (export_overwrite) {
2493 os << "\\export_overwrite " << status << '\n';
2498 case RC_SCROLL_WHEEL_ZOOM:
2499 if (ignore_system_lyxrc ||
2500 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2502 switch (scroll_wheel_zoom) {
2503 case SCROLL_WHEEL_ZOOM_OFF:
2506 case SCROLL_WHEEL_ZOOM_CTRL:
2509 case SCROLL_WHEEL_ZOOM_SHIFT:
2512 case SCROLL_WHEEL_ZOOM_ALT:
2516 os << "\\scroll_wheel_zoom " << status << '\n';
2522 << "# FORMATS SECTION ##########################\n"
2526 // New/modified formats
2527 for (Formats::const_iterator cit = formats.begin();
2528 cit != formats.end(); ++cit) {
2529 Format const * format =
2530 system_formats.getFormat(cit->name());
2532 format->extensions() != cit->extensions() ||
2533 format->prettyname() != cit->prettyname() ||
2534 format->shortcut() != cit->shortcut() ||
2535 format->viewer() != cit->viewer() ||
2536 format->editor() != cit->editor() ||
2537 format->documentFormat() != cit->documentFormat() ||
2538 format->vectorFormat() != cit->vectorFormat() ||
2539 format->inExportMenu() != cit->inExportMenu() ||
2540 format->mime() != cit->mime()) {
2541 os << "\\format \"" << cit->name() << "\" \""
2542 << cit->extensions() << "\" \""
2543 << cit->prettyname() << "\" \""
2544 << cit->shortcut() << "\" \""
2545 << escapeCommand(cit->viewer()) << "\" \""
2546 << escapeCommand(cit->editor()) << "\" \"";
2547 vector<string> flags;
2548 if (cit->documentFormat())
2549 flags.push_back("document");
2550 if (cit->vectorFormat())
2551 flags.push_back("vector");
2552 if (cit->zippedNative())
2553 flags.push_back("zipped=native");
2554 if (cit->inExportMenu())
2555 flags.push_back("menu=export");
2557 os << getStringFromVector(flags);
2558 os << "\" \"" << cit->mime() << "\"\n";
2562 // Look for deleted formats
2563 for (Formats::const_iterator cit = system_formats.begin();
2564 cit != system_formats.end(); ++cit)
2565 if (!formats.getFormat(cit->name()))
2566 os << "\\format \"" << cit->name()
2567 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2570 case RC_VIEWER_ALTERNATIVES: {
2571 Alternatives::const_iterator it = viewer_alternatives.begin();
2572 Alternatives::const_iterator const en = viewer_alternatives.end();
2573 Alternatives::const_iterator const sysend =
2574 system_lyxrc.viewer_alternatives.end();
2575 for (; it != en; ++it) {
2576 string const & fmt = it->first;
2577 CommandSet const & cmd = it->second;
2578 CommandSet::const_iterator sit = cmd.begin();
2579 CommandSet::const_iterator const sen = cmd.end();
2580 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2581 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2582 system_lyxrc.viewer_alternatives.find(fmt);
2583 for (; sit != sen; ++sit) {
2584 string const & cmd = *sit;
2585 if (ignore_system_lyxrc
2586 || sysfmt == sysend // format not found
2587 || sysfmt->second.count(cmd) == 0 // this command not found
2589 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2595 case RC_EDITOR_ALTERNATIVES: {
2596 Alternatives::const_iterator it = editor_alternatives.begin();
2597 Alternatives::const_iterator const en = editor_alternatives.end();
2598 Alternatives::const_iterator const sysend =
2599 system_lyxrc.editor_alternatives.end();
2600 for (; it != en; ++it) {
2601 string const & fmt = it->first;
2602 CommandSet const & cmd = it->second;
2603 CommandSet::const_iterator sit = cmd.begin();
2604 CommandSet::const_iterator const sen = cmd.end();
2605 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2606 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2607 system_lyxrc.editor_alternatives.find(fmt);
2608 for (; sit != sen; ++sit) {
2609 string const & cmd = *sit;
2610 if (ignore_system_lyxrc
2611 || sysfmt == sysend // format not found
2612 || sysfmt->second.count(cmd) == 0 // this command not found
2614 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2620 case RC_DEFAULT_OTF_VIEW_FORMAT:
2621 if ((ignore_system_lyxrc ||
2622 default_otf_view_format != system_lyxrc.default_otf_view_format)
2623 && !default_otf_view_format.empty()) {
2624 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2628 case RC_DEFAULT_VIEW_FORMAT:
2629 if (ignore_system_lyxrc ||
2630 default_view_format != system_lyxrc.default_view_format) {
2631 os << "\\default_view_format " << default_view_format << '\n';
2641 << "# CONVERTERS SECTION ##########################\n"
2645 // Look for new converters
2646 for (Converters::const_iterator cit = theConverters().begin();
2647 cit != theConverters().end(); ++cit) {
2648 Converter const * converter =
2649 theSystemConverters().getConverter(cit->from(),
2652 converter->command() != cit->command() ||
2653 converter->flags() != cit->flags())
2654 os << "\\converter \"" << cit->from() << "\" \""
2655 << cit->to() << "\" \""
2656 << escapeCommand(cit->command()) << "\" \""
2657 << cit->flags() << "\"\n";
2660 // New/modifed converters
2661 for (Converters::const_iterator cit = theSystemConverters().begin();
2662 cit != theSystemConverters().end(); ++cit)
2663 if (!theConverters().getConverter(cit->from(), cit->to()))
2664 os << "\\converter \"" << cit->from()
2665 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2672 << "# COPIERS SECTION ##########################\n"
2675 // Look for new movers
2676 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2677 Movers::const_iterator const sysend = theSystemMovers().end();
2678 Movers::const_iterator it = theMovers().begin();
2679 Movers::const_iterator end = theMovers().end();
2681 for (; it != end; ++it) {
2682 Movers::const_iterator const sysit =
2683 find_if(sysbegin, sysend, SameMover(*it));
2684 if (sysit == sysend) {
2685 string const & fmt = it->first;
2686 string const & command =
2687 it->second.command();
2689 os << "\\copier " << fmt
2690 << " \"" << escapeCommand(command) << "\"\n";
2696 // We don't actually delete SpecialisedMover(s) from the
2697 // map, just clear their 'command', so there's no need
2698 // to test for anything else.
2705 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2707 // Why the switch you might ask. It is a trick to ensure that all
2708 // the elements in the LyXRCTags enum is handled. As you can see
2709 // there are no breaks at all. So it is just a huge fall-through.
2710 // The nice thing is that we will get a warning from the compiler
2711 // if we forget an element.
2712 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2714 case LyXRC::RC_LAST:
2715 case LyXRC::RC_ACCEPT_COMPOUND:
2716 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2717 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2719 case LyXRC::RC_ALT_LANG:
2720 case LyXRC::RC_PLAINTEXT_LINELEN:
2721 case LyXRC::RC_AUTOCORRECTION_MATH:
2722 case LyXRC::RC_AUTOREGIONDELETE:
2723 case LyXRC::RC_AUTORESET_OPTIONS:
2724 case LyXRC::RC_AUTOSAVE:
2725 case LyXRC::RC_AUTO_NUMBER:
2726 case LyXRC::RC_BACKUPDIR_PATH:
2727 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2728 case LyXRC::RC_BIBTEX_COMMAND:
2729 case LyXRC::RC_BINDFILE:
2730 case LyXRC::RC_CHECKLASTFILES:
2731 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2732 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2733 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2734 case LyXRC::RC_COMPLETION_INLINE_MATH:
2735 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2736 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2737 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2738 case LyXRC::RC_COMPLETION_POPUP_MATH:
2739 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2740 case LyXRC::RC_COMPLETION_MINLENGTH:
2741 case LyXRC::RC_USELASTFILEPOS:
2742 case LyXRC::RC_LOADSESSION:
2743 case LyXRC::RC_CHKTEX_COMMAND:
2744 case LyXRC::RC_CONVERTER:
2745 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2746 case LyXRC::RC_COPIER:
2747 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2748 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2749 case LyXRC::RC_DATE_INSERT_FORMAT:
2750 case LyXRC::RC_GUI_LANGUAGE:
2751 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2752 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2753 case LyXRC::RC_DEFFILE:
2754 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2755 case LyXRC::RC_DISPLAY_GRAPHICS:
2756 case LyXRC::RC_DOCUMENTPATH:
2757 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2758 FileName path(lyxrc_new.document_path);
2759 if (path.exists() && path.isDirectory())
2760 package().document_dir() = FileName(lyxrc.document_path);
2763 case LyXRC::RC_EDITOR_ALTERNATIVES:
2764 case LyXRC::RC_ESC_CHARS:
2765 case LyXRC::RC_EXAMPLEPATH:
2766 case LyXRC::RC_FONT_ENCODING:
2767 case LyXRC::RC_FILEFORMAT:
2768 case LyXRC::RC_GROUP_LAYOUTS:
2769 case LyXRC::RC_HUNSPELLDIR_PATH:
2770 case LyXRC::RC_ICON_SET:
2771 case LyXRC::RC_INDEX_ALTERNATIVES:
2772 case LyXRC::RC_INDEX_COMMAND:
2773 case LyXRC::RC_JBIBTEX_COMMAND:
2774 case LyXRC::RC_JINDEX_COMMAND:
2775 case LyXRC::RC_NOMENCL_COMMAND:
2776 case LyXRC::RC_INPUT:
2777 case LyXRC::RC_KBMAP:
2778 case LyXRC::RC_KBMAP_PRIMARY:
2779 case LyXRC::RC_KBMAP_SECONDARY:
2780 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2781 case LyXRC::RC_LANGUAGE_AUTO_END:
2782 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2783 case LyXRC::RC_LANGUAGE_COMMAND_END:
2784 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2785 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2786 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2787 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2788 case LyXRC::RC_LYXRCFORMAT:
2789 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2790 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2791 case LyXRC::RC_MACRO_EDIT_STYLE:
2792 case LyXRC::RC_MAKE_BACKUP:
2793 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2794 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2795 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2796 case LyXRC::RC_NUMLASTFILES:
2797 case LyXRC::RC_PARAGRAPH_MARKERS:
2798 case LyXRC::RC_PATH_PREFIX:
2799 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2800 prependEnvPath("PATH", lyxrc_new.path_prefix);
2801 // Resets python path
2802 support::os::python(true);
2805 case LyXRC::RC_PREVIEW:
2806 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2807 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2808 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2809 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2810 case LyXRC::RC_PRINTPAPERFLAG:
2811 case LyXRC::RC_SAVE_COMPRESSED:
2812 case LyXRC::RC_SAVE_ORIGIN:
2813 case LyXRC::RC_SCREEN_DPI:
2814 case LyXRC::RC_SCREEN_FONT_ROMAN:
2815 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2816 case LyXRC::RC_SCREEN_FONT_SANS:
2817 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2818 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2819 case LyXRC::RC_SCREEN_FONT_SIZES:
2820 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2821 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2822 case LyXRC::RC_GEOMETRY_SESSION:
2823 case LyXRC::RC_SCREEN_ZOOM:
2824 case LyXRC::RC_SERVERPIPE:
2825 case LyXRC::RC_SET_COLOR:
2826 case LyXRC::RC_SHOW_BANNER:
2827 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2828 case LyXRC::RC_SPELLCHECKER:
2829 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2832 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2833 case LyXRC::RC_SPELLCHECK_NOTES:
2834 case LyXRC::RC_SPLITINDEX_COMMAND:
2835 case LyXRC::RC_TEMPDIRPATH:
2836 case LyXRC::RC_TEMPLATEPATH:
2837 case LyXRC::RC_TEX_ALLOWS_SPACES:
2838 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2839 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2840 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2843 case LyXRC::RC_TEXINPUTS_PREFIX:
2844 case LyXRC::RC_THESAURUSDIRPATH:
2845 case LyXRC::RC_UIFILE:
2846 case LyXRC::RC_USER_EMAIL:
2847 case LyXRC::RC_USER_NAME:
2848 case LyXRC::RC_USE_CONVERTER_CACHE:
2849 case LyXRC::RC_USE_SYSTEM_COLORS:
2850 case LyXRC::RC_USE_TOOLTIP:
2851 case LyXRC::RC_USE_PIXMAP_CACHE:
2852 case LyXRC::RC_USE_QIMAGE:
2853 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2854 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2855 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2856 case LyXRC::RC_SINGLE_INSTANCE:
2857 case LyXRC::RC_SORT_LAYOUTS:
2858 case LyXRC::RC_FULL_SCREEN_LIMIT:
2859 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2860 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2861 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2862 case LyXRC::RC_FULL_SCREEN_TABBAR:
2863 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2864 case LyXRC::RC_FULL_SCREEN_WIDTH:
2865 case LyXRC::RC_VISUAL_CURSOR:
2866 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2867 case LyXRC::RC_VIEWER:
2868 case LyXRC::RC_VIEWER_ALTERNATIVES:
2869 case LyXRC::RC_FORWARD_SEARCH_DVI:
2870 case LyXRC::RC_FORWARD_SEARCH_PDF:
2871 case LyXRC::RC_EXPORT_OVERWRITE:
2872 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2873 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2874 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2875 case LyXRC::RC_CURSOR_WIDTH:
2882 string const LyXRC::getDescription(LyXRCTags tag)
2887 case RC_ACCEPT_COMPOUND:
2888 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2892 str = _("Specify an alternate language. The default is to use the language of the document.");
2895 case RC_PLAINTEXT_LINELEN:
2896 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.");
2899 case RC_AUTOREGIONDELETE:
2900 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2903 case RC_AUTORESET_OPTIONS:
2904 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2908 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2911 case RC_AUTO_NUMBER:
2914 case RC_BACKUPDIR_PATH:
2915 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.");
2918 case RC_BIBTEX_COMMAND:
2919 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2922 case RC_JBIBTEX_COMMAND:
2923 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2927 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2930 case RC_CHECKLASTFILES:
2931 str = _("Select to check whether the lastfiles still exist.");
2934 case RC_CHKTEX_COMMAND:
2935 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2944 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2945 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.");
2948 case RC_CURSOR_WIDTH:
2949 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2952 case RC_SCROLL_BELOW_DOCUMENT:
2953 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");
2956 case RC_MAC_DONTSWAP_CTRL_META:
2957 str = _("Make Apple key act as Meta and Control key as Ctrl.");
2960 case RC_MAC_LIKE_CURSOR_MOVEMENT:
2961 str = _("Use the Mac OS X conventions for cursor movement");
2964 case RC_SHOW_MACRO_LABEL:
2965 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2968 case RC_DATE_INSERT_FORMAT:
2969 //xgettext:no-c-format
2970 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2974 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2977 case RC_DEFAULT_OTF_VIEW_FORMAT:
2978 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
2981 case RC_DEFAULT_VIEW_FORMAT:
2982 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2985 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2986 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2989 case RC_DISPLAY_GRAPHICS:
2990 str = _("Select how LyX will display any graphics.");
2993 case RC_DOCUMENTPATH:
2994 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2998 str = _("Specify additional chars that can be part of a word.");
3001 case RC_EXAMPLEPATH:
3002 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3005 case RC_FONT_ENCODING:
3006 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3012 case RC_INDEX_COMMAND:
3013 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\".");
3016 case RC_JINDEX_COMMAND:
3017 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3020 case RC_NOMENCL_COMMAND:
3021 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3028 case RC_KBMAP_PRIMARY:
3029 case RC_KBMAP_SECONDARY:
3030 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.");
3033 case RC_LANGUAGE_AUTO_BEGIN:
3034 str = _("Select if a language switching command is needed at the beginning of the document.");
3037 case RC_LANGUAGE_AUTO_END:
3038 str = _("Select if a language switching command is needed at the end of the document.");
3041 case RC_LANGUAGE_COMMAND_BEGIN:
3042 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.");
3045 case RC_LANGUAGE_COMMAND_END:
3046 str = _("The LaTeX command for changing back to the language of the document.");
3049 case RC_LANGUAGE_COMMAND_LOCAL:
3050 str = _("The LaTeX command for local changing of the language.");
3053 case RC_LANGUAGE_GLOBAL_OPTIONS:
3054 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3057 case RC_LANGUAGE_CUSTOM_PACKAGE:
3058 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3061 case RC_LANGUAGE_PACKAGE_SELECTION:
3062 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3065 case RC_USELASTFILEPOS:
3066 str = _("De-select if you do not want LyX to scroll to saved position.");
3069 case RC_LOADSESSION:
3070 str = _("De-select to prevent loading files opened from the last LyX session.");
3073 case RC_MAKE_BACKUP:
3074 str = _("De-select if you don't want LyX to create backup files.");
3077 case RC_MARK_FOREIGN_LANGUAGE:
3078 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3081 case RC_MOUSE_WHEEL_SPEED:
3082 str = _("The scrolling speed of the mouse wheel.");
3085 case RC_COMPLETION_POPUP_DELAY:
3086 str = _("The completion popup delay.");
3089 case RC_COMPLETION_POPUP_MATH:
3090 str = _("Select to display the completion popup in math mode.");
3093 case RC_COMPLETION_POPUP_TEXT:
3094 str = _("Select to display the completion popup in text mode.");
3097 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3098 str = _("Show the completion popup without delay after non-unique completion attempt.");
3101 case RC_COMPLETION_POPUP_TEXT:
3102 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3105 case RC_COMPLETION_POPUP_DELAY:
3106 str = _("The inline completion delay.");
3109 case RC_COMPLETION_INLINE_MATH:
3110 str = _("Select to display the inline completion in math mode.");
3113 case RC_COMPLETION_INLINE_TEXT:
3114 str = _("Select to display the inline completion in text mode.");
3117 case RC_COMPLETION_INLINE_DOTS:
3118 str = _("Use \"...\" to shorten long completions.");
3121 case RC_AUTOCORRECTION_MATH:
3122 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3125 case RC_NUMLASTFILES:
3126 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3130 case RC_PATH_PREFIX:
3131 str = _("Specify those directories which should be "
3132 "prepended to the PATH environment variable.\n"
3133 "Use the OS native format.");
3137 str = _("Shows a typeset preview of things such as math");
3140 case RC_PREVIEW_HASHED_LABELS:
3141 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3144 case RC_PREVIEW_SCALE_FACTOR:
3145 str = _("Scale the preview size to suit.");
3148 case RC_PRINTLANDSCAPEFLAG:
3149 str = _("The option to print out in landscape.");
3152 case RC_PRINTPAPERDIMENSIONFLAG:
3153 str = _("Option to specify the dimensions of the print paper.");
3156 case RC_PRINTPAPERFLAG:
3157 str = _("The option to specify paper type.");
3160 case RC_VISUAL_CURSOR:
3161 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3164 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3165 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).");
3169 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3172 case RC_SCREEN_FONT_ROMAN:
3173 case RC_SCREEN_FONT_SANS:
3174 case RC_SCREEN_FONT_TYPEWRITER:
3175 str = _("The screen fonts used to display the text while editing.");
3178 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3179 case RC_SCREEN_FONT_SANS_FOUNDRY:
3180 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3183 case RC_SCREEN_FONT_SCALABLE:
3184 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.");
3187 case RC_SCREEN_FONT_SIZES:
3188 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3191 case RC_SCREEN_ZOOM:
3192 //xgettext:no-c-format
3193 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3196 case RC_GEOMETRY_SESSION:
3197 str = _("Allow session manager to save and restore windows geometry.");
3201 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3207 case RC_SHOW_BANNER:
3208 str = _("De-select if you don't want the startup banner.");
3211 case RC_TEMPDIRPATH:
3212 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3215 case RC_THESAURUSDIRPATH:
3216 str = _("This is the place where the files of the thesaurus library reside.");
3219 case RC_TEMPLATEPATH:
3220 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3223 case RC_TEX_ALLOWS_SPACES:
3226 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3229 case RC_TEXINPUTS_PREFIX:
3230 str = _("Specify those directories which should be "
3231 "prepended to the TEXINPUTS environment variable.\n"
3232 "A '.' represents the current document directory. "
3233 "Use the OS native format.");
3237 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3246 case RC_USE_USE_SYSTEM_COLORS:
3247 str = _("Enable use the system colors for some things like main window background and selection.");
3250 case RC_USE_TOOLTIP:
3251 str = _("Enable the automatic appearance of tool tips in the work area.");
3254 case RC_USE_PIXMAP_CACHE:
3255 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3258 case RC_VIEWDVI_PAPEROPTION:
3259 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3274 // The global instance
3277 // The global copy of the system lyxrc entries (everything except preferences)