]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
cosmetics
[lyx.git] / src / LyXRC.cpp
index c8cf673b3b1b52ac132f12e5aaabde40a1ab0806..c856d756ac4e06af05f69a97f66dd543172efbd2 100644 (file)
@@ -153,6 +153,7 @@ keyword_item lyxrcTags[] = {
        { "\\serverpipe", LyXRC::RC_SERVERPIPE },
        { "\\set_color", LyXRC::RC_SET_COLOR },
        { "\\show_banner", LyXRC::RC_SHOW_BANNER },
+       { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
        { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
        { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
        { "\\template_path", LyXRC::RC_TEMPLATEPATH },
@@ -175,7 +176,7 @@ keyword_item lyxrcTags[] = {
        { "\\user_name", LyXRC::RC_USER_NAME },
        { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
        // compatibility with versions older than 1.4.0 only
-       { "\\viewer" ,LyXRC::RC_VIEWER}
+       { "\\viewer"LyXRC::RC_VIEWER}
 };
 
 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
@@ -269,6 +270,7 @@ void LyXRC::setDefaults() {
        language_package = "\\usepackage{babel}";
        language_command_begin = "\\selectlanguage{$$lang}";
        language_command_local = "\\foreignlanguage{$$lang}{";
+       sort_layouts = false;
        default_language = "english";
        show_banner = true;
        windows_style_tex_paths = false;
@@ -1178,6 +1180,11 @@ int LyXRC::read(Lexer & lexrc)
                                        convert<unsigned int>(lexrc.getString());
                        break;
 
+               case RC_SORT_LAYOUTS:
+                       if (lexrc.next())
+                               sort_layouts = lexrc.getBool();
+                       break;
+
                case RC_LAST: break; // this is just a dummy
                }
        }
@@ -1340,7 +1347,14 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                if (tag != RC_LAST)
                        break;
-
+       case RC_SORT_LAYOUTS:
+               if (ignore_system_lyxrc ||
+                   sort_layouts != system_lyxrc.sort_layouts) {
+                       os << "# Sort layouts alphabetically.\n"
+                          << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
+               }
+               if (tag != RC_LAST)
+                       break;
        case RC_VIEWDVI_PAPEROPTION:
                if (ignore_system_lyxrc ||
                    view_dvi_paper_option
@@ -2399,6 +2413,11 @@ string const LyXRC::getDescription(LyXRCTags tag)
                str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
                break;
 
+       case RC_DEFFILE:
+               //FIXME: fix description.
+               str = _("Command definition file.");
+               break;
+
        case RC_DEFAULT_LANGUAGE:
                str = _("New documents will be assigned this language.");
                break;
@@ -2512,10 +2531,6 @@ string const LyXRC::getDescription(LyXRCTags tag)
                str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
                break;
 
-       case RC_USE_PIXMAP_CACHE:
-               str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
-               break;
-
        case RC_PREVIEW:
                str = _("Shows a typeset preview of things such as math");
                break;
@@ -2687,6 +2702,10 @@ string const LyXRC::getDescription(LyXRCTags tag)
                str = _("Specify whether to pass the -T input encoding option to ispell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
                break;
 
+       case RC_USE_PIXMAP_CACHE:
+               str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
+               break;
+
        case RC_USE_SPELL_LIB:
                break;