]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrc.C
Minimal fix needed to give Qt a label dialog again.
[lyx.git] / src / lyxrc.C
index 4db42ebe7e7ae55b8f7b1de09e675e9d6686d09a..b59080a5c17873ddbd2943d11350b41b6d708d96 100644 (file)
@@ -1,19 +1,13 @@
-/* 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>
 
-#ifdef __GNUG__
-#pragma implementation "lyxrc.h"
-#endif
-
 #include <fstream>
 #include <iomanip>
 #include <iostream>
 #include "intl.h"
 #include "support/path.h"
 #include "support/filetools.h"
+#include "support/LAssert.h"
+#include "support/userinfo.h"
 #include "converter.h"
+#include "format.h"
 #include "gettext.h"
 #include "lyxlex.h"
 
@@ -148,6 +145,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 }
@@ -264,6 +263,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");
 }
 
 
@@ -1094,6 +1100,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 +1277,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 +1820,7 @@ void LyXRC::output(ostream & os) const
                        if (!converters.getConverter(cit->from, cit->to))
                                os << "\\converter \"" << cit->from
                                   << "\" \"" << cit->to << "\" \"\" \"\"\n";
+
        }
        os.flush();
 }