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/userinfo.h"
50 using namespace lyx::support;
54 namespace os = support::os;
58 static unsigned int const LYXRC_FILEFORMAT = 13; // vfr: System theme's icons
60 // when adding something to this array keep it sorted!
61 LexerKeyword lyxrcTags[] = {
62 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
63 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
64 { "\\alternate_language", LyXRC::RC_ALT_LANG },
65 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
66 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
67 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
68 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
69 { "\\autosave", LyXRC::RC_AUTOSAVE },
70 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
71 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
72 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
73 { "\\bind_file", LyXRC::RC_BINDFILE },
74 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
75 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
76 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
77 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
78 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
79 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
80 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
81 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
82 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
83 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
84 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
85 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
86 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
87 { "\\converter", LyXRC::RC_CONVERTER },
88 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
89 { "\\copier", LyXRC::RC_COPIER },
90 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
91 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
92 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
93 { "\\def_file", LyXRC::RC_DEFFILE },
94 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
95 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
96 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
97 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
98 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
99 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
100 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
101 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
102 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
103 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
104 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
105 { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
106 { "\\format", LyXRC::RC_FILEFORMAT },
107 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
108 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
109 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
110 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
111 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
112 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
113 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
114 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
115 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
116 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
117 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
118 { "\\icon_set", LyXRC::RC_ICON_SET },
119 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
120 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
121 { "\\input", LyXRC::RC_INPUT },
122 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
123 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
124 { "\\kbmap", LyXRC::RC_KBMAP },
125 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
126 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
127 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
128 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
129 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
130 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
131 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
132 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
133 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
134 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
135 { "\\load_session", LyXRC::RC_LOADSESSION },
136 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
137 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
138 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
139 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
140 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
141 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
142 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
143 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
144 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
145 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
146 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
147 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
148 { "\\preview", LyXRC::RC_PREVIEW },
149 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
150 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
151 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
152 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
153 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
154 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
155 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
156 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
157 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
158 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
159 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
160 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
161 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
162 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
163 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
164 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
165 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
166 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
167 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
168 { "\\printer", LyXRC::RC_PRINTER },
169 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
170 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
171 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
172 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
173 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
174 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
175 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
176 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
177 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
178 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
179 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
180 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
181 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
182 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
183 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
184 { "\\set_color", LyXRC::RC_SET_COLOR },
185 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
186 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
187 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
188 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
189 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
190 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
191 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
192 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
193 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
194 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
195 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
196 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
197 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
198 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
199 { "\\ui_file", LyXRC::RC_UIFILE },
200 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
201 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
202 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
203 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
204 // compatibility with versions older than 1.4.0 only
205 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
206 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
207 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
208 { "\\user_email", LyXRC::RC_USER_EMAIL },
209 { "\\user_name", LyXRC::RC_USER_NAME },
210 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
211 // compatibility with versions older than 1.4.0 only
212 { "\\viewer", LyXRC::RC_VIEWER},
213 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
214 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
215 { "format", LyXRC::RC_LYXRCFORMAT }
218 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
229 void LyXRC::setDefaults()
232 use_system_theme_icons = false;
234 def_file = "default";
236 // The current document directory
237 texinputs_prefix = ".";
238 // Get printer from the environment. If fail, use default "",
239 // assuming that everything is set up correctly.
240 printer = getEnv("PRINTER");
241 print_adapt_output = false;
242 print_command = "dvips";
243 print_evenpage_flag = "-B";
244 print_oddpage_flag = "-A";
245 print_pagerange_flag = "-pp";
246 print_copies_flag = "-c";
247 print_collcopies_flag = "-C";
248 print_reverse_flag = "-r";
249 print_landscape_flag = "-t landscape";
250 print_to_printer = "-P";
251 print_to_file = "-o ";
252 print_file_extension = ".ps";
253 print_paper_flag = "-t";
254 print_paper_dimension_flag = "-T";
255 document_path.erase();
256 view_dvi_paper_option.erase();
257 default_view_format = "pdf2";
258 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
259 bibtex_command = "bibtex";
261 index_command = "makeindex -c -q";
262 nomencl_command = "makeindex -s nomencl.ist";
264 // Because a screen is typically wider than a piece of paper:
266 allow_geometry_session = true;
267 // Default LaTeX font size:
268 font_sizes[FONT_SIZE_TINY] = "5.0";
269 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
270 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
271 font_sizes[FONT_SIZE_SMALL] = "9.0";
272 font_sizes[FONT_SIZE_NORMAL] = "10.0";
273 font_sizes[FONT_SIZE_LARGE] = "12.0";
274 font_sizes[FONT_SIZE_LARGER] = "14.4";
275 font_sizes[FONT_SIZE_LARGEST] = "17.26";
276 font_sizes[FONT_SIZE_HUGE] = "20.74";
277 font_sizes[FONT_SIZE_HUGER] = "24.88";
278 use_scalable_fonts = true;
279 roman_font_name = "";
281 typewriter_font_name = "";
283 auto_region_delete = true;
284 auto_reset_options = false;
285 plaintext_linelen = 65;
286 mouse_wheel_speed = 1.0;
287 num_lastfiles = maxlastfiles;
288 check_lastfiles = true;
289 use_lastfilepos = true;
290 load_session = false;
292 save_compressed = false;
293 backupdir_path.erase();
294 display_graphics = true;
295 // Spellchecker settings:
296 // FIXME: this check should test the target platform (darwin)
297 #if defined(USE_MACOSX_PACKAGING)
298 spellchecker = "native";
299 #elif defined(USE_ASPELL)
300 spellchecker = "aspell";
301 #elif defined(USE_HUNSPELL)
302 spellchecker = "hunspell";
304 spellchecker = "aspell";
306 spellchecker_accept_compound = false;
307 spellcheck_continuously = false;
308 completion_minlength = 6;
309 spellcheck_notes = true;
312 visual_cursor = false;
314 mark_foreign_language = true;
315 language_auto_begin = true;
316 language_auto_end = true;
317 language_global_options = true;
318 language_package_selection = LP_AUTO;
319 language_custom_package = "\\usepackage{babel}";
320 language_command_begin = "\\selectlanguage{$$lang}";
321 language_command_local = "\\foreignlanguage{$$lang}{";
322 sort_layouts = false;
323 group_layouts = true;
324 gui_language = "auto";
326 windows_style_tex_paths = false;
327 tex_allows_spaces = false;
328 date_insert_format = "%x";
329 cursor_follows_scrollbar = false;
330 scroll_below_document = false;
331 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
332 paragraph_markers = false;
333 mac_dontswap_ctrl_meta = false;
334 mac_like_cursor_movement = false;
335 macro_edit_style = MACRO_EDIT_INLINE_BOX;
336 dialogs_iconify_with_main = false;
337 preview = PREVIEW_OFF;
338 preview_hashed_labels = false;
339 preview_scale_factor = 1.0;
340 use_converter_cache = true;
341 use_system_colors = false;
343 use_pixmap_cache = false;
345 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
346 user_name = to_utf8(support::user_name());
347 user_email = to_utf8(support::user_email());
348 open_buffers_in_tabs = true;
349 single_close_tab_button = false;
350 single_instance = true;
351 forward_search_dvi = string();
352 forward_search_pdf = string();
353 export_overwrite = NO_FILES;
355 // Fullscreen settings
356 full_screen_limit = false;
357 full_screen_toolbars = true;
358 full_screen_tabbar = true;
359 full_screen_menubar = true;
360 full_screen_scrollbar = true;
361 full_screen_width = 700;
363 completion_cursor_text = true;
364 completion_popup_math = true;
365 completion_popup_text = false;
366 completion_popup_delay = 2.0;
367 completion_popup_after_complete = true;
368 autocorrection_math = false;
369 completion_inline_math = true;
370 completion_inline_text = false;
371 completion_inline_dots = -1;
372 completion_inline_delay = 0.2;
373 default_decimal_point = ".";
374 default_length_unit = Length::CM;
376 close_buffer_with_last_view = "yes";
382 void oldFontFormat(string & family, string & foundry)
384 if (family.empty() || family[0] != '-')
386 foundry = token(family, '-', 1);
387 family = token(family, '-', 2);
395 bool LyXRC::read(FileName const & filename, bool check_format)
397 Lexer lexrc(lyxrcTags);
398 lexrc.setFile(filename);
399 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
400 ReturnValues retval = read(lexrc, check_format);
401 if (!check_format || retval != FormatMismatch)
402 return retval == ReadOK;
404 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
405 FileName const tempfile = FileName::tempName("convert_lyxrc");
406 bool const success = prefs2prefs(filename, tempfile, false);
408 LYXERR0 ("Unable to convert " << filename.absFileName() <<
409 " to format " << LYXRC_FILEFORMAT);
412 // Keep this in the else branch, such that lexrc2 goes out
413 // of scope and releases the lock on tempfile before we
414 // attempt to remove it. This matters on Windows.
415 Lexer lexrc2(lyxrcTags);
416 lexrc2.setFile(tempfile);
417 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
418 retval = read(lexrc2, check_format);
420 tempfile.removeFile();
421 return retval == ReadOK;
425 // don't need to worry about conversion, because this is always
426 // from an internal source
427 bool LyXRC::read(istream & is)
429 Lexer lexrc(lyxrcTags);
431 LYXERR(Debug::LYXRC, "Reading istream...");
432 return read(lexrc, false) == ReadOK;
436 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
438 if (lyxerr.debugging(Debug::PARSER))
439 lexrc.printTable(lyxerr);
444 // default for current rowpainter capabilities
445 force_paint_single_char = true;
447 // format prior to 2.0 and introduction of format tag
448 unsigned int format = 0;
450 while (lexrc.isOK()) {
451 // By using two switches we take advantage of the compiler
452 // telling us if we have missed a LyXRCTags element in
453 // the second switch.
454 // Note that this also shows a problem with Lexer since it
455 // helps us avoid taking advantage of the strictness of the
458 int le = lexrc.lex();
460 case Lexer::LEX_UNDEF:
461 lexrc.printError("Unknown tag `$$Token'");
463 case Lexer::LEX_FEOF:
468 switch (static_cast<LyXRCTags>(le)) {
471 format = lexrc.getInteger();
473 case RC_INPUT: // Include file
476 libFileSearch(string(),
478 if (read(tmp, check_format)) {
480 "Error reading included file: " + tmp.absFileName());
486 bind_file = os::internal_path(lexrc.getString());
491 def_file = os::internal_path(lexrc.getString());
496 ui_file = os::internal_path(lexrc.getString());
499 case RC_AUTORESET_OPTIONS:
500 lexrc >> auto_reset_options;
503 case RC_DISPLAY_GRAPHICS:
505 display_graphics = lexrc.getString() == "true";
508 case RC_TEX_EXPECTS_WINDOWS_PATHS:
509 lexrc >> windows_style_tex_paths;
512 case RC_TEX_ALLOWS_SPACES:
513 lexrc >> tex_allows_spaces;
516 case RC_TEXINPUTS_PREFIX:
517 lexrc >> texinputs_prefix;
524 case RC_KBMAP_PRIMARY:
526 string const kmap(os::internal_path(lexrc.getString()));
527 if (!libFileSearch("kbd", kmap, "kmap").empty()
529 primary_kbmap = kmap;
531 lexrc.printError("LyX: Keymap `$$Token' not found");
536 case RC_KBMAP_SECONDARY:
538 string const kmap(os::internal_path(lexrc.getString()));
539 if (!libFileSearch("kbd", kmap, "kmap").empty()
541 secondary_kbmap = kmap;
543 lexrc.printError("LyX: Keymap `$$Token' not found");
548 case RC_FONT_ENCODING:
552 case RC_FORCE_PAINT_SINGLE_CHAR:
553 lexrc >> force_paint_single_char;
560 case RC_PRINT_COMMAND:
561 if (lexrc.next(true)) {
562 print_command = lexrc.getString();
566 case RC_PRINTEVENPAGEFLAG:
567 lexrc >> print_evenpage_flag;
570 case RC_PRINTODDPAGEFLAG:
571 lexrc >> print_oddpage_flag;
574 case RC_PRINTPAGERANGEFLAG:
575 lexrc >> print_pagerange_flag;
578 case RC_PRINTCOPIESFLAG:
579 lexrc >> print_copies_flag;
582 case RC_PRINTCOLLCOPIESFLAG:
583 lexrc >> print_collcopies_flag;
586 case RC_PRINTREVERSEFLAG:
587 lexrc >> print_reverse_flag;
590 case RC_PRINTLANDSCAPEFLAG:
591 lexrc >> print_landscape_flag;
594 case RC_PRINTTOPRINTER:
595 lexrc >> print_to_printer;
598 case RC_PRINT_ADAPTOUTPUT:
599 lexrc >> print_adapt_output;
604 print_to_file = os::internal_path(lexrc.getString());
608 case RC_PRINTFILEEXTENSION:
609 lexrc >> print_file_extension;
612 case RC_PRINTEXSTRAOPTIONS:
613 lexrc >> print_extra_options;
616 case RC_PRINTSPOOL_COMMAND:
617 if (lexrc.next(true)) {
618 print_spool_command = lexrc.getString();
622 case RC_PRINTSPOOL_PRINTERPREFIX:
623 lexrc >> print_spool_printerprefix;
626 case RC_PRINTPAPERDIMENSIONFLAG:
627 lexrc >> print_paper_dimension_flag;
630 case RC_PRINTPAPERFLAG:
631 lexrc >> print_paper_flag;
634 case RC_VIEWDVI_PAPEROPTION:
636 view_dvi_paper_option = lexrc.getString();
638 view_dvi_paper_option.erase();
641 case RC_CHKTEX_COMMAND:
642 if (lexrc.next(true)) {
643 chktex_command = lexrc.getString();
647 case RC_BIBTEX_ALTERNATIVES:
648 if (lexrc.next(true)) {
649 bibtex_alternatives.insert(lexrc.getString());
653 case RC_BIBTEX_COMMAND:
654 if (lexrc.next(true)) {
655 bibtex_command = lexrc.getString();
659 case RC_JBIBTEX_COMMAND:
660 if (lexrc.next(true)) {
661 jbibtex_command = lexrc.getString();
665 case RC_INDEX_ALTERNATIVES:
666 if (lexrc.next(true)) {
667 index_alternatives.insert(lexrc.getString());
671 case RC_INDEX_COMMAND:
672 if (lexrc.next(true)) {
673 index_command = lexrc.getString();
677 case RC_JINDEX_COMMAND:
678 if (lexrc.next(true)) {
679 jindex_command = lexrc.getString();
683 case RC_SPLITINDEX_COMMAND:
684 if (lexrc.next(true)) {
685 splitindex_command = lexrc.getString();
689 case RC_NOMENCL_COMMAND:
690 if (lexrc.next(true)) {
691 nomencl_command = lexrc.getString();
703 case RC_GEOMETRY_SESSION:
704 lexrc >> allow_geometry_session;
707 case RC_SCREEN_FONT_SIZES:
708 lexrc >> font_sizes[FONT_SIZE_TINY];
709 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
710 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
711 lexrc >> font_sizes[FONT_SIZE_SMALL];
712 lexrc >> font_sizes[FONT_SIZE_NORMAL];
713 lexrc >> font_sizes[FONT_SIZE_LARGE];
714 lexrc >> font_sizes[FONT_SIZE_LARGER];
715 lexrc >> font_sizes[FONT_SIZE_LARGEST];
716 lexrc >> font_sizes[FONT_SIZE_HUGE];
717 lexrc >> font_sizes[FONT_SIZE_HUGER];
720 case RC_SCREEN_FONT_SCALABLE:
721 lexrc >> use_scalable_fonts;
728 case RC_DOCUMENTPATH:
730 document_path = os::internal_path(lexrc.getString());
731 document_path = expandPath(document_path);
737 example_path = os::internal_path(lexrc.getString());
738 example_path = expandPath(example_path);
742 case RC_TEMPLATEPATH:
744 template_path = os::internal_path(lexrc.getString());
745 template_path = expandPath(template_path);
751 tempdir_path = os::internal_path(lexrc.getString());
752 tempdir_path = expandPath(tempdir_path);
756 case RC_THESAURUSDIRPATH:
758 thesaurusdir_path = os::internal_path(lexrc.getString());
759 thesaurusdir_path = expandPath(thesaurusdir_path);
763 case RC_HUNSPELLDIR_PATH:
765 hunspelldir_path = os::internal_path(lexrc.getString());
766 hunspelldir_path = expandPath(hunspelldir_path);
770 case RC_USELASTFILEPOS:
771 lexrc >> use_lastfilepos;
775 lexrc >> load_session;
778 case RC_MOUSE_WHEEL_SPEED:
779 lexrc >> mouse_wheel_speed;
782 case RC_COMPLETION_INLINE_DELAY:
783 lexrc >> completion_inline_delay;
786 case RC_COMPLETION_INLINE_MATH:
787 lexrc >> completion_inline_math;
790 case RC_COMPLETION_INLINE_TEXT:
791 lexrc >> completion_inline_text;
794 case RC_COMPLETION_INLINE_DOTS:
795 lexrc >> completion_inline_dots;
798 case RC_AUTOCORRECTION_MATH:
799 lexrc >> autocorrection_math;
802 case RC_COMPLETION_POPUP_DELAY:
803 lexrc >> completion_popup_delay;
806 case RC_COMPLETION_POPUP_MATH:
807 lexrc >> completion_popup_math;
810 case RC_COMPLETION_POPUP_TEXT:
811 lexrc >> completion_popup_text;
814 case RC_COMPLETION_CURSOR_TEXT:
815 lexrc >> completion_cursor_text;
818 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
819 lexrc >> completion_popup_after_complete;
822 case RC_COMPLETION_MINLENGTH:
823 lexrc >> completion_minlength;
826 case RC_NUMLASTFILES:
827 lexrc >> num_lastfiles;
830 case RC_CHECKLASTFILES:
831 lexrc >> check_lastfiles;
838 case RC_USE_SYSTEM_THEME_ICONS:
839 lexrc >> use_system_theme_icons;
842 case RC_SCREEN_FONT_ROMAN:
844 roman_font_name = lexrc.getString();
845 oldFontFormat(roman_font_name,
850 case RC_SCREEN_FONT_SANS:
852 sans_font_name = lexrc.getString();
853 oldFontFormat(sans_font_name, sans_font_foundry);
857 case RC_SCREEN_FONT_TYPEWRITER:
859 typewriter_font_name = lexrc.getString();
860 oldFontFormat(typewriter_font_name,
861 typewriter_font_foundry);
865 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
866 lexrc >> roman_font_foundry;
869 case RC_SCREEN_FONT_SANS_FOUNDRY:
870 lexrc >> sans_font_foundry;
873 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
874 lexrc >> typewriter_font_foundry;
879 lexrc.printError("Missing color tag.");
882 string lyx_name = lexrc.getString();
885 lexrc.printError("Missing color name for color: `$$Token'");
888 string x11_name = lexrc.getString();
890 ColorCode const col =
891 lcolor.getFromLyXName(lyx_name);
892 if (col == Color_none ||
893 col == Color_inherit ||
897 if (!lcolor.setColor(col, x11_name))
898 LYXERR0("Bad lyxrc set_color for " << lyx_name);
902 case RC_AUTOREGIONDELETE:
903 // Auto region delete defaults to true
904 lexrc >> auto_region_delete;
909 lyxpipes = os::internal_path(lexrc.getString());
910 lyxpipes = expandPath(lyxpipes);
914 case RC_CURSOR_FOLLOWS_SCROLLBAR:
915 lexrc >> cursor_follows_scrollbar;
918 case RC_CURSOR_WIDTH:
919 lexrc >> cursor_width;
922 case RC_SCROLL_BELOW_DOCUMENT:
923 lexrc >> scroll_below_document;
926 case RC_PARAGRAPH_MARKERS:
927 lexrc >> paragraph_markers;
930 case RC_MAC_DONTSWAP_CTRL_META:
931 lexrc >> mac_dontswap_ctrl_meta;
934 case RC_MAC_LIKE_CURSOR_MOVEMENT:
935 lexrc >> mac_like_cursor_movement;
938 case RC_MACRO_EDIT_STYLE:
940 switch (lexrc.getInteger()) {
941 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
942 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
943 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
948 case RC_DIALOGS_ICONIFY_WITH_MAIN:
949 lexrc >> dialogs_iconify_with_main;
952 case RC_PLAINTEXT_LINELEN:
953 lexrc >> plaintext_linelen;
955 // Spellchecker settings:
956 case RC_ACCEPT_COMPOUND:
957 lexrc >> spellchecker_accept_compound;
959 case RC_USE_SYSTEM_COLORS:
960 lexrc >> use_system_colors;
963 lexrc >> use_tooltip;
965 case RC_USE_PIXMAP_CACHE:
966 lexrc >> use_pixmap_cache;
971 case RC_SPELLCHECKER:
972 lexrc >> spellchecker;
975 lexrc >> spellchecker_alt_lang;
978 lexrc >> spellchecker_esc_chars;
980 case RC_SPELLCHECK_CONTINUOUSLY:
981 lexrc >> spellcheck_continuously;
983 case RC_SPELLCHECK_NOTES:
984 lexrc >> spellcheck_notes;
987 lexrc >> make_backup;
989 case RC_SAVE_COMPRESSED:
990 lexrc >> save_compressed;
992 case RC_BACKUPDIR_PATH:
994 backupdir_path = os::internal_path(lexrc.getString());
995 backupdir_path = expandPath(backupdir_path);
998 case RC_DEFAULT_DECIMAL_POINT:
999 lexrc >> default_decimal_point;
1001 case RC_DEFAULT_LENGTH_UNIT:
1003 default_length_unit = (Length::UNIT) lexrc.getInteger();
1005 case RC_DATE_INSERT_FORMAT:
1006 lexrc >> date_insert_format;
1008 case RC_LANGUAGE_CUSTOM_PACKAGE:
1009 lexrc >> language_custom_package;
1011 case RC_LANGUAGE_AUTO_BEGIN:
1012 lexrc >> language_auto_begin;
1014 case RC_LANGUAGE_AUTO_END:
1015 lexrc >> language_auto_end;
1017 case RC_LANGUAGE_GLOBAL_OPTIONS:
1018 lexrc >> language_global_options;
1020 case RC_LANGUAGE_PACKAGE_SELECTION:
1022 switch (lexrc.getInteger()) {
1024 language_package_selection = LP_AUTO;
1027 language_package_selection = LP_BABEL;
1030 language_package_selection = LP_CUSTOM;
1033 language_package_selection = LP_NONE;
1038 case RC_LANGUAGE_COMMAND_BEGIN:
1039 lexrc >> language_command_begin;
1041 case RC_LANGUAGE_COMMAND_END:
1042 lexrc >> language_command_end;
1044 case RC_LANGUAGE_COMMAND_LOCAL:
1045 lexrc >> language_command_local;
1047 case RC_RTL_SUPPORT:
1048 lexrc >> rtl_support;
1050 case RC_VISUAL_CURSOR:
1051 lexrc >> visual_cursor;
1053 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
1054 lexrc >> close_buffer_with_last_view;
1056 case RC_AUTO_NUMBER:
1057 lexrc >> auto_number;
1059 case RC_MARK_FOREIGN_LANGUAGE:
1060 lexrc >> mark_foreign_language;
1064 string fmt, command;
1066 fmt = lexrc.getString();
1067 if (lexrc.next(true))
1068 command = lexrc.getString();
1069 setMover(fmt, command);
1073 case RC_CONVERTER: {
1074 string from, to, command, flags;
1076 from = lexrc.getString();
1078 to = lexrc.getString();
1079 if (lexrc.next(true))
1080 command = lexrc.getString();
1082 flags = lexrc.getString();
1083 if (command.empty())
1084 theConverters().erase(from, to);
1086 theConverters().add(from, to, command, flags);
1089 // compatibility with versions older than 1.4.0 only
1091 string format, command;
1092 lexrc >> format >> command;
1093 formats.setViewer(format, command);
1096 case RC_FILEFORMAT: {
1098 string format, extensions, prettyname, shortcut;
1099 if (!(lexrc >> format >> extensions))
1101 if (ok && lexrc.next(true))
1102 prettyname = lexrc.getString();
1106 if(!(lexrc >> shortcut))
1108 string viewer, editor;
1109 if (ok && lexrc.next(true))
1110 viewer = lexrc.getString();
1113 if (ok && lexrc.next(true))
1114 editor = lexrc.getString();
1118 if (!(lexrc >> flags >> mime))
1120 int flgs = Format::none;
1121 while (!flags.empty()) {
1123 flags = split(flags, flag, ',');
1124 if (flag == "document")
1125 flgs |= Format::document;
1126 else if (flag == "vector")
1127 flgs |= Format::vector;
1128 else if (flag == "zipped=native")
1129 flgs |= Format::zipped_native;
1130 else if (flag == "menu=export")
1131 flgs |= Format::export_menu;
1133 LYXERR0("Ignoring unknown flag `"
1134 << flag << "' for format `"
1138 LYXERR0("Syntax error in format " << format);
1139 else if (prettyname.empty()) {
1140 if (theConverters().formatIsUsed(format))
1141 LYXERR0("Can't delete format " << format);
1143 formats.erase(format);
1145 formats.add(format, extensions, prettyname,
1146 shortcut, viewer, editor, mime, flgs);
1150 case RC_VIEWER_ALTERNATIVES: {
1151 string format, command;
1154 viewer_alternatives[format].insert(command);
1157 case RC_EDITOR_ALTERNATIVES: {
1158 string format, command;
1161 editor_alternatives[format].insert(command);
1165 case RC_DEFAULT_VIEW_FORMAT:
1166 lexrc >> default_view_format;
1169 case RC_GUI_LANGUAGE:
1170 lexrc >> gui_language;
1173 case RC_SHOW_BANNER:
1174 lexrc >> show_banner;
1179 string const tmp = lexrc.getString();
1180 if (tmp == "true" || tmp == "on")
1181 preview = PREVIEW_ON;
1182 else if (tmp == "no_math")
1183 preview = PREVIEW_NO_MATH;
1185 preview = PREVIEW_OFF;
1186 if (tmp != "false" && tmp != "off")
1187 LYXERR0("Unrecognized preview status \""
1193 case RC_PREVIEW_HASHED_LABELS:
1194 lexrc >> preview_hashed_labels;
1197 case RC_PREVIEW_SCALE_FACTOR:
1198 lexrc >> preview_scale_factor;
1205 lexrc >> user_email;
1208 case RC_PATH_PREFIX:
1209 lexrc >> path_prefix;
1212 case RC_USE_CONVERTER_CACHE:
1213 lexrc >> use_converter_cache;
1215 case RC_CONVERTER_CACHE_MAXAGE:
1216 lexrc >> converter_cache_maxage;
1219 case RC_SORT_LAYOUTS:
1220 lexrc >> sort_layouts;
1222 case RC_GROUP_LAYOUTS:
1223 lexrc >> group_layouts;
1225 case RC_FULL_SCREEN_LIMIT:
1226 lexrc >> full_screen_limit;
1228 case RC_FULL_SCREEN_TOOLBARS:
1229 lexrc >> full_screen_toolbars;
1231 case RC_FULL_SCREEN_SCROLLBAR:
1232 lexrc >> full_screen_scrollbar;
1234 case RC_FULL_SCREEN_TABBAR:
1235 lexrc >> full_screen_tabbar;
1237 case RC_FULL_SCREEN_MENUBAR:
1238 lexrc >> full_screen_menubar;
1240 case RC_FULL_SCREEN_WIDTH:
1241 lexrc >> full_screen_width;
1243 case RC_OPEN_BUFFERS_IN_TABS:
1244 lexrc >> open_buffers_in_tabs;
1246 case RC_SINGLE_CLOSE_TAB_BUTTON:
1247 lexrc >> single_close_tab_button;
1249 case RC_SINGLE_INSTANCE:
1250 lexrc >> single_instance;
1251 if (run_mode == PREFERRED)
1252 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1254 case RC_FORWARD_SEARCH_DVI:
1255 if (lexrc.next(true))
1256 forward_search_dvi = lexrc.getString();
1258 case RC_FORWARD_SEARCH_PDF:
1259 if (lexrc.next(true))
1260 forward_search_pdf = lexrc.getString();
1262 case RC_EXPORT_OVERWRITE:
1264 string const tmp = lexrc.getString();
1265 if (tmp == "all" || tmp == "true")
1266 export_overwrite = ALL_FILES;
1267 else if (tmp == "main")
1268 export_overwrite = MAIN_FILE;
1270 export_overwrite = NO_FILES;
1271 if (tmp != "ask" && tmp != "false")
1272 LYXERR0("Unrecognized export_overwrite status \""
1277 case RC_SCROLL_WHEEL_ZOOM:
1279 string const tmp = lexrc.getString();
1281 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1282 else if (tmp == "shift")
1283 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1284 else if (tmp == "alt")
1285 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1287 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1288 if (tmp != "off" && tmp != "false")
1289 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1296 break; // this is just a dummy
1299 // This is triggered the first time through the loop unless
1300 // we hit a format tag.
1301 if (check_format && format != LYXRC_FILEFORMAT)
1302 return FormatMismatch;
1305 /// Update converters data-structures
1306 theConverters().update(formats);
1307 theConverters().buildGraph();
1313 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1315 ofstream ofs(filename.toFilesystemEncoding().c_str());
1317 write(ofs, ignore_system_lyxrc);
1321 void LyXRC::print() const
1323 if (lyxerr.debugging())
1324 write(lyxerr, false);
1332 typedef pair<string, SpecialisedMover> Data;
1334 SameMover(Data const & comparison)
1335 : comparison_(comparison) {}
1337 bool operator()(Data const & data) const
1339 return data.first == comparison_.first &&
1340 data.second.command() == comparison_.second.command();
1350 // Escape \ and " so that LyXLex can read the string later
1351 string escapeCommand(string const & str) {
1352 return subst(subst(str , "\\", "\\\\"),
1359 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1361 LyXRCTags tag = RC_LAST;
1363 if (!name.empty()) {
1364 for (int i = 0; i != lyxrcCount; ++i)
1365 if ("\\" + name == lyxrcTags[i].tag)
1366 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1370 os << "# LyX " << lyx_version
1371 << " generated this file. If you want to make your own\n"
1372 << "# modifications you should do them from inside LyX and save.\n\n"
1373 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1375 // Why the switch you might ask. It is a trick to ensure that all
1376 // the elements in the LyXRCTags enum are handled. As you can see
1377 // there are no breaks at all. So it is just a huge fall-through.
1378 // The nice thing is that we will get a warning from the compiler
1379 // if we forget an element.
1383 // input/include files are not done here
1384 case RC_LYXRCFORMAT:
1386 if (ignore_system_lyxrc ||
1387 bind_file != system_lyxrc.bind_file) {
1388 string const path = os::external_path(bind_file);
1389 os << "\\bind_file \"" << path << "\"\n";
1395 if (ignore_system_lyxrc ||
1396 def_file != system_lyxrc.def_file) {
1397 string const path = os::external_path(def_file);
1398 os << "\\def_file \"" << path << "\"\n";
1407 << "# MISC SECTION ######################################\n"
1409 // bind files are not done here.
1411 case RC_PATH_PREFIX:
1412 if (ignore_system_lyxrc ||
1413 path_prefix != system_lyxrc.path_prefix) {
1414 os << "\\path_prefix \"" << path_prefix << "\"\n";
1419 if (ignore_system_lyxrc ||
1420 ui_file != system_lyxrc.ui_file) {
1421 string const path = os::external_path(ui_file);
1422 os << "\\ui_file \"" << path << "\"\n";
1426 case RC_AUTOREGIONDELETE:
1427 if (ignore_system_lyxrc ||
1428 auto_region_delete != system_lyxrc.auto_region_delete) {
1429 os << "# Set to false to inhibit automatic replacement of\n"
1430 << "# the current selection.\n"
1431 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1436 case RC_AUTORESET_OPTIONS:
1437 if (ignore_system_lyxrc ||
1438 auto_reset_options != system_lyxrc.auto_reset_options) {
1439 os << "# Set to false to inhibit automatic reset of\n"
1440 << "# the class options to defaults on class change.\n"
1441 << "\\auto_reset_options "
1442 << convert<string>(auto_reset_options)
1448 if (ignore_system_lyxrc ||
1449 autosave != system_lyxrc.autosave) {
1450 os << "# The time interval between auto-saves in seconds.\n"
1451 << "\\autosave " << autosave << '\n';
1455 case RC_DISPLAY_GRAPHICS:
1456 if (ignore_system_lyxrc ||
1457 display_graphics != system_lyxrc.display_graphics) {
1458 os << "# Display graphics within LyX\n"
1460 << "\\display_graphics "
1461 << (display_graphics ? "true" : "false")
1466 case RC_SORT_LAYOUTS:
1467 if (ignore_system_lyxrc ||
1468 sort_layouts != system_lyxrc.sort_layouts) {
1469 os << "# Sort layouts alphabetically.\n"
1470 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1474 case RC_GROUP_LAYOUTS:
1475 if (ignore_system_lyxrc ||
1476 group_layouts != system_lyxrc.group_layouts) {
1477 os << "# Group layouts by their category.\n"
1478 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1482 case RC_VIEWDVI_PAPEROPTION:
1483 if (ignore_system_lyxrc ||
1484 view_dvi_paper_option
1485 != system_lyxrc.view_dvi_paper_option) {
1486 os << "# Options used to specify paper size to the\n"
1487 << "# view_dvi_command (e.g. -paper)\n"
1488 << "\\view_dvi_paper_option \""
1489 << view_dvi_paper_option << "\"\n";
1493 case RC_CHKTEX_COMMAND:
1494 if (ignore_system_lyxrc ||
1495 chktex_command != system_lyxrc.chktex_command) {
1496 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1500 case RC_BIBTEX_ALTERNATIVES: {
1501 CommandSet::const_iterator it = bibtex_alternatives.begin();
1502 CommandSet::const_iterator end = bibtex_alternatives.end();
1503 for ( ; it != end; ++it) {
1504 if (ignore_system_lyxrc
1505 || !system_lyxrc.bibtex_alternatives.count(*it))
1506 os << "\\bibtex_alternatives \""
1512 case RC_BIBTEX_COMMAND:
1513 if (ignore_system_lyxrc ||
1514 bibtex_command != system_lyxrc.bibtex_command) {
1515 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1519 case RC_JBIBTEX_COMMAND:
1520 if (ignore_system_lyxrc ||
1521 jbibtex_command != system_lyxrc.jbibtex_command) {
1522 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1526 case RC_INDEX_ALTERNATIVES: {
1527 CommandSet::const_iterator it = index_alternatives.begin();
1528 CommandSet::const_iterator end = index_alternatives.end();
1529 for ( ; it != end; ++it) {
1530 if (ignore_system_lyxrc
1531 || !system_lyxrc.index_alternatives.count(*it))
1532 os << "\\index_alternatives \""
1538 case RC_INDEX_COMMAND:
1539 if (ignore_system_lyxrc ||
1540 index_command != system_lyxrc.index_command) {
1541 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1545 case RC_JINDEX_COMMAND:
1546 if (ignore_system_lyxrc ||
1547 jindex_command != system_lyxrc.jindex_command) {
1548 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1552 case RC_SPLITINDEX_COMMAND:
1553 if (ignore_system_lyxrc ||
1554 splitindex_command != system_lyxrc.splitindex_command) {
1555 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1559 case RC_NOMENCL_COMMAND:
1560 if (ignore_system_lyxrc ||
1561 nomencl_command != system_lyxrc.nomencl_command) {
1562 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1566 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1567 // Don't write this setting to the preferences file,
1568 // but allow temporary changes (bug 7557).
1569 if (ignore_system_lyxrc) {
1570 os << "\\tex_expects_windows_paths "
1571 << convert<string>(windows_style_tex_paths) << '\n';
1575 case RC_TEX_ALLOWS_SPACES:
1576 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1577 os << "\\tex_allows_spaces "
1578 << convert<string>(tex_allows_spaces) << '\n';
1583 if (ignore_system_lyxrc ||
1584 use_kbmap != system_lyxrc.use_kbmap) {
1585 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1589 case RC_KBMAP_PRIMARY:
1590 if (ignore_system_lyxrc ||
1591 primary_kbmap != system_lyxrc.primary_kbmap) {
1592 string const path = os::external_path(primary_kbmap);
1593 os << "\\kbmap_primary \"" << path << "\"\n";
1597 case RC_KBMAP_SECONDARY:
1598 if (ignore_system_lyxrc ||
1599 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1600 string const path = os::external_path(secondary_kbmap);
1601 os << "\\kbmap_secondary \"" << path << "\"\n";
1606 if (ignore_system_lyxrc ||
1607 lyxpipes != system_lyxrc.lyxpipes) {
1608 string const path = os::external_path(lyxpipes);
1609 os << "\\serverpipe \"" << path << "\"\n";
1613 case RC_DATE_INSERT_FORMAT:
1614 if (ignore_system_lyxrc ||
1615 date_insert_format != system_lyxrc.date_insert_format) {
1616 os << "\\date_insert_format \"" << date_insert_format
1623 os << "\\user_name \"" << user_name << "\"\n";
1628 os << "\\user_email \"" << user_email << "\"\n";
1632 case RC_SHOW_BANNER:
1633 if (ignore_system_lyxrc ||
1634 show_banner != system_lyxrc.show_banner) {
1635 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1641 if (ignore_system_lyxrc ||
1642 preview != system_lyxrc.preview) {
1648 case PREVIEW_NO_MATH:
1655 os << "\\preview " << status << '\n';
1660 case RC_PREVIEW_HASHED_LABELS:
1661 if (ignore_system_lyxrc ||
1662 preview_hashed_labels !=
1663 system_lyxrc.preview_hashed_labels) {
1664 os << "\\preview_hashed_labels "
1665 << convert<string>(preview_hashed_labels) << '\n';
1670 case RC_PREVIEW_SCALE_FACTOR:
1671 if (ignore_system_lyxrc ||
1672 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1673 os << "\\preview_scale_factor "
1674 << preview_scale_factor << '\n';
1679 case RC_USE_CONVERTER_CACHE:
1680 if (ignore_system_lyxrc ||
1681 use_converter_cache != system_lyxrc.use_converter_cache) {
1682 os << "\\use_converter_cache "
1683 << convert<string>(use_converter_cache) << '\n';
1688 case RC_CONVERTER_CACHE_MAXAGE:
1689 if (ignore_system_lyxrc ||
1690 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1691 os << "\\converter_cache_maxage "
1692 << converter_cache_maxage << '\n';
1698 << "# SCREEN & FONTS SECTION ############################\n"
1702 if (ignore_system_lyxrc ||
1703 icon_set != system_lyxrc.icon_set) {
1704 os << "\\icon_set \"" << icon_set
1710 case RC_USE_SYSTEM_THEME_ICONS:
1711 if (ignore_system_lyxrc ||
1712 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1713 os << "\\use_system_theme_icons "
1714 << convert<string>(use_system_theme_icons)
1721 if (ignore_system_lyxrc ||
1722 dpi != system_lyxrc.dpi) {
1723 os << "\\screen_dpi " << dpi << '\n';
1727 case RC_SCREEN_ZOOM:
1728 if (ignore_system_lyxrc ||
1729 zoom != system_lyxrc.zoom) {
1730 os << "\\screen_zoom " << zoom << '\n';
1734 case RC_GEOMETRY_SESSION:
1735 if (ignore_system_lyxrc ||
1736 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1737 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1742 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1743 if (ignore_system_lyxrc ||
1744 cursor_follows_scrollbar
1745 != system_lyxrc.cursor_follows_scrollbar) {
1746 os << "\\cursor_follows_scrollbar "
1747 << convert<string>(cursor_follows_scrollbar) << '\n';
1751 case RC_CURSOR_WIDTH:
1752 if (ignore_system_lyxrc ||
1754 != system_lyxrc.cursor_width) {
1755 os << "\\cursor_width "
1756 << cursor_width << '\n';
1760 case RC_SCROLL_BELOW_DOCUMENT:
1761 if (ignore_system_lyxrc ||
1762 scroll_below_document
1763 != system_lyxrc.scroll_below_document) {
1764 os << "\\scroll_below_document "
1765 << convert<string>(scroll_below_document) << '\n';
1769 case RC_PARAGRAPH_MARKERS:
1770 if (ignore_system_lyxrc ||
1772 != system_lyxrc.paragraph_markers) {
1773 os << "\\paragraph_markers "
1774 << convert<string>(paragraph_markers) << '\n';
1778 case RC_MAC_DONTSWAP_CTRL_META:
1779 if (ignore_system_lyxrc ||
1780 mac_dontswap_ctrl_meta
1781 != system_lyxrc.mac_dontswap_ctrl_meta) {
1782 os << "\\mac_dontswap_ctrl_meta "
1783 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1787 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1788 if (ignore_system_lyxrc ||
1789 mac_like_cursor_movement
1790 != system_lyxrc.mac_like_cursor_movement) {
1791 os << "\\mac_like_cursor_movement "
1792 << convert<string>(mac_like_cursor_movement) << '\n';
1796 case RC_MACRO_EDIT_STYLE:
1797 if (ignore_system_lyxrc ||
1799 != system_lyxrc.macro_edit_style) {
1800 os << "\\macro_edit_style ";
1801 switch (macro_edit_style) {
1802 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1803 case MACRO_EDIT_INLINE: os << "1\n"; break;
1804 case MACRO_EDIT_LIST: os << "2\n"; break;
1809 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1810 if (ignore_system_lyxrc ||
1811 dialogs_iconify_with_main
1812 != system_lyxrc.dialogs_iconify_with_main) {
1813 os << "\\dialogs_iconify_with_main "
1814 << convert<string>(dialogs_iconify_with_main) << '\n';
1818 case RC_SCREEN_FONT_ROMAN:
1819 if (ignore_system_lyxrc ||
1820 roman_font_name != system_lyxrc.roman_font_name) {
1821 os << "\\screen_font_roman \"" << roman_font_name
1826 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1827 if (ignore_system_lyxrc ||
1828 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1829 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1834 case RC_SCREEN_FONT_SANS:
1835 if (ignore_system_lyxrc ||
1836 sans_font_name != system_lyxrc.sans_font_name) {
1837 os << "\\screen_font_sans \"" << sans_font_name
1842 case RC_SCREEN_FONT_SANS_FOUNDRY:
1843 if (ignore_system_lyxrc ||
1844 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1845 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1850 case RC_SCREEN_FONT_TYPEWRITER:
1851 if (ignore_system_lyxrc ||
1852 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1853 os << "\\screen_font_typewriter \""
1854 << typewriter_font_name << "\"\n";
1858 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1859 if (ignore_system_lyxrc ||
1860 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1861 os << "\\screen_font_typewriter_foundry \""
1862 << typewriter_font_foundry << "\"\n";
1867 case RC_SCREEN_FONT_SCALABLE:
1868 if (ignore_system_lyxrc ||
1869 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1870 os << "\\screen_font_scalable "
1871 << convert<string>(use_scalable_fonts)
1876 case RC_SCREEN_FONT_SIZES:
1877 if (ignore_system_lyxrc ||
1878 font_sizes[FONT_SIZE_TINY]
1879 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1880 font_sizes[FONT_SIZE_SCRIPT]
1881 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1882 font_sizes[FONT_SIZE_FOOTNOTE]
1883 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1884 font_sizes[FONT_SIZE_SMALL]
1885 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1886 font_sizes[FONT_SIZE_NORMAL]
1887 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1888 font_sizes[FONT_SIZE_LARGE]
1889 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1890 font_sizes[FONT_SIZE_LARGER]
1891 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1892 font_sizes[FONT_SIZE_LARGEST]
1893 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1894 font_sizes[FONT_SIZE_HUGE]
1895 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1896 font_sizes[FONT_SIZE_HUGER]
1897 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1898 os.setf(ios::fixed);
1900 os << "\\screen_font_sizes"
1901 << ' ' << font_sizes[FONT_SIZE_TINY]
1902 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1903 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1904 << ' ' << font_sizes[FONT_SIZE_SMALL]
1905 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1906 << ' ' << font_sizes[FONT_SIZE_LARGE]
1907 << ' ' << font_sizes[FONT_SIZE_LARGER]
1908 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1909 << ' ' << font_sizes[FONT_SIZE_HUGE]
1910 << ' ' << font_sizes[FONT_SIZE_HUGER]
1915 case RC_FULL_SCREEN_LIMIT:
1916 if (ignore_system_lyxrc ||
1917 full_screen_limit != system_lyxrc.full_screen_limit) {
1918 os << "\\fullscreen_limit "
1919 << convert<string>(full_screen_limit)
1924 case RC_FULL_SCREEN_TOOLBARS:
1925 if (ignore_system_lyxrc ||
1926 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1927 os << "\\fullscreen_toolbars "
1928 << convert<string>(full_screen_toolbars)
1933 case RC_FULL_SCREEN_SCROLLBAR:
1934 if (ignore_system_lyxrc ||
1935 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1936 os << "\\fullscreen_scrollbar "
1937 << convert<string>(full_screen_scrollbar)
1942 case RC_FULL_SCREEN_TABBAR:
1943 if (ignore_system_lyxrc ||
1944 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1945 os << "\\fullscreen_tabbar "
1946 << convert<string>(full_screen_tabbar)
1951 case RC_FULL_SCREEN_MENUBAR:
1952 if (ignore_system_lyxrc ||
1953 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1954 os << "\\fullscreen_menubar "
1955 << convert<string>(full_screen_menubar)
1960 case RC_FULL_SCREEN_WIDTH:
1961 if (ignore_system_lyxrc ||
1962 full_screen_width != system_lyxrc.full_screen_width) {
1963 os << "\\fullscreen_width "
1964 << convert<string>(full_screen_width)
1969 case RC_OPEN_BUFFERS_IN_TABS:
1970 if (ignore_system_lyxrc ||
1971 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1972 os << "\\open_buffers_in_tabs "
1973 << convert<string>(open_buffers_in_tabs)
1978 case RC_SINGLE_CLOSE_TAB_BUTTON:
1979 if (ignore_system_lyxrc ||
1980 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1981 os << "\\single_close_tab_button "
1982 << convert<string>(single_close_tab_button)
1987 case RC_SINGLE_INSTANCE:
1988 if (ignore_system_lyxrc ||
1989 single_instance != system_lyxrc.single_instance) {
1990 os << "\\single_instance "
1991 << convert<string>(single_instance)
1996 case RC_FORWARD_SEARCH_DVI:
1997 if (ignore_system_lyxrc ||
1998 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1999 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2003 case RC_FORWARD_SEARCH_PDF:
2004 if (ignore_system_lyxrc ||
2005 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2006 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2012 << "# COLOR SECTION ###################################\n"
2016 for (int i = 0; i < Color_ignore; ++i) {
2017 ColorCode lc = static_cast<ColorCode>(i);
2018 string const col = lcolor.getX11Name(lc);
2019 if (ignore_system_lyxrc
2020 || col != system_lcolor.getX11Name(lc)) {
2021 os << "\\set_color \""
2022 << lcolor.getLyXName(lc) << "\" \""
2030 << "# PRINTER SECTION ###################################\n"
2034 if (ignore_system_lyxrc ||
2035 printer != system_lyxrc.printer) {
2036 os << "\\printer \"" << printer << "\"\n";
2040 case RC_PRINT_ADAPTOUTPUT:
2041 if (ignore_system_lyxrc ||
2042 print_adapt_output != system_lyxrc.print_adapt_output) {
2043 os << "\\print_adapt_output "
2044 << convert<string>(print_adapt_output)
2049 case RC_PRINT_COMMAND:
2050 if (ignore_system_lyxrc ||
2051 print_command != system_lyxrc.print_command) {
2052 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2056 case RC_PRINTEXSTRAOPTIONS:
2057 if (ignore_system_lyxrc ||
2058 print_extra_options != system_lyxrc.print_extra_options) {
2059 os << "\\print_extra_options \"" << print_extra_options
2064 case RC_PRINTSPOOL_COMMAND:
2065 if (ignore_system_lyxrc ||
2066 print_spool_command != system_lyxrc.print_spool_command) {
2067 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2072 case RC_PRINTSPOOL_PRINTERPREFIX:
2073 if (ignore_system_lyxrc ||
2074 print_spool_printerprefix
2075 != system_lyxrc.print_spool_printerprefix) {
2076 os << "\\print_spool_printerprefix \""
2077 << print_spool_printerprefix << "\"\n";
2081 case RC_PRINTEVENPAGEFLAG:
2082 if (ignore_system_lyxrc ||
2083 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2084 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2089 case RC_PRINTODDPAGEFLAG:
2090 if (ignore_system_lyxrc ||
2091 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2092 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2097 case RC_PRINTREVERSEFLAG:
2098 if (ignore_system_lyxrc ||
2099 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2100 os << "\\print_reverse_flag \"" << print_reverse_flag
2105 case RC_PRINTLANDSCAPEFLAG:
2106 if (ignore_system_lyxrc ||
2107 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2108 os << "\\print_landscape_flag \"" << print_landscape_flag
2113 case RC_PRINTPAGERANGEFLAG:
2114 if (ignore_system_lyxrc ||
2115 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2116 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2121 case RC_PRINTCOPIESFLAG:
2122 if (ignore_system_lyxrc ||
2123 print_copies_flag != system_lyxrc.print_copies_flag) {
2124 os << "\\print_copies_flag \"" << print_copies_flag
2129 case RC_PRINTCOLLCOPIESFLAG:
2130 if (ignore_system_lyxrc ||
2131 print_collcopies_flag
2132 != system_lyxrc.print_collcopies_flag) {
2133 os << "\\print_collcopies_flag \""
2134 << print_collcopies_flag
2139 case RC_PRINTPAPERFLAG:
2140 if (ignore_system_lyxrc ||
2141 print_paper_flag != system_lyxrc.print_paper_flag) {
2142 os << "\\print_paper_flag \"" << print_paper_flag
2147 case RC_PRINTPAPERDIMENSIONFLAG:
2148 if (ignore_system_lyxrc ||
2149 print_paper_dimension_flag
2150 != system_lyxrc.print_paper_dimension_flag) {
2151 os << "\\print_paper_dimension_flag \""
2152 << print_paper_dimension_flag << "\"\n";
2156 case RC_PRINTTOPRINTER:
2157 if (ignore_system_lyxrc ||
2158 print_to_printer != system_lyxrc.print_to_printer) {
2159 os << "\\print_to_printer \"" << print_to_printer
2164 case RC_PRINTTOFILE:
2165 if (ignore_system_lyxrc ||
2166 print_to_file != system_lyxrc.print_to_file) {
2167 string const path = os::external_path(print_to_file);
2168 os << "\\print_to_file \"" << path << "\"\n";
2172 case RC_PRINTFILEEXTENSION:
2173 if (ignore_system_lyxrc ||
2174 print_file_extension != system_lyxrc.print_file_extension) {
2175 os << "\\print_file_extension \""
2176 << print_file_extension
2183 << "# TEX SECTION #######################################\n"
2186 case RC_TEXINPUTS_PREFIX:
2187 if (ignore_system_lyxrc ||
2188 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2189 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2194 case RC_FONT_ENCODING:
2195 if (ignore_system_lyxrc ||
2196 fontenc != system_lyxrc.fontenc) {
2197 os << "\\font_encoding \"" << fontenc << "\"\n";
2202 case RC_FORCE_PAINT_SINGLE_CHAR:
2203 if (ignore_system_lyxrc ||
2204 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2205 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2211 << "# FILE SECTION ######################################\n"
2214 case RC_DOCUMENTPATH:
2215 if (ignore_system_lyxrc ||
2216 document_path != system_lyxrc.document_path) {
2217 string const path = os::external_path(document_path);
2218 os << "\\document_path \"" << path << "\"\n";
2222 case RC_USELASTFILEPOS:
2223 if (ignore_system_lyxrc ||
2224 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2225 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2230 case RC_LOADSESSION:
2231 if (ignore_system_lyxrc ||
2232 load_session != system_lyxrc.load_session) {
2233 os << "\\load_session " << convert<string>(load_session)
2238 case RC_MOUSE_WHEEL_SPEED:
2239 if (ignore_system_lyxrc ||
2240 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2241 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2245 case RC_COMPLETION_INLINE_DELAY:
2246 if (ignore_system_lyxrc ||
2247 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2248 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2252 case RC_COMPLETION_INLINE_MATH:
2253 if (ignore_system_lyxrc ||
2254 completion_inline_math != system_lyxrc.completion_inline_math) {
2255 os << "\\completion_inline_math "
2256 << convert<string>(completion_inline_math) << '\n';
2260 case RC_COMPLETION_INLINE_TEXT:
2261 if (ignore_system_lyxrc ||
2262 completion_inline_text != system_lyxrc.completion_inline_text) {
2263 os << "\\completion_inline_text "
2264 << convert<string>(completion_inline_text) << '\n';
2268 case RC_COMPLETION_INLINE_DOTS:
2269 if (ignore_system_lyxrc ||
2270 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2271 os << "\\completion_inline_dots "
2272 << convert<string>(completion_inline_dots) << '\n';
2276 case RC_AUTOCORRECTION_MATH:
2277 if (ignore_system_lyxrc ||
2278 autocorrection_math != system_lyxrc.autocorrection_math) {
2279 os << "\\autocorrection_math "
2280 << convert<string>(autocorrection_math) << '\n';
2284 case RC_COMPLETION_POPUP_DELAY:
2285 if (ignore_system_lyxrc ||
2286 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2287 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2291 case RC_COMPLETION_POPUP_MATH:
2292 if (ignore_system_lyxrc ||
2293 completion_popup_math != system_lyxrc.completion_popup_math) {
2294 os << "\\completion_popup_math "
2295 << convert<string>(completion_popup_math) << '\n';
2299 case RC_COMPLETION_POPUP_TEXT:
2300 if (ignore_system_lyxrc ||
2301 completion_popup_text != system_lyxrc.completion_popup_text) {
2302 os << "\\completion_popup_text "
2303 << convert<string>(completion_popup_text) << '\n';
2307 case RC_COMPLETION_CURSOR_TEXT:
2308 if (ignore_system_lyxrc ||
2309 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2310 os << "\\completion_cursor_text "
2311 << convert<string>(completion_cursor_text) << '\n';
2315 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2316 if (ignore_system_lyxrc ||
2317 completion_popup_after_complete
2318 != system_lyxrc.completion_popup_after_complete) {
2319 os << "\\completion_popup_after_complete "
2320 << convert<string>(completion_popup_after_complete) << '\n';
2324 case RC_COMPLETION_MINLENGTH:
2325 if (ignore_system_lyxrc ||
2326 completion_minlength != system_lyxrc.completion_minlength) {
2327 os << "\\completion_minlength " << convert<string>(completion_minlength)
2333 case RC_NUMLASTFILES:
2334 if (ignore_system_lyxrc ||
2335 num_lastfiles != system_lyxrc.num_lastfiles) {
2336 os << "\\num_lastfiles " << num_lastfiles << '\n';
2340 case RC_CHECKLASTFILES:
2341 if (ignore_system_lyxrc ||
2342 check_lastfiles != system_lyxrc.check_lastfiles) {
2343 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2348 case RC_EXAMPLEPATH:
2349 if (ignore_system_lyxrc ||
2350 example_path != system_lyxrc.example_path) {
2351 string const path = os::external_path(example_path);
2352 os << "\\example_path \"" << path << "\"\n";
2356 case RC_TEMPLATEPATH:
2357 if (ignore_system_lyxrc ||
2358 template_path != system_lyxrc.template_path) {
2359 string const path = os::external_path(template_path);
2360 os << "\\template_path \"" << path << "\"\n";
2364 case RC_TEMPDIRPATH:
2365 if (ignore_system_lyxrc ||
2366 tempdir_path != system_lyxrc.tempdir_path) {
2367 string const path = os::external_path(tempdir_path);
2368 os << "\\tempdir_path \"" << path << "\"\n";
2372 case RC_THESAURUSDIRPATH:
2373 if (ignore_system_lyxrc ||
2374 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2375 string const path = os::external_path(thesaurusdir_path);
2376 os << "\\thesaurusdir_path \"" << path << "\"\n";
2380 case RC_HUNSPELLDIR_PATH:
2381 if (ignore_system_lyxrc ||
2382 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2383 string const path = os::external_path(hunspelldir_path);
2384 os << "\\hunspelldir_path \"" << path << "\"\n";
2388 case RC_PLAINTEXT_LINELEN:
2389 if (ignore_system_lyxrc ||
2390 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2391 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2395 case RC_MAKE_BACKUP:
2396 if (ignore_system_lyxrc ||
2397 make_backup != system_lyxrc.make_backup) {
2398 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2402 case RC_SAVE_COMPRESSED:
2403 if (ignore_system_lyxrc ||
2404 save_compressed != system_lyxrc.save_compressed) {
2405 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2409 case RC_BACKUPDIR_PATH:
2410 if (ignore_system_lyxrc ||
2411 backupdir_path != system_lyxrc.backupdir_path) {
2412 string const path = os::external_path(backupdir_path);
2413 os << "\\backupdir_path \"" << path << "\"\n";
2419 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2423 << "# SPELLCHECKER SECTION ##############################\n"
2426 case RC_ACCEPT_COMPOUND:
2427 if (ignore_system_lyxrc ||
2428 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2429 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2435 if (ignore_system_lyxrc ||
2436 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2437 os << "\\alternate_language \"" << spellchecker_alt_lang
2443 if (ignore_system_lyxrc ||
2444 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2445 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2449 case RC_USE_SYSTEM_COLORS:
2450 if (ignore_system_lyxrc ||
2451 use_system_colors != system_lyxrc.use_system_colors) {
2452 os << "\\use_system_colors "
2453 << convert<string>(use_system_colors)
2458 case RC_USE_TOOLTIP:
2459 if (ignore_system_lyxrc ||
2460 use_tooltip != system_lyxrc.use_tooltip) {
2461 os << "\\use_tooltip "
2462 << convert<string>(use_tooltip)
2467 case RC_USE_PIXMAP_CACHE:
2468 if (ignore_system_lyxrc ||
2469 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2470 os << "\\use_pixmap_cache "
2471 << convert<string>(use_pixmap_cache)
2477 if (ignore_system_lyxrc ||
2478 use_qimage != system_lyxrc.use_qimage) {
2479 os << "\\use_qimage "
2480 << convert<string>(use_qimage)
2487 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2492 case RC_DEFAULT_DECIMAL_POINT:
2493 if (ignore_system_lyxrc ||
2494 default_decimal_point != system_lyxrc.default_decimal_point) {
2495 os << "\\default_decimal_point " << default_decimal_point << '\n';
2500 case RC_DEFAULT_LENGTH_UNIT:
2501 if (ignore_system_lyxrc ||
2502 default_length_unit != system_lyxrc.default_length_unit) {
2503 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2508 case RC_SPELLCHECKER:
2509 if (ignore_system_lyxrc ||
2510 spellchecker != system_lyxrc.spellchecker) {
2511 os << "\\spellchecker " << spellchecker << '\n';
2516 case RC_SPELLCHECK_CONTINUOUSLY:
2517 if (ignore_system_lyxrc ||
2518 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2519 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2525 case RC_SPELLCHECK_NOTES:
2526 if (ignore_system_lyxrc ||
2527 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2528 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2534 case RC_RTL_SUPPORT:
2535 if (ignore_system_lyxrc ||
2536 rtl_support != system_lyxrc.rtl_support) {
2537 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2541 case RC_VISUAL_CURSOR:
2542 if (ignore_system_lyxrc ||
2543 visual_cursor != system_lyxrc.visual_cursor) {
2544 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2548 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2549 if (ignore_system_lyxrc ||
2550 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2551 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2552 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2556 case RC_LANGUAGE_CUSTOM_PACKAGE:
2557 if (ignore_system_lyxrc ||
2558 language_custom_package != system_lyxrc.language_custom_package) {
2559 os << "\\language_custom_package \"" << language_custom_package
2564 case RC_LANGUAGE_GLOBAL_OPTIONS:
2565 if (ignore_system_lyxrc ||
2566 language_global_options
2567 != system_lyxrc.language_global_options) {
2568 os << "\\language_global_options \""
2569 << convert<string>(language_global_options)
2574 case RC_LANGUAGE_PACKAGE_SELECTION:
2575 if (ignore_system_lyxrc ||
2576 language_package_selection != system_lyxrc.language_package_selection) {
2577 os << "\\language_package_selection ";
2578 switch (language_package_selection) {
2595 case RC_LANGUAGE_COMMAND_BEGIN:
2596 if (ignore_system_lyxrc ||
2597 language_command_begin
2598 != system_lyxrc.language_command_begin) {
2599 os << "\\language_command_begin \""
2600 << language_command_begin
2605 case RC_LANGUAGE_COMMAND_END:
2606 if (ignore_system_lyxrc ||
2607 language_command_end
2608 != system_lyxrc.language_command_end) {
2609 os << "\\language_command_end \"" << language_command_end
2614 case RC_LANGUAGE_COMMAND_LOCAL:
2615 if (ignore_system_lyxrc ||
2616 language_command_local
2617 != system_lyxrc.language_command_local) {
2618 os << "\\language_command_local \""
2619 << language_command_local
2624 case RC_LANGUAGE_AUTO_BEGIN:
2625 if (ignore_system_lyxrc ||
2626 language_auto_begin != system_lyxrc.language_auto_begin) {
2627 os << "\\language_auto_begin "
2628 << convert<string>(language_auto_begin) << '\n';
2632 case RC_LANGUAGE_AUTO_END:
2633 if (ignore_system_lyxrc ||
2634 language_auto_end != system_lyxrc.language_auto_end) {
2635 os << "\\language_auto_end "
2636 << convert<string>(language_auto_end) << '\n';
2640 case RC_MARK_FOREIGN_LANGUAGE:
2641 if (ignore_system_lyxrc ||
2642 mark_foreign_language
2643 != system_lyxrc.mark_foreign_language) {
2644 os << "\\mark_foreign_language " <<
2645 convert<string>(mark_foreign_language) << '\n';
2651 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2654 case RC_AUTO_NUMBER:
2655 if (ignore_system_lyxrc ||
2656 auto_number != system_lyxrc.auto_number) {
2657 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2661 case RC_GUI_LANGUAGE:
2662 if (ignore_system_lyxrc ||
2663 gui_language != system_lyxrc.gui_language) {
2664 os << "\\gui_language " << gui_language << '\n';
2668 case RC_EXPORT_OVERWRITE:
2669 if (ignore_system_lyxrc ||
2670 export_overwrite != system_lyxrc.export_overwrite) {
2672 switch (export_overwrite) {
2683 os << "\\export_overwrite " << status << '\n';
2688 case RC_SCROLL_WHEEL_ZOOM:
2689 if (ignore_system_lyxrc ||
2690 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2692 switch (scroll_wheel_zoom) {
2693 case SCROLL_WHEEL_ZOOM_OFF:
2696 case SCROLL_WHEEL_ZOOM_CTRL:
2699 case SCROLL_WHEEL_ZOOM_SHIFT:
2702 case SCROLL_WHEEL_ZOOM_ALT:
2706 os << "\\scroll_wheel_zoom " << status << '\n';
2712 << "# FORMATS SECTION ##########################\n"
2716 // New/modified formats
2717 for (Formats::const_iterator cit = formats.begin();
2718 cit != formats.end(); ++cit) {
2719 Format const * format =
2720 system_formats.getFormat(cit->name());
2722 format->extensions() != cit->extensions() ||
2723 format->prettyname() != cit->prettyname() ||
2724 format->shortcut() != cit->shortcut() ||
2725 format->viewer() != cit->viewer() ||
2726 format->editor() != cit->editor() ||
2727 format->documentFormat() != cit->documentFormat() ||
2728 format->vectorFormat() != cit->vectorFormat() ||
2729 format->inExportMenu() != cit->inExportMenu() ||
2730 format->mime() != cit->mime()) {
2731 os << "\\format \"" << cit->name() << "\" \""
2732 << cit->extensions() << "\" \""
2733 << cit->prettyname() << "\" \""
2734 << cit->shortcut() << "\" \""
2735 << escapeCommand(cit->viewer()) << "\" \""
2736 << escapeCommand(cit->editor()) << "\" \"";
2737 vector<string> flags;
2738 if (cit->documentFormat())
2739 flags.push_back("document");
2740 if (cit->vectorFormat())
2741 flags.push_back("vector");
2742 if (cit->zippedNative())
2743 flags.push_back("zipped=native");
2744 if (cit->inExportMenu())
2745 flags.push_back("menu=export");
2747 os << getStringFromVector(flags);
2748 os << "\" \"" << cit->mime() << "\"\n";
2752 // Look for deleted formats
2753 for (Formats::const_iterator cit = system_formats.begin();
2754 cit != system_formats.end(); ++cit)
2755 if (!formats.getFormat(cit->name()))
2756 os << "\\format \"" << cit->name()
2757 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2760 case RC_VIEWER_ALTERNATIVES: {
2761 Alternatives::const_iterator it = viewer_alternatives.begin();
2762 Alternatives::const_iterator const en = viewer_alternatives.end();
2763 Alternatives::const_iterator const sysend =
2764 system_lyxrc.viewer_alternatives.end();
2765 for (; it != en; ++it) {
2766 string const & fmt = it->first;
2767 CommandSet const & cmd = it->second;
2768 CommandSet::const_iterator sit = cmd.begin();
2769 CommandSet::const_iterator const sen = cmd.end();
2770 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2771 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2772 system_lyxrc.viewer_alternatives.find(fmt);
2773 for (; sit != sen; ++sit) {
2774 string const & cmd = *sit;
2775 if (ignore_system_lyxrc
2776 || sysfmt == sysend // format not found
2777 || sysfmt->second.count(cmd) == 0 // this command not found
2779 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2785 case RC_EDITOR_ALTERNATIVES: {
2786 Alternatives::const_iterator it = editor_alternatives.begin();
2787 Alternatives::const_iterator const en = editor_alternatives.end();
2788 Alternatives::const_iterator const sysend =
2789 system_lyxrc.editor_alternatives.end();
2790 for (; it != en; ++it) {
2791 string const & fmt = it->first;
2792 CommandSet const & cmd = it->second;
2793 CommandSet::const_iterator sit = cmd.begin();
2794 CommandSet::const_iterator const sen = cmd.end();
2795 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2796 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2797 system_lyxrc.editor_alternatives.find(fmt);
2798 for (; sit != sen; ++sit) {
2799 string const & cmd = *sit;
2800 if (ignore_system_lyxrc
2801 || sysfmt == sysend // format not found
2802 || sysfmt->second.count(cmd) == 0 // this command not found
2804 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2810 case RC_DEFAULT_VIEW_FORMAT:
2811 if (ignore_system_lyxrc ||
2812 default_view_format != system_lyxrc.default_view_format) {
2813 os << "\\default_view_format " << default_view_format << '\n';
2823 << "# CONVERTERS SECTION ##########################\n"
2827 // Look for new converters
2828 for (Converters::const_iterator cit = theConverters().begin();
2829 cit != theConverters().end(); ++cit) {
2830 Converter const * converter =
2831 theSystemConverters().getConverter(cit->from,
2834 converter->command != cit->command ||
2835 converter->flags != cit->flags)
2836 os << "\\converter \"" << cit->from << "\" \""
2837 << cit->to << "\" \""
2838 << escapeCommand(cit->command) << "\" \""
2839 << cit->flags << "\"\n";
2842 // New/modifed converters
2843 for (Converters::const_iterator cit = theSystemConverters().begin();
2844 cit != theSystemConverters().end(); ++cit)
2845 if (!theConverters().getConverter(cit->from, cit->to))
2846 os << "\\converter \"" << cit->from
2847 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2854 << "# COPIERS SECTION ##########################\n"
2857 // Look for new movers
2858 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2859 Movers::const_iterator const sysend = theSystemMovers().end();
2860 Movers::const_iterator it = theMovers().begin();
2861 Movers::const_iterator end = theMovers().end();
2863 for (; it != end; ++it) {
2864 Movers::const_iterator const sysit =
2865 find_if(sysbegin, sysend, SameMover(*it));
2866 if (sysit == sysend) {
2867 string const & fmt = it->first;
2868 string const & command =
2869 it->second.command();
2871 os << "\\copier " << fmt
2872 << " \"" << escapeCommand(command) << "\"\n";
2878 // We don't actually delete SpecialisedMover(s) from the
2879 // map, just clear their 'command', so there's no need
2880 // to test for anything else.
2887 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2889 // Why the switch you might ask. It is a trick to ensure that all
2890 // the elements in the LyXRCTags enum is handled. As you can see
2891 // there are no breaks at all. So it is just a huge fall-through.
2892 // The nice thing is that we will get a warning from the compiler
2893 // if we forget an element.
2894 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2896 case LyXRC::RC_LAST:
2897 case LyXRC::RC_ACCEPT_COMPOUND:
2898 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2899 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2900 case LyXRC::RC_ALT_LANG:
2901 case LyXRC::RC_PLAINTEXT_LINELEN:
2902 case LyXRC::RC_AUTOCORRECTION_MATH:
2903 case LyXRC::RC_AUTOREGIONDELETE:
2904 case LyXRC::RC_AUTORESET_OPTIONS:
2905 case LyXRC::RC_AUTOSAVE:
2906 case LyXRC::RC_AUTO_NUMBER:
2907 case LyXRC::RC_BACKUPDIR_PATH:
2908 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2909 case LyXRC::RC_BIBTEX_COMMAND:
2910 case LyXRC::RC_BINDFILE:
2911 case LyXRC::RC_CHECKLASTFILES:
2912 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2913 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2914 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2915 case LyXRC::RC_COMPLETION_INLINE_MATH:
2916 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2917 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2918 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2919 case LyXRC::RC_COMPLETION_POPUP_MATH:
2920 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2921 case LyXRC::RC_COMPLETION_MINLENGTH:
2922 case LyXRC::RC_USELASTFILEPOS:
2923 case LyXRC::RC_LOADSESSION:
2924 case LyXRC::RC_CHKTEX_COMMAND:
2925 case LyXRC::RC_CONVERTER:
2926 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2927 case LyXRC::RC_COPIER:
2928 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2929 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2930 case LyXRC::RC_DATE_INSERT_FORMAT:
2931 case LyXRC::RC_GUI_LANGUAGE:
2932 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2933 case LyXRC::RC_DEFFILE:
2934 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2935 case LyXRC::RC_DISPLAY_GRAPHICS:
2936 case LyXRC::RC_DOCUMENTPATH:
2937 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2938 FileName path(lyxrc_new.document_path);
2939 if (path.exists() && path.isDirectory())
2940 package().document_dir() = FileName(lyxrc.document_path);
2942 case LyXRC::RC_EDITOR_ALTERNATIVES:
2943 case LyXRC::RC_ESC_CHARS:
2944 case LyXRC::RC_EXAMPLEPATH:
2945 case LyXRC::RC_FONT_ENCODING:
2946 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2947 case LyXRC::RC_FILEFORMAT:
2948 case LyXRC::RC_GROUP_LAYOUTS:
2949 case LyXRC::RC_HUNSPELLDIR_PATH:
2950 case LyXRC::RC_ICON_SET:
2951 case LyXRC::RC_INDEX_ALTERNATIVES:
2952 case LyXRC::RC_INDEX_COMMAND:
2953 case LyXRC::RC_JBIBTEX_COMMAND:
2954 case LyXRC::RC_JINDEX_COMMAND:
2955 case LyXRC::RC_NOMENCL_COMMAND:
2956 case LyXRC::RC_INPUT:
2957 case LyXRC::RC_KBMAP:
2958 case LyXRC::RC_KBMAP_PRIMARY:
2959 case LyXRC::RC_KBMAP_SECONDARY:
2960 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2961 case LyXRC::RC_LANGUAGE_AUTO_END:
2962 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2963 case LyXRC::RC_LANGUAGE_COMMAND_END:
2964 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2965 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2966 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2967 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2968 case LyXRC::RC_LYXRCFORMAT:
2969 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2970 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2971 case LyXRC::RC_MACRO_EDIT_STYLE:
2972 case LyXRC::RC_MAKE_BACKUP:
2973 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2974 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2975 case LyXRC::RC_NUMLASTFILES:
2976 case LyXRC::RC_PARAGRAPH_MARKERS:
2977 case LyXRC::RC_PATH_PREFIX:
2978 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2979 prependEnvPath("PATH", lyxrc_new.path_prefix);
2981 case LyXRC::RC_PREVIEW:
2982 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2983 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2984 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2985 case LyXRC::RC_PRINTCOPIESFLAG:
2986 case LyXRC::RC_PRINTER:
2987 case LyXRC::RC_PRINTEVENPAGEFLAG:
2988 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2989 case LyXRC::RC_PRINTFILEEXTENSION:
2990 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2991 case LyXRC::RC_PRINTODDPAGEFLAG:
2992 case LyXRC::RC_PRINTPAGERANGEFLAG:
2993 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2994 case LyXRC::RC_PRINTPAPERFLAG:
2995 case LyXRC::RC_PRINTREVERSEFLAG:
2996 case LyXRC::RC_PRINTSPOOL_COMMAND:
2997 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2998 case LyXRC::RC_PRINTTOFILE:
2999 case LyXRC::RC_PRINTTOPRINTER:
3000 case LyXRC::RC_PRINT_ADAPTOUTPUT:
3001 case LyXRC::RC_PRINT_COMMAND:
3002 case LyXRC::RC_RTL_SUPPORT:
3003 case LyXRC::RC_SAVE_COMPRESSED:
3004 case LyXRC::RC_SCREEN_DPI:
3005 case LyXRC::RC_SCREEN_FONT_ROMAN:
3006 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3007 case LyXRC::RC_SCREEN_FONT_SANS:
3008 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3009 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3010 case LyXRC::RC_SCREEN_FONT_SIZES:
3011 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3012 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3013 case LyXRC::RC_GEOMETRY_SESSION:
3014 case LyXRC::RC_SCREEN_ZOOM:
3015 case LyXRC::RC_SERVERPIPE:
3016 case LyXRC::RC_SET_COLOR:
3017 case LyXRC::RC_SHOW_BANNER:
3018 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3019 case LyXRC::RC_SPELLCHECKER:
3020 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3022 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3023 case LyXRC::RC_SPELLCHECK_NOTES:
3024 case LyXRC::RC_SPLITINDEX_COMMAND:
3025 case LyXRC::RC_TEMPDIRPATH:
3026 case LyXRC::RC_TEMPLATEPATH:
3027 case LyXRC::RC_TEX_ALLOWS_SPACES:
3028 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3029 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3030 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3032 case LyXRC::RC_TEXINPUTS_PREFIX:
3033 case LyXRC::RC_THESAURUSDIRPATH:
3034 case LyXRC::RC_UIFILE:
3035 case LyXRC::RC_USER_EMAIL:
3036 case LyXRC::RC_USER_NAME:
3037 case LyXRC::RC_USE_CONVERTER_CACHE:
3038 case LyXRC::RC_USE_SYSTEM_COLORS:
3039 case LyXRC::RC_USE_TOOLTIP:
3040 case LyXRC::RC_USE_PIXMAP_CACHE:
3041 case LyXRC::RC_USE_QIMAGE:
3042 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3043 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3044 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3045 case LyXRC::RC_SINGLE_INSTANCE:
3046 case LyXRC::RC_SORT_LAYOUTS:
3047 case LyXRC::RC_FULL_SCREEN_LIMIT:
3048 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3049 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3050 case LyXRC::RC_FULL_SCREEN_TABBAR:
3051 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3052 case LyXRC::RC_FULL_SCREEN_WIDTH:
3053 case LyXRC::RC_VISUAL_CURSOR:
3054 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3055 case LyXRC::RC_VIEWER:
3056 case LyXRC::RC_VIEWER_ALTERNATIVES:
3057 case LyXRC::RC_FORWARD_SEARCH_DVI:
3058 case LyXRC::RC_FORWARD_SEARCH_PDF:
3059 case LyXRC::RC_EXPORT_OVERWRITE:
3060 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3061 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3062 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3063 case LyXRC::RC_CURSOR_WIDTH:
3070 string const LyXRC::getDescription(LyXRCTags tag)
3075 case RC_ACCEPT_COMPOUND:
3076 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3080 str = _("Specify an alternate language. The default is to use the language of the document.");
3083 case RC_PLAINTEXT_LINELEN:
3084 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.");
3087 case RC_AUTOREGIONDELETE:
3088 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3091 case RC_AUTORESET_OPTIONS:
3092 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3096 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3099 case RC_AUTO_NUMBER:
3102 case RC_BACKUPDIR_PATH:
3103 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.");
3106 case RC_BIBTEX_COMMAND:
3107 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3110 case RC_JBIBTEX_COMMAND:
3111 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3115 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3118 case RC_CHECKLASTFILES:
3119 str = _("Select to check whether the lastfiles still exist.");
3122 case RC_CHKTEX_COMMAND:
3123 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3132 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3133 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.");
3136 case RC_CURSOR_WIDTH:
3137 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3140 case RC_SCROLL_BELOW_DOCUMENT:
3141 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");
3144 case RC_MAC_DONTSWAP_CTRL_META:
3145 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3148 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3149 str = _("Use the Mac OS X conventions for cursor movement");
3152 case RC_SHOW_MACRO_LABEL:
3153 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3156 case RC_DATE_INSERT_FORMAT:
3157 //xgettext:no-c-format
3158 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3162 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3165 case RC_DEFAULT_VIEW_FORMAT:
3166 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3169 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3170 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3173 case RC_DISPLAY_GRAPHICS:
3174 str = _("Select how LyX will display any graphics.");
3177 case RC_DOCUMENTPATH:
3178 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3182 str = _("Specify additional chars that can be part of a word.");
3185 case RC_EXAMPLEPATH:
3186 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3189 case RC_FONT_ENCODING:
3190 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3193 case RC_FORCE_PAINT_SINGLE_CHAR:
3194 str = _("Disable any kerning and ligatures for text drawing on screen.");
3200 case RC_INDEX_COMMAND:
3201 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\".");
3204 case RC_JINDEX_COMMAND:
3205 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3208 case RC_NOMENCL_COMMAND:
3209 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3216 case RC_KBMAP_PRIMARY:
3217 case RC_KBMAP_SECONDARY:
3218 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.");
3221 case RC_LANGUAGE_AUTO_BEGIN:
3222 str = _("Select if a language switching command is needed at the beginning of the document.");
3225 case RC_LANGUAGE_AUTO_END:
3226 str = _("Select if a language switching command is needed at the end of the document.");
3229 case RC_LANGUAGE_COMMAND_BEGIN:
3230 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.");
3233 case RC_LANGUAGE_COMMAND_END:
3234 str = _("The LaTeX command for changing back to the language of the document.");
3237 case RC_LANGUAGE_COMMAND_LOCAL:
3238 str = _("The LaTeX command for local changing of the language.");
3241 case RC_LANGUAGE_GLOBAL_OPTIONS:
3242 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3245 case RC_LANGUAGE_CUSTOM_PACKAGE:
3246 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3249 case RC_LANGUAGE_PACKAGE_SELECTION:
3250 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3253 case RC_USELASTFILEPOS:
3254 str = _("De-select if you do not want LyX to scroll to saved position.");
3257 case RC_LOADSESSION:
3258 str = _("De-select to prevent loading files opened from the last LyX session.");
3261 case RC_MAKE_BACKUP:
3262 str = _("De-select if you don't want LyX to create backup files.");
3265 case RC_MARK_FOREIGN_LANGUAGE:
3266 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3269 case RC_MOUSE_WHEEL_SPEED:
3270 str = bformat(_("The scrolling speed of the mouse wheel."),
3274 case RC_COMPLETION_POPUP_DELAY:
3275 str = _("The completion popup delay.");
3278 case RC_COMPLETION_POPUP_MATH:
3279 str = _("Select to display the completion popup in math mode.");
3282 case RC_COMPLETION_POPUP_TEXT:
3283 str = _("Select to display the completion popup in text mode.");
3286 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3287 str = _("Show the completion popup without delay after non-unique completion attempt.");
3290 case RC_COMPLETION_POPUP_TEXT:
3291 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3294 case RC_COMPLETION_POPUP_DELAY:
3295 str = _("The inline completion delay.");
3298 case RC_COMPLETION_INLINE_MATH:
3299 str = _("Select to display the inline completion in math mode.");
3302 case RC_COMPLETION_INLINE_TEXT:
3303 str = _("Select to display the inline completion in text mode.");
3306 case RC_COMPLETION_INLINE_DOTS:
3307 str = _("Use \"...\" to shorten long completions.");
3310 case RC_AUTOCORRECTION_MATH:
3311 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3314 case RC_NUMLASTFILES:
3315 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3319 case RC_PATH_PREFIX:
3320 str = _("Specify those directories which should be "
3321 "prepended to the PATH environment variable.\n"
3322 "Use the OS native format.");
3326 str = _("Shows a typeset preview of things such as math");
3329 case RC_PREVIEW_HASHED_LABELS:
3330 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3333 case RC_PREVIEW_SCALE_FACTOR:
3334 str = _("Scale the preview size to suit.");
3337 case RC_PRINTCOLLCOPIESFLAG:
3338 str = _("The option for specifying whether the copies should be collated.");
3341 case RC_PRINTCOPIESFLAG:
3342 str = _("The option for specifying the number of copies to print.");
3346 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3349 case RC_PRINTEVENPAGEFLAG:
3350 str = _("The option to print only even pages.");
3353 case RC_PRINTEXSTRAOPTIONS:
3354 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3357 case RC_PRINTFILEEXTENSION:
3358 str = _("Extension of printer program output file. Usually \".ps\".");
3361 case RC_PRINTLANDSCAPEFLAG:
3362 str = _("The option to print out in landscape.");
3365 case RC_PRINTODDPAGEFLAG:
3366 str = _("The option to print only odd pages.");
3369 case RC_PRINTPAGERANGEFLAG:
3370 str = _("The option for specifying a comma-separated list of pages to print.");
3373 case RC_PRINTPAPERDIMENSIONFLAG:
3374 str = _("Option to specify the dimensions of the print paper.");
3377 case RC_PRINTPAPERFLAG:
3378 str = _("The option to specify paper type.");
3381 case RC_PRINTREVERSEFLAG:
3382 str = _("The option to reverse the order of the pages printed.");
3385 case RC_PRINTSPOOL_COMMAND:
3386 str = _("When set, this printer option automatically prints to a file and then calls a separate print spooling program on that file with the given name and arguments.");
3389 case RC_PRINTSPOOL_PRINTERPREFIX:
3390 str = _("If you specify a printer name in the print dialog, the following argument is prepended along with the printer name after the spool command.");
3393 case RC_PRINTTOFILE:
3394 str = _("Option to pass to the print program to print to a file.");
3397 case RC_PRINTTOPRINTER:
3398 str = _("Option to pass to the print program to print on a specific printer.");
3401 case RC_PRINT_ADAPTOUTPUT:
3402 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3405 case RC_PRINT_COMMAND:
3406 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3409 case RC_RTL_SUPPORT:
3410 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3413 case RC_VISUAL_CURSOR:
3414 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3417 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3418 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).");
3422 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3425 case RC_SCREEN_FONT_ROMAN:
3426 case RC_SCREEN_FONT_SANS:
3427 case RC_SCREEN_FONT_TYPEWRITER:
3428 str = _("The screen fonts used to display the text while editing.");
3431 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3432 case RC_SCREEN_FONT_SANS_FOUNDRY:
3433 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3436 case RC_SCREEN_FONT_SCALABLE:
3437 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.");
3440 case RC_SCREEN_FONT_SIZES:
3441 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3444 case RC_SCREEN_ZOOM:
3445 //xgettext:no-c-format
3446 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3449 case RC_GEOMETRY_SESSION:
3450 str = _("Allow session manager to save and restore windows geometry.");
3454 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3460 case RC_SHOW_BANNER:
3461 str = _("De-select if you don't want the startup banner.");
3464 case RC_TEMPDIRPATH:
3465 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3468 case RC_THESAURUSDIRPATH:
3469 str = _("This is the place where the files of the thesaurus library reside.");
3472 case RC_TEMPLATEPATH:
3473 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3476 case RC_TEX_ALLOWS_SPACES:
3479 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3482 case RC_TEXINPUTS_PREFIX:
3483 str = _("Specify those directories which should be "
3484 "prepended to the TEXINPUTS environment variable.\n"
3485 "A '.' represents the current document directory. "
3486 "Use the OS native format.");
3490 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3499 case RC_USE_USE_SYSTEM_COLORS:
3500 str = _("Enable use the system colors for some things like main window background and selection.");
3503 case RC_USE_TOOLTIP:
3504 str = _("Enable the automatic appearance of tool tips in the work area.");
3507 case RC_USE_PIXMAP_CACHE:
3508 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3511 case RC_VIEWDVI_PAPEROPTION:
3512 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3527 // The global instance
3530 // The global copy of the system lyxrc entries (everything except preferences)