#include "FontEnums.h"
#include "Format.h"
#include "Lexer.h"
+#include "LyX.h"
#include "Mover.h"
#include "Session.h"
#include "version.h"
{ "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
{ "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
{ "\\def_file", LyXRC::RC_DEFFILE },
+ { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
{ "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
{ "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
{ "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
{ "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
{ "\\escape_chars", LyXRC::RC_ESC_CHARS },
{ "\\example_path", LyXRC::RC_EXAMPLEPATH },
+ { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
{ "\\font_encoding", LyXRC::RC_FONT_ENCODING },
{ "\\format", LyXRC::RC_FORMAT },
+ { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
+ { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
{ "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
{ "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
{ "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
{ "\\kbmap", LyXRC::RC_KBMAP },
{ "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
{ "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
- { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
{ "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
{ "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
{ "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
{ "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
{ "\\printer", LyXRC::RC_PRINTER },
{ "\\rtl", LyXRC::RC_RTL_SUPPORT },
+ { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
{ "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
{ "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
{ "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
{ "\\serverpipe", LyXRC::RC_SERVERPIPE },
{ "\\set_color", LyXRC::RC_SET_COLOR },
{ "\\show_banner", LyXRC::RC_SHOW_BANNER },
+ { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
{ "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
{ "\\spell_command", LyXRC::RC_SPELL_COMMAND },
{ "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
+ { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
{ "\\spellchecker", LyXRC::RC_SPELLCHECKER },
{ "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
{ "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
use_lastfilepos = true;
load_session = false;
make_backup = true;
+ save_compressed = false;
backupdir_path.erase();
display_graphics = true;
// Spellchecker settings:
+#if defined(USE_ASPELL)
spellchecker = "aspell";
+#elif defined(USE_HUNSPELL)
+ spellchecker = "hunspell";
+#else
+ spellchecker = "aspell";
+#endif
spellchecker_accept_compound = false;
spellcheck_continuously = false;
+ spellcheck_notes = true;
use_kbmap = false;
rtl_support = true;
visual_cursor = false;
mac_like_word_movement = false;
macro_edit_style = MACRO_EDIT_INLINE_BOX;
dialogs_iconify_with_main = false;
- label_init_length = 3;
preview = PREVIEW_OFF;
preview_hashed_labels = false;
preview_scale_factor = 1.0;
user_name = to_utf8(support::user_name());
user_email = to_utf8(support::user_email());
open_buffers_in_tabs = true;
+ single_close_tab_button = false;
+ forward_search_dvi = string();
+ forward_search_pdf = string();
+ export_overwrite = NO_FILES;
// Fullscreen settings
full_screen_limit = false;
completion_inline_text = false;
completion_inline_dots = -1;
completion_inline_delay = 0.2;
+ default_decimal_point = ".";
}
lexrc.getString());
if (read(tmp)) {
lexrc.printError("Error reading "
- "included file: " + tmp.absFilename());
+ "included file: " + tmp.absFileName());
}
}
break;
case RC_SPELLCHECK_CONTINUOUSLY:
lexrc >> spellcheck_continuously;
break;
+ case RC_SPELLCHECK_NOTES:
+ lexrc >> spellcheck_notes;
+ break;
case RC_MAKE_BACKUP:
lexrc >> make_backup;
break;
+ case RC_SAVE_COMPRESSED:
+ lexrc >> save_compressed;
+ break;
case RC_BACKUPDIR_PATH:
if (lexrc.next()) {
backupdir_path = os::internal_path(lexrc.getString());
backupdir_path = expandPath(backupdir_path);
}
break;
+ case RC_DEFAULT_DECIMAL_POINT:
+ lexrc >> default_decimal_point;
+ break;
case RC_DATE_INSERT_FORMAT:
lexrc >> date_insert_format;
break;
format = lexrc.getString();
if (lexrc.eatLine())
command = lexrc.getString();
- viewer_alternatives.push_back(make_pair(format, command));
+ viewer_alternatives[format].insert(command);
break;
}
case RC_EDITOR_ALTERNATIVES: {
string format, command;
lexrc >> format >> command;
- editor_alternatives.push_back(make_pair(format, command));
+ editor_alternatives[format].insert(command);
break;
}
lexrc >> gui_language;
break;
- case RC_LABEL_INIT_LENGTH:
- lexrc >> label_init_length;
- break;
-
case RC_SHOW_BANNER:
lexrc >> show_banner;
break;
case RC_OPEN_BUFFERS_IN_TABS:
lexrc >> open_buffers_in_tabs;
break;
+ case RC_SINGLE_CLOSE_TAB_BUTTON:
+ lexrc >> single_close_tab_button;
+ break;
+ case RC_FORWARD_SEARCH_DVI:
+ if (lexrc.next(true))
+ forward_search_dvi = lexrc.getString();
+ break;
+ case RC_FORWARD_SEARCH_PDF:
+ if (lexrc.next(true))
+ forward_search_pdf = lexrc.getString();
+ break;
+ case RC_EXPORT_OVERWRITE:
+ if (lexrc.next()) {
+ string const tmp = lexrc.getString();
+ if (tmp == "all" || tmp == "true")
+ export_overwrite = ALL_FILES;
+ else if (tmp == "main")
+ export_overwrite = MAIN_FILE;
+ else {
+ export_overwrite = NO_FILES;
+ if (tmp != "ask" && tmp != "false")
+ LYXERR0("Unrecognized export_overwrite status \""
+ << tmp << '"');
+ }
+ }
+ break;
// Obsoteted in 1.4.0
case RC_USETEMPDIR:
case PAPER_B5:
os << "b5"; break;
case PAPER_CUSTOM:
+ case PAPER_A0:
+ case PAPER_A1:
+ case PAPER_A2:
+ case PAPER_A6:
+ case PAPER_B0:
+ case PAPER_B1:
+ case PAPER_B2:
case PAPER_B3:
- case PAPER_B4: break;
+ case PAPER_B4:
+ case PAPER_B6:
+ case PAPER_JISB0:
+ case PAPER_JISB1:
+ case PAPER_JISB2:
+ case PAPER_JISB3:
+ case PAPER_JISB4:
+ case PAPER_JISB5:
+ case PAPER_JISB6: break;
}
os << "\"\n";
}
if (tag != RC_LAST)
break;
case RC_BIBTEX_ALTERNATIVES: {
- set<string>::const_iterator it = bibtex_alternatives.begin();
- set<string>::const_iterator end = bibtex_alternatives.end();
+ CommandSet::const_iterator it = bibtex_alternatives.begin();
+ CommandSet::const_iterator end = bibtex_alternatives.end();
for ( ; it != end; ++it) {
if (ignore_system_lyxrc
|| !system_lyxrc.bibtex_alternatives.count(*it))
if (tag != RC_LAST)
break;
case RC_INDEX_ALTERNATIVES: {
- set<string>::const_iterator it = index_alternatives.begin();
- set<string>::const_iterator end = index_alternatives.end();
+ CommandSet::const_iterator it = index_alternatives.begin();
+ CommandSet::const_iterator end = index_alternatives.end();
for ( ; it != end; ++it) {
if (ignore_system_lyxrc
|| !system_lyxrc.index_alternatives.count(*it))
}
if (tag != RC_LAST)
break;
- case RC_LABEL_INIT_LENGTH:
- if (ignore_system_lyxrc ||
- label_init_length != system_lyxrc.label_init_length) {
- os << "\\label_init_length " << label_init_length
- << '\n';
- }
- if (tag != RC_LAST)
- break;
case RC_USER_NAME:
os << "\\user_name \"" << user_name << "\"\n";
}
if (tag != RC_LAST)
break;
+ case RC_SINGLE_CLOSE_TAB_BUTTON:
+ if (ignore_system_lyxrc ||
+ single_close_tab_button != system_lyxrc.single_close_tab_button) {
+ os << "\\single_close_tab_button "
+ << convert<string>(single_close_tab_button)
+ << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
+ case RC_FORWARD_SEARCH_DVI:
+ if (ignore_system_lyxrc ||
+ forward_search_dvi != system_lyxrc.forward_search_dvi) {
+ os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
+ }
+ if (tag != RC_LAST)
+ break;
+ case RC_FORWARD_SEARCH_PDF:
+ if (ignore_system_lyxrc ||
+ forward_search_pdf != system_lyxrc.forward_search_pdf) {
+ os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
+ }
+ if (tag != RC_LAST)
+ break;
os << "\n#\n"
<< "# COLOR SECTION ###################################\n"
}
if (tag != RC_LAST)
break;
+ case RC_SAVE_COMPRESSED:
+ if (ignore_system_lyxrc ||
+ save_compressed != system_lyxrc.save_compressed) {
+ os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
case RC_BACKUPDIR_PATH:
if (ignore_system_lyxrc ||
backupdir_path != system_lyxrc.backupdir_path) {
if (tag != RC_LAST)
break;
+ case RC_DEFAULT_DECIMAL_POINT:
+ if (ignore_system_lyxrc ||
+ default_decimal_point != system_lyxrc.default_decimal_point) {
+ os << "\\default_decimal_point " << default_decimal_point << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
+
case RC_SPELLCHECKER:
if (ignore_system_lyxrc ||
spellchecker != system_lyxrc.spellchecker) {
if (tag != RC_LAST)
break;
+ case RC_SPELLCHECK_NOTES:
+ if (ignore_system_lyxrc ||
+ spellcheck_notes != system_lyxrc.spellcheck_notes) {
+ os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
+ << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
+
case RC_RTL_SUPPORT:
if (ignore_system_lyxrc ||
rtl_support != system_lyxrc.rtl_support) {
}
if (tag != RC_LAST)
break;
+ case RC_EXPORT_OVERWRITE:
+ if (ignore_system_lyxrc ||
+ export_overwrite != system_lyxrc.export_overwrite) {
+ string status;
+ switch (export_overwrite) {
+ case NO_FILES:
+ status = "ask";
+ break;
+ case MAIN_FILE:
+ status = "main";
+ break;
+ case ALL_FILES:
+ status = "all";
+ break;
+ }
+ os << "\\export_overwrite " << status << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
os << "\n#\n"
<< "# FORMATS SECTION ##########################\n"
<< "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
if (tag != RC_LAST)
break;
- case RC_VIEWER_ALTERNATIVES:
- if (ignore_system_lyxrc ||
- viewer_alternatives != system_lyxrc.viewer_alternatives) {
- for (vector<pair<string, string> >::const_iterator it = viewer_alternatives.begin();
- it != viewer_alternatives.end(); ++it)
- os << "\\viewer_alternatives "
- << it->first << " " << it->second << "\n";
+ case RC_VIEWER_ALTERNATIVES: {
+ Alternatives::const_iterator it = viewer_alternatives.begin();
+ Alternatives::const_iterator const en = viewer_alternatives.end();
+ Alternatives::const_iterator const sysend =
+ system_lyxrc.viewer_alternatives.end();
+ for (; it != en; ++it) {
+ string const & fmt = it->first;
+ CommandSet const & cmd = it->second;
+ CommandSet::const_iterator sit = cmd.begin();
+ CommandSet::const_iterator const sen = cmd.end();
+ Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
+ system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
+ system_lyxrc.viewer_alternatives.find(fmt);
+ for (; sit != sen; ++sit) {
+ string const & cmd = *sit;
+ if (ignore_system_lyxrc
+ || sysfmt == sysend // format not found
+ || sysfmt->second.count(cmd) == 0 // this command not found
+ )
+ os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
+ }
}
if (tag != RC_LAST)
break;
- case RC_EDITOR_ALTERNATIVES:
- if (ignore_system_lyxrc ||
- editor_alternatives != system_lyxrc.editor_alternatives) {
- for (vector<pair<string, string> >::const_iterator it = editor_alternatives.begin();
- it != editor_alternatives.end(); ++it)
- os << "\\editor_alternatives "
- << it->first << " " << it->second << "\n";
+ }
+ case RC_EDITOR_ALTERNATIVES: {
+ Alternatives::const_iterator it = editor_alternatives.begin();
+ Alternatives::const_iterator const en = editor_alternatives.end();
+ Alternatives::const_iterator const sysend =
+ system_lyxrc.editor_alternatives.end();
+ for (; it != en; ++it) {
+ string const & fmt = it->first;
+ CommandSet const & cmd = it->second;
+ CommandSet::const_iterator sit = cmd.begin();
+ CommandSet::const_iterator const sen = cmd.end();
+ Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
+ system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
+ system_lyxrc.editor_alternatives.find(fmt);
+ for (; sit != sen; ++sit) {
+ string const & cmd = *sit;
+ if (ignore_system_lyxrc
+ || sysfmt == sysend // format not found
+ || sysfmt->second.count(cmd) == 0 // this command not found
+ )
+ os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
+ }
}
if (tag != RC_LAST)
break;
+ }
case RC_DEFAULT_VIEW_FORMAT:
if (ignore_system_lyxrc ||
default_view_format != system_lyxrc.default_view_format) {
case LyXRC::RC_KBMAP:
case LyXRC::RC_KBMAP_PRIMARY:
case LyXRC::RC_KBMAP_SECONDARY:
- case LyXRC::RC_LABEL_INIT_LENGTH:
case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
case LyXRC::RC_LANGUAGE_AUTO_END:
case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
case LyXRC::RC_PRINT_ADAPTOUTPUT:
case LyXRC::RC_PRINT_COMMAND:
case LyXRC::RC_RTL_SUPPORT:
+ case LyXRC::RC_SAVE_COMPRESSED:
case LyXRC::RC_SCREEN_DPI:
case LyXRC::RC_SCREEN_FONT_ROMAN:
case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
case LyXRC::RC_SPELL_COMMAND:
case LyXRC::RC_SPELLCHECKER:
case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
+ case LyXRC::RC_SPELLCHECK_NOTES:
case LyXRC::RC_SPLITINDEX_COMMAND:
case LyXRC::RC_TEMPDIRPATH:
case LyXRC::RC_TEMPLATEPATH:
case LyXRC::RC_USE_PIXMAP_CACHE:
case LyXRC::RC_USE_SPELL_LIB:
case LyXRC::RC_VIEWDVI_PAPEROPTION:
+ case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
case LyXRC::RC_SORT_LAYOUTS:
case LyXRC::RC_FULL_SCREEN_LIMIT:
case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
case LyXRC::RC_VISUAL_CURSOR:
case LyXRC::RC_VIEWER:
case LyXRC::RC_VIEWER_ALTERNATIVES:
+ case LyXRC::RC_FORWARD_SEARCH_DVI:
+ case LyXRC::RC_FORWARD_SEARCH_PDF:
+ case LyXRC::RC_EXPORT_OVERWRITE:
case LyXRC::RC_LAST:
break;
}
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.");
break;
- case RC_LABEL_INIT_LENGTH:
- str = _("Maximum number of words in the initialization string for a new label");
- break;
-
case RC_LANGUAGE_AUTO_BEGIN:
str = _("Select if a language switching command is needed at the beginning of the document.");
break;