]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrc.C
removed a warning from screen and added CFLAGS in lyx.spec.in.
[lyx.git] / src / lyxrc.C
index 350334b39ebd8ac8b2d07938a326b8879a4e577c..c05bf9ea66236d7e6259ff2c9efe810dece44813 100644 (file)
@@ -14,7 +14,7 @@
 #pragma implementation "lyxrc.h"
 #endif
 
-#include "error.h"
+#include "debug.h"
 
 #include "lyxrc.h"
 #include "LyXAction.h"
@@ -22,7 +22,7 @@
 #include "lyx_main.h"
 #include "intl.h"
 #include "tex-strings.h"
-#include "pathstack.h"
+#include "support/path.h"
 #include "support/filetools.h"
 #include "lyxtext.h"
 
@@ -120,6 +120,7 @@ enum _LyXRCTags {
        RC_EXIT_CONFIRMATION,
        RC_DISPLAY_SHORTCUTS,
        RC_RELYX_COMMAND,
+       RC_TTH_COMMAND,
        RC_LAST 
 };
 
@@ -198,6 +199,7 @@ static keyword_item lyxrcTags[] = {
        { "\\spell_command", RC_SPELL_COMMAND },
        { "\\tempdir_path", RC_TEMPDIRPATH },
        { "\\template_path", RC_TEMPLATEPATH },
+       { "\\tth_command", RC_TTH_COMMAND },
        { "\\use_alt_language", RC_USE_ALT_LANG },
        { "\\use_escape_chars", RC_USE_ESC_CHARS },
        { "\\use_input_encoding", RC_USE_INP_ENC },
@@ -254,6 +256,7 @@ LyXRC::LyXRC()
        default_papersize = PAPER_USLETTER;
        custom_export_format = "ps";
        chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
+       tth_command = "tth -t";
        fontenc = "default";
        dpi = 75;
        // Because a screen typically is wider than a piece of paper:
@@ -304,10 +307,10 @@ int LyXRC::ReadBindFile(string name)
 {
        hasBindFile = true;
        string tmp = i18nLibFileSearch("bind",name,"bind");
-       lyxerr.debug("Reading bindfile:" + tmp, Error::LYXRC); 
+       lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
        int result = Read(tmp);
        if (result) {
-               lyxerr.print("Error reading bind file: " + tmp);
+               lyxerr << "Error reading bind file: " << tmp << endl;
        }
        return result;
 }
@@ -318,13 +321,13 @@ int LyXRC::Read(string const &filename)
        string bindFile = "cua";
 
        LyXLex lexrc(lyxrcTags, lyxrcCount);
-       if (lyxerr.debugging(Error::LEX_PARSER))
+       if (lyxerr.debugging(Debug::PARSER))
                lexrc.printTable();
        
        lexrc.setFile(filename);
        if (!lexrc.IsOK()) return -2;
 
-       lyxerr.debug("Reading '" + filename + "'...", Error::INIT);
+       lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
        
        while (lexrc.IsOK()) {
 
@@ -448,7 +451,7 @@ int LyXRC::Read(string const &filename)
                        break;
                        
                case RC_PRINTEXSTRAOPTIONS:
-                       if (lexrc.EatLine())
+                       if (lexrc.next())
                                print_extra_options = lexrc.GetString();
                        break;
                        
@@ -561,6 +564,11 @@ int LyXRC::Read(string const &filename)
                                chktex_command = lexrc.GetString();
                        break;
 
+               case RC_TTH_COMMAND:
+                       if (lexrc.next())
+                               tth_command = lexrc.GetString();
+                       break;
+
                case RC_SCREEN_DPI:
                        if (lexrc.next())
                                dpi = lexrc.GetInteger();
@@ -718,11 +726,11 @@ int LyXRC::Read(string const &filename)
                        }
 
                        if ((action = lyxaction.LookupFunc(cmd.c_str()))>=0) {
-                               if (lyxerr.debugging(Error::KEY)) {
-                                       lyxerr.print("RC_BIND: Sequence `"
-                                                     + seq + "' Command `"
-                                                     + cmd + "' Action `"
-                                                     + tostr(action) + '\'');
+                               if (lyxerr.debugging(Debug::KEY)) {
+                                       lyxerr << "RC_BIND: Sequence `"
+                                              << seq << "' Command `"
+                                              << cmd << "' Action `"
+                                              << action << '\'' << endl;
                                }
                                res = bindKey(seq.c_str(), action);
                                if (res != 0) {
@@ -833,7 +841,7 @@ int LyXRC::Read(string const &filename)
 
 void LyXRC::Print()
 {
-       lyxerr.print("The current internal LyXRC:");
+       lyxerr << "The current internal LyXRC:" << endl;
 }