]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrc.C
Fix natbib bug spotted by JMarc.
[lyx.git] / src / lyxrc.C
index 1053cdbcf760435fe8b111f998dcb3577477859d..0d45db36034bda73990532419ead9c0620b20d92 100644 (file)
@@ -1,12 +1,10 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file lyxrc.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
- *
- *         Copyright 1995 Matthias Ettrich
- *          Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS
+ */
 
 #include <config.h>
 
@@ -27,6 +25,8 @@
 #include "intl.h"
 #include "support/path.h"
 #include "support/filetools.h"
+#include "support/LAssert.h"
+#include "support/userinfo.h"
 #include "converter.h"
 #include "gettext.h"
 #include "lyxlex.h"
@@ -148,6 +148,8 @@ keyword_item lyxrcTags[] = {
        { "\\use_pspell", LyXRC::RC_USE_PSPELL },
 #endif
        { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
+       { "\\user_email", LyXRC::RC_USER_EMAIL },
+       { "\\user_name", LyXRC::RC_USER_NAME },
        { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
        { "\\viewer" ,LyXRC::RC_VIEWER},
        { "\\wheel_jump", LyXRC::RC_WHEEL_JUMP }
@@ -197,7 +199,7 @@ void LyXRC::setDefaults() {
        dpi = 75;
        // Because a screen typically is wider than a piece of paper:
        zoom = 150;
-       wheel_jump = 100;
+       wheel_jump = 5;
        // Default LaTeX font size:
        font_sizes[LyXFont::SIZE_TINY] = 5.0;
        font_sizes[LyXFont::SIZE_SCRIPT] = 7.0;
@@ -264,6 +266,13 @@ void LyXRC::setDefaults() {
        // should be moved from the LyXRC class).
        use_gui = true;
        pdf_mode = false;
+       user_name = lyx::user_name();
+       
+       user_email = lyx::user_email();
+
+       if (user_email.empty())
+               user_email = _("email address unknown");
 }
 
 
@@ -779,7 +788,7 @@ int LyXRC::read(string const & filename)
                        if (lexrc.next()) {
                                x11_name = lexrc.getString();
                        } else {
-                               lexrc.printError("Missing color name for color : `$$Token'");
+                               lexrc.printError("Missing color name for color: `$$Token'");
                                break;
                        }
 
@@ -1094,6 +1103,16 @@ int LyXRC::read(string const & filename)
                        }
                        break;
 
+               case RC_USER_NAME:
+                       if (lexrc.next())
+                               user_name = lexrc.getString();
+                       break;
+
+               case RC_USER_EMAIL:
+                       if (lexrc.next())
+                               user_email = lexrc.getString();
+                       break;
                case RC_LAST: break; // this is just a dummy
                }
        }
@@ -1261,6 +1280,12 @@ void LyXRC::output(ostream & os) const
                           << '\n';
                }
 
+       case RC_USER_NAME:
+               os << "\\user_name \"" << user_name << "\"\n";
+
+       case RC_USER_EMAIL:
+               os << "\\user_email " << user_email << "\n";
+
        case RC_SHOW_BANNER:
                if (show_banner != system_lyxrc.show_banner) {
                        os << "\\show_banner " << tostr(show_banner) << '\n';
@@ -1798,6 +1823,7 @@ void LyXRC::output(ostream & os) const
                        if (!converters.getConverter(cit->from, cit->to))
                                os << "\\converter \"" << cit->from
                                   << "\" \"" << cit->to << "\" \"\" \"\"\n";
+
        }
        os.flush();
 }
@@ -1947,11 +1973,11 @@ string const LyXRC::getDescription(LyXRCTags tag)
                break;
 
        case RC_DOCUMENTPATH:
-               str = _("The default path for your documents.  An empty value selects the directory LyX was started from.");
+               str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
                break;
 
        case RC_TEMPLATEPATH:
-               str = _("The path that LyX will set when offering to choose a template.  An empty value selects the directory LyX was started from.");
+               str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
                break;
 
        case RC_TEMPDIRPATH:
@@ -1983,7 +2009,7 @@ string const LyXRC::getDescription(LyXRCTags tag)
                break;
 
        case RC_UIFILE:
-               str = _("The  UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
+               str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
                break;
 
        case RC_KBMAP:
@@ -1993,7 +2019,7 @@ string const LyXRC::getDescription(LyXRCTags tag)
                break;
 
        case RC_ASCIIROFF_COMMAND:
-               str = _("Use to define an external program to render tables in the ASCII output. E.g. \"groff -t -Tlatin1 $$FName\"  where $$FName is the input file. If \"none\" is specified, an internal routine is used.");
+               str = _("Use to define an external program to render tables in the ASCII output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"none\" is specified, an internal routine is used.");
                break;
 
        case RC_ASCII_LINELEN:
@@ -2083,7 +2109,7 @@ string const LyXRC::getDescription(LyXRCTags tag)
                break;
 
        case RC_LANGUAGE_PACKAGE:
-               str = _("The latex command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
+               str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
                break;
 
        case RC_LANGUAGE_GLOBAL_OPTIONS:
@@ -2103,15 +2129,15 @@ string const LyXRC::getDescription(LyXRCTags tag)
                break;
 
        case RC_LANGUAGE_COMMAND_BEGIN:
-               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.");
+               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.");
                break;
 
        case RC_LANGUAGE_COMMAND_END:
-               str = _("The latex command for changing back to the language of the document.");
+               str = _("The LaTeX command for changing back to the language of the document.");
                break;
 
        case RC_LANGUAGE_COMMAND_LOCAL:
-               str = _("The latex command for local changing of the language.");
+               str = _("The LaTeX command for local changing of the language.");
                break;
 
        case RC_DATE_INSERT_FORMAT:
@@ -2124,7 +2150,7 @@ string const LyXRC::getDescription(LyXRCTags tag)
                break;
 
        case RC_WHEEL_JUMP:
-               str = _("The wheel movement factor (for mice with wheels or five button mice).");
+               str = _("The number of lines that are scrolled by mice with wheels or five button mice.");
                break;
 
        case RC_CONVERTER: