]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrc.C
Minor code shuffle.
[lyx.git] / src / lyxrc.C
index ea6e840112e46613a00f7e276ea3b6bc23fef11b..f93b56f4901fb9992b40235618aadccab9572f85 100644 (file)
@@ -4,7 +4,7 @@
  *           LyX, The Document Processor
  *      
  *         Copyright 1995 Matthias Ettrich
- *          Copyright 1995-2000 The LyX Team.
+ *          Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
@@ -133,6 +133,9 @@ keyword_item lyxrcTags[] = {
        { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
        { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
        { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
+#ifdef USE_PSPELL
+       { "\\use_pspell", LyXRC::RC_USE_PSPELL },
+#endif
        { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
        { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
        { "\\viewer" ,LyXRC::RC_VIEWER}, 
@@ -216,6 +219,9 @@ void LyXRC::setDefaults() {
        exit_confirmation = true;
        display_shortcuts = true;
        // Spellchecker settings:
+#ifdef USE_PSPELL      
+       use_pspell = true;
+#endif
        isp_command = "ispell";
        isp_accept_compound = false;
        isp_use_input_encoding = false;
@@ -278,7 +284,7 @@ int LyXRC::read(string const & filename)
        lexrc.setFile(filename);
        if (!lexrc.IsOK()) return -2;
        
-       lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
+       lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
        
        while (lexrc.IsOK()) {
                // By using two switches we take advantage of the compiler
@@ -707,7 +713,7 @@ int LyXRC::read(string const & filename)
                        }
                        
                        if ((action = lyxaction.LookupFunc(cmd))>= 0) {
-                               if (lyxerr.debugging(Debug::KBMAP)) {
+                               if (lyxerr.debugging(Debug::LYXRC)) {
                                        lyxerr << "RC_BIND: Sequence `"
                                               << seq << "' Command `"
                                               << cmd << "' Action `"
@@ -715,7 +721,7 @@ int LyXRC::read(string const & filename)
                                }
                                res = toplevel_keymap->bind(seq, action);
                                if (res != 0
-                                   && lyxerr.debugging(Debug::KBMAP)) {
+                                   && lyxerr.debugging(Debug::LYXRC)) {
                                        lexrc.printError(
                                                "RC_BIND: "
                                                "Invalid key sequence `"
@@ -751,6 +757,12 @@ int LyXRC::read(string const & filename)
                                ascii_linelen = lexrc.GetInteger();
                        break;
                        // Spellchecker settings:
+#ifdef USE_PSPELL
+               case RC_USE_PSPELL:
+                       if (lexrc.next())
+                               use_pspell = lexrc.GetBool();
+                       break;
+#endif
                case RC_SPELL_COMMAND:
                        if (lexrc.next())
                                isp_command = lexrc.GetString();
@@ -945,7 +957,7 @@ void LyXRC::output(ostream & os) const
           << "###          LyX, The Document Processor\n"
           << "###\n"
           << "###          Copyright 1995 Matthias Ettrich\n"
-          << "###          Copyright 1995-2000 The LyX Team.\n"
+          << "###          Copyright 1995-2001 The LyX Team.\n"
           << "###\n"
           << "### ========================================================\n"
           << "\n"
@@ -1375,7 +1387,12 @@ void LyXRC::output(ostream & os) const
                os << "\n#\n"
                   << "# SPELLCHECKER SECTION ##############################\n"
                   << "#\n\n";
-
+#ifdef USE_PSPELL
+       case RC_USE_PSPELL:
+               if (use_pspell != system_lyxrc.use_pspell) {
+                       os << "\\use_pspell \"" << use_pspell << "\"\n";
+               }
+#endif
        case RC_SPELL_COMMAND:
                if (isp_command != system_lyxrc.isp_command) {
                        os << "\\spell_command \"" << isp_command << "\"\n";