]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
I'll find a solution for the 'dirList problem', Abdel.
[lyx.git] / src / LyXRC.cpp
index 2ecf9dd08199ea68941b6a6088c442d7e01d53a5..01bf0dca0737827e0445d9d81e7199740e292a1e 100644 (file)
 
 #include "LyXRC.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Color.h"
 #include "Converter.h"
 #include "Format.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Session.h"
 #include "Lexer.h"
 #include "FontEnums.h"
@@ -92,6 +92,7 @@ keyword_item lyxrcTags[] = {
        { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
        { "\\document_path", LyXRC::RC_DOCUMENTPATH },
        { "\\escape_chars", LyXRC::RC_ESC_CHARS },
+       { "\\example_path", LyXRC::RC_EXAMPLEPATH },
        { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
        { "\\format", LyXRC::RC_FORMAT },
        { "\\index_command", LyXRC::RC_INDEX_COMMAND },
@@ -705,6 +706,13 @@ int LyXRC::read(Lexer & lexrc)
                        }
                        break;
 
+               case RC_EXAMPLEPATH:
+                       if (lexrc.next()) {
+                               example_path = os::internal_path(lexrc.getString());
+                               example_path = expandPath(example_path);
+                       }
+                       break;
+
                case RC_TEMPLATEPATH:
                        if (lexrc.next()) {
                                template_path = os::internal_path(lexrc.getString());
@@ -1932,6 +1940,14 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                if (tag != RC_LAST)
                        break;
+       case RC_EXAMPLEPATH:
+               if (ignore_system_lyxrc ||
+                   example_path != system_lyxrc.example_path) {
+                       string const path = os::external_path(example_path);
+                       os << "\\example_path \"" << path << "\"\n";
+               }
+               if (tag != RC_LAST)
+                       break;
        case RC_TEMPLATEPATH:
                if (ignore_system_lyxrc ||
                    template_path != system_lyxrc.template_path) {
@@ -2411,6 +2427,10 @@ string const LyXRC::getDescription(LyXRCTags tag)
                str = _("Specify additional chars that can be part of a word.");
                break;
 
+       case RC_EXAMPLEPATH:
+               str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
+               break;
+
        case RC_FONT_ENCODING:
                str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
                break;