]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrc.C
Transform the name of the temp dir on Windows with GetLongPathName.
[lyx.git] / src / lyxrc.C
index db2c8c12f8fff7eff2386e3f5acb9af55a499346..3db4de36829c969e954809897d78904e27bed90c 100644 (file)
@@ -34,6 +34,7 @@
 #include "graphics/GraphicsTypes.h"
 
 #include "support/convert.h"
+#include "support/environment.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/userinfo.h"
@@ -41,7 +42,7 @@
 using lyx::support::ascii_lowercase;
 using lyx::support::bformat;
 using lyx::support::ExpandPath;
-using lyx::support::GetEnv;
+using lyx::support::getEnv;
 using lyx::support::LibFileSearch;
 using lyx::support::token;
 
@@ -154,6 +155,7 @@ keyword_item lyxrcTags[] = {
        { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
        { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
        { "\\template_path", LyXRC::RC_TEMPLATEPATH },
+       { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
        { "\\ui_file", LyXRC::RC_UIFILE },
        { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
        { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
@@ -188,7 +190,7 @@ void LyXRC::setDefaults() {
        ui_file = "default";
        // Get printer from the environment. If fail, use default "",
        // assuming that everything is set up correctly.
-       printer = GetEnv("PRINTER");
+       printer = getEnv("PRINTER");
        print_adapt_output = false;
        print_command = "dvips";
        print_evenpage_flag = "-B";
@@ -267,6 +269,7 @@ void LyXRC::setDefaults() {
        default_language = "english";
        show_banner = true;
        cygwin_path_fix = false;
+       tex_allows_spaces = false;
        date_insert_format = "%A, %e %B %Y";
        cursor_follows_scrollbar = false;
        dialogs_iconify_with_main = false;
@@ -383,18 +386,24 @@ int LyXRC::read(LyXLex & lexrc)
                        }
                        break;
 
-               case RC_KBMAP:
-                       if (lexrc.next()) {
-                               use_kbmap = lexrc.getBool();
-                       }
-                       break;
-
                case RC_CYGWIN_PATH_FIX:
                        if (lexrc.next()) {
                                cygwin_path_fix = lexrc.getBool();
                        }
                        break;
 
+               case RC_TEX_ALLOWS_SPACES:
+                       if (lexrc.next()) {
+                               tex_allows_spaces = lexrc.getBool();
+                       }
+                       break;
+               case RC_KBMAP:
+                       if (lexrc.next()) {
+                               use_kbmap = lexrc.getBool();
+                       }
+                       break;
+
                case RC_KBMAP_PRIMARY:
                        if (lexrc.next()) {
                                string const kmap(lexrc.getString());
@@ -1311,18 +1320,22 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
                    index_command != system_lyxrc.index_command) {
                        os << "\\index_command \"" << index_command << "\"\n";
                }
-       case RC_KBMAP:
-               if (ignore_system_lyxrc ||
-                   use_kbmap != system_lyxrc.use_kbmap) {
-                       os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
-               }
-
        case RC_CYGWIN_PATH_FIX:
                if (ignore_system_lyxrc ||
                    cygwin_path_fix != system_lyxrc.cygwin_path_fix) {
                        os << "\\cygwin_path_fix_needed "
                           << convert<string>(cygwin_path_fix) << '\n';
                }
+       case RC_TEX_ALLOWS_SPACES:
+               if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
+                       os << "\\tex_allows_spaces "
+                          << convert<string>(tex_allows_spaces) << '\n';
+               }
+       case RC_KBMAP:
+               if (ignore_system_lyxrc ||
+                   use_kbmap != system_lyxrc.use_kbmap) {
+                       os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
+               }
        case RC_KBMAP_PRIMARY:
                if (ignore_system_lyxrc ||
                    primary_kbmap != system_lyxrc.primary_kbmap) {
@@ -2205,6 +2218,9 @@ string const LyXRC::getDescription(LyXRCTags tag)
                break;
 
        case RC_PATH_PREFIX:
+               str = _("Specify those directories which should be "
+                        "prepended to the PATH environment variable. "
+                        "Use the OS native format.");
                break;
 
        case RC_PERS_DICT:
@@ -2367,6 +2383,9 @@ string const LyXRC::getDescription(LyXRCTags tag)
                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_TEX_ALLOWS_SPACES:
+               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.");
                break;