]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
* GuiDocument.cpp:
[lyx.git] / src / LyXRC.cpp
index b1240cd0696f781124956f17a1369611dd37c4e9..39c1172f923dc3af8d431e84cd90e64c7e268187 100644 (file)
@@ -61,6 +61,7 @@ LexerKeyword lyxrcTags[] = {
        { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
        { "\\autosave", LyXRC::RC_AUTOSAVE },
        { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
+       { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
        { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
        { "\\bind_file", LyXRC::RC_BINDFILE },
        { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
@@ -91,12 +92,14 @@ LexerKeyword lyxrcTags[] = {
        { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
        { "\\format", LyXRC::RC_FORMAT },
        { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
+       { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
        { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
        { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
        { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
        { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
        { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
        { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
+       { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
        { "\\index_command", LyXRC::RC_INDEX_COMMAND },
        { "\\input", LyXRC::RC_INPUT },
        { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
@@ -165,6 +168,7 @@ LexerKeyword lyxrcTags[] = {
        { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
        { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
        { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
+       { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
        { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
        { "\\template_path", LyXRC::RC_TEMPLATEPATH },
        { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
@@ -266,10 +270,6 @@ void LyXRC::setDefaults()
        display_graphics = true;
        // Spellchecker settings:
        spellchecker_accept_compound = false;
-       spellchecker_use_input_encoding = false;
-       spellchecker_use_alt_lang = false;
-       spellchecker_use_pers_dict = false;
-       spellchecker_use_esc_chars = false;
        spellcheck_continuously = false;
        use_kbmap = false;
        rtl_support = true;
@@ -312,6 +312,7 @@ void LyXRC::setDefaults()
        full_screen_limit = false;
        full_screen_toolbars = true;
        full_screen_tabbar = true;
+       full_screen_menubar = true;
        full_screen_scrollbar = true;
        full_screen_width = 700;
 
@@ -591,6 +592,12 @@ int LyXRC::read(Lexer & lexrc)
                        }
                        break;
 
+               case RC_BIBTEX_ALTERNATIVES:
+                       if (lexrc.next(true)) {
+                               bibtex_alternatives.insert(lexrc.getString());
+                       }
+                       break;
+
                case RC_BIBTEX_COMMAND:
                        if (lexrc.next(true)) {
                                bibtex_command = lexrc.getString();
@@ -603,6 +610,12 @@ int LyXRC::read(Lexer & lexrc)
                        }
                        break;
 
+               case RC_INDEX_ALTERNATIVES:
+                       if (lexrc.next(true)) {
+                               index_alternatives.insert(lexrc.getString());
+                       }
+                       break;
+
                case RC_INDEX_COMMAND:
                        if (lexrc.next(true)) {
                                index_command = lexrc.getString();
@@ -615,6 +628,12 @@ int LyXRC::read(Lexer & lexrc)
                        }
                        break;
 
+               case RC_SPLITINDEX_COMMAND:
+                       if (lexrc.next(true)) {
+                               splitindex_command = lexrc.getString();
+                       }
+                       break;
+
                case RC_NOMENCL_COMMAND:
                        if (lexrc.next(true)) {
                                nomencl_command = lexrc.getString();
@@ -689,11 +708,6 @@ int LyXRC::read(Lexer & lexrc)
                        }
                        break;
 
-               case RC_USETEMPDIR:
-                       if (lexrc.next())
-                               LYXERR0("Ignoring obsolete use_tempdir flag.");
-                       break;
-
                case RC_USELASTFILEPOS:
                        lexrc >> use_lastfilepos;
                        break;
@@ -852,9 +866,6 @@ int LyXRC::read(Lexer & lexrc)
                        lexrc >> dialogs_iconify_with_main;
                        break;
 
-               case RC_PLAINTEXT_ROFF_COMMAND: 
-                       (void) lexrc.getString(); // Obsoleted in 2.0
-                       break;
                case RC_PLAINTEXT_LINELEN:
                        lexrc >> plaintext_linelen;
                        break;
@@ -862,31 +873,15 @@ int LyXRC::read(Lexer & lexrc)
                case RC_ACCEPT_COMPOUND:
                        lexrc >> spellchecker_accept_compound;
                        break;
-               case RC_USE_INP_ENC:
-                       lexrc >> spellchecker_use_input_encoding;
-                       break;
-               case RC_USE_ALT_LANG:
-                       lexrc >> spellchecker_use_alt_lang;
-                       break;
-               case RC_USE_PERS_DICT:
-                       lexrc >> spellchecker_use_pers_dict;
-                       break;
                case RC_USE_TOOLTIP:
                        lexrc >> use_tooltip;
                        break;
                case RC_USE_PIXMAP_CACHE:
                        lexrc >> use_pixmap_cache;
                        break;
-               case RC_USE_ESC_CHARS:
-                       lexrc >> spellchecker_use_esc_chars;
-                       break;
                case RC_ALT_LANG:
                        lexrc >> spellchecker_alt_lang;
                        break;
-               case RC_PERS_DICT:
-                       if (lexrc.next())
-                               spellchecker_pers_dict = os::internal_path(lexrc.getString());
-                       break;
                case RC_ESC_CHARS:
                        lexrc >> spellchecker_esc_chars;
                        break;
@@ -1102,6 +1097,9 @@ int LyXRC::read(Lexer & lexrc)
                case RC_FULL_SCREEN_TABBAR:
                        lexrc >> full_screen_tabbar;
                        break;
+               case RC_FULL_SCREEN_MENUBAR:
+                       lexrc >> full_screen_menubar;
+                       break;
                case RC_FULL_SCREEN_WIDTH:
                        lexrc >> full_screen_width;
                        break;
@@ -1109,10 +1107,20 @@ int LyXRC::read(Lexer & lexrc)
                        lexrc >> open_buffers_in_tabs;
                        break;
 
+               // Obsoteted in 1.4.0
+               case RC_USETEMPDIR:
                // Obsoleted in 2.0
                case RC_SPELL_COMMAND:
+               case RC_PERS_DICT:
+               case RC_PLAINTEXT_ROFF_COMMAND: 
+               case RC_USE_ALT_LANG:
+               case RC_USE_ESC_CHARS:
+               case RC_USE_INP_ENC:
+               case RC_USE_PERS_DICT:
                case RC_USE_SPELL_LIB:
-                       (void) lexrc.getString();
+                       LYXERR(Debug::LYXRC, "Skipping obsolete tag `" 
+                              << lexrc.getString() << "'.");
+                       lexrc.next(true);
                        break;
 
                case RC_LAST:
@@ -1344,6 +1352,18 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                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();
+               for ( ; it != end; ++it) {
+                       if (ignore_system_lyxrc
+                           || !system_lyxrc.bibtex_alternatives.count(*it))
+                               os << "\\bibtex_alternatives \""
+                                  << *it << "\"\n";
+               }
+               if (tag != RC_LAST)
+                       break;
+       }
        case RC_BIBTEX_COMMAND:
                if (ignore_system_lyxrc ||
                    bibtex_command != system_lyxrc.bibtex_command) {
@@ -1358,6 +1378,18 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                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();
+               for ( ; it != end; ++it) {
+                       if (ignore_system_lyxrc
+                           || !system_lyxrc.index_alternatives.count(*it))
+                               os << "\\index_alternatives \""
+                                  << *it << "\"\n";
+               }
+               if (tag != RC_LAST)
+                       break;
+       }
        case RC_INDEX_COMMAND:
                if (ignore_system_lyxrc ||
                    index_command != system_lyxrc.index_command) {
@@ -1372,6 +1404,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                if (tag != RC_LAST)
                        break;
+       case RC_SPLITINDEX_COMMAND:
+               if (ignore_system_lyxrc ||
+                   splitindex_command != system_lyxrc.splitindex_command) {
+                       os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
+               }
+               if (tag != RC_LAST)
+                       break;
        case RC_NOMENCL_COMMAND:
                if (ignore_system_lyxrc ||
                    nomencl_command != system_lyxrc.nomencl_command) {
@@ -1725,6 +1764,15 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                if (tag != RC_LAST)
                        break;
+       case RC_FULL_SCREEN_MENUBAR:
+               if (ignore_system_lyxrc ||
+                   full_screen_menubar != system_lyxrc.full_screen_menubar) {
+                       os << "\\fullscreen_menubar "
+                          << convert<string>(full_screen_menubar)
+                          << '\n';
+               }
+               if (tag != RC_LAST)
+                       break;
        case RC_FULL_SCREEN_WIDTH:
                if (ignore_system_lyxrc ||
                    full_screen_width != system_lyxrc.full_screen_width) {
@@ -2140,11 +2188,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
        case RC_USE_ALT_LANG:
-               if (ignore_system_lyxrc ||
-                   spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
-                       os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
-                          << '\n';
-               }
+               // Obsoleted in 2.0
                if (tag != RC_LAST)
                        break;
        case RC_ALT_LANG:
@@ -2156,11 +2200,6 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
        case RC_USE_ESC_CHARS:
-               if (ignore_system_lyxrc ||
-                   spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
-                       os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
-                          << '\n';
-               }
                if (tag != RC_LAST)
                        break;
        case RC_ESC_CHARS:
@@ -2171,12 +2210,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
        case RC_USE_PERS_DICT:
-               if (ignore_system_lyxrc ||
-                   spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
-                       os << "\\use_personal_dictionary "
-                          << convert<string>(spellchecker_use_pers_dict)
-                          << '\n';
-               }
+               // obsoleted in 2.0
                if (tag != RC_LAST)
                        break;
        case RC_USE_TOOLTIP:
@@ -2186,6 +2220,8 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                           << convert<string>(use_tooltip)
                           << '\n';
                }
+               if (tag != RC_LAST)
+                       break;
        case RC_USE_PIXMAP_CACHE:
                if (ignore_system_lyxrc ||
                    use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
@@ -2193,27 +2229,22 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                           << convert<string>(use_pixmap_cache)
                           << '\n';
                }
+               if (tag != RC_LAST)
+                       break;
        case RC_PERS_DICT:
-               if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
-                       string const path = os::external_path(spellchecker_pers_dict);
-                       os << "\\personal_dictionary \"" << path << "\"\n";
-               }
+               // obsoleted in 2.0
                if (tag != RC_LAST)
                        break;
        case RC_USE_INP_ENC:
-               if (ignore_system_lyxrc ||
-                   spellchecker_use_input_encoding
-                   != system_lyxrc.spellchecker_use_input_encoding) {
-                       os << "\\use_input_encoding "
-                          << convert<string>(spellchecker_use_input_encoding)
-                          << '\n';
-               }
+               // obsoleted in 2.0
                if (tag != RC_LAST)
                        break;
 
                os << "\n#\n"
                   << "# LANGUAGE SUPPORT SECTION ##########################\n"
                   << "#\n\n";
+               if (tag != RC_LAST)
+                       break;
 
        case RC_SPELLCHECK_CONTINUOUSLY:
                if (ignore_system_lyxrc ||
@@ -2727,11 +2758,6 @@ string const LyXRC::getDescription(LyXRCTags tag)
                         "Use the OS native format.");
                break;
 
-       case RC_PERS_DICT:
-       case RC_USE_PERS_DICT:
-               str = _("Specify an alternate personal dictionary file. E.g. \".aspell_english\".");
-               break;
-
        case RC_PREVIEW:
                str = _("Shows a typeset preview of things such as math");
                break;
@@ -2898,10 +2924,6 @@ string const LyXRC::getDescription(LyXRCTags tag)
        case RC_USETEMPDIR:
                break;
 
-       case RC_USE_INP_ENC:
-               str = _("Specify whether to pass the -T input encoding option to aspell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
-               break;
-
        case RC_USE_TOOLTIP:
                str = _("Enable the automatic appearance of tool tips in the work area.");
                break;