]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
HTML for stackrel.
[lyx.git] / src / BufferParams.cpp
index 37fba33142e96898a0021c1cc9bc0463028287b2..bd43f2819fb71efb176e7d5389732d730a26b6ec 100644 (file)
@@ -369,7 +369,9 @@ BufferParams::BufferParams()
        suppress_date = false;
        // white is equal to no background color
        backgroundcolor = lyx::rgbFromHexName("#ffffff");
-       compressed = false;
+       // light gray is the default font color for greyed-out notes
+       notefontcolor = lyx::rgbFromHexName("#cccccc");
+       compressed = lyxrc.save_compressed;
        for (int iter = 0; iter < 4; ++iter) {
                user_defined_bullet(iter) = ITEMIZE_DEFAULTS[iter];
                temp_bullet(iter) = ITEMIZE_DEFAULTS[iter];
@@ -519,16 +521,22 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                // We assume that a tex class exists for local or unknown layouts so this warning
                // will only be given for system layouts.
                if (!baseClass()->isTeXClassAvailable()) {
+                       docstring desc = 
+                               translateIfPossible(from_utf8(baseClass()->description()));
                        docstring const msg =
-                               bformat(_("The layout file requested by this document,\n"
-                                                "%1$s.layout,\n"
-                                                "is not usable. This is probably because a LaTeX\n"
-                                                "class or style file required by it is not\n"
-                                                "available. See the Customization documentation\n"
-                                                "for more information.\n"), from_utf8(classname));
+                               bformat(_("The document class requested\n"
+                                                "\t%1$s\n"
+                                                "requires external files that are not available.\n"
+                                                "The document class can still be used, but LyX\n"
+                                                "will not be able to produce output until the\n"
+                                                "following prerequisites are installed:\n"
+                                                "\t%2$s\n"
+                                                "See section 3.1.2.2 of the User's Guide for\n"
+                                                "more information."), 
+                                                desc, from_utf8(baseClass()->prerequisites()));
                        frontend::Alert::warning(_("Document class not available"),
-                                      msg + _("LyX will not be able to produce output."));
-               } 
+                                      msg);
+               }
        } else if (token == "\\begin_preamble") {
                readPreamble(lex);
        } else if (token == "\\begin_local_layout") {
@@ -715,6 +723,12 @@ string BufferParams::readToken(Lexer & lex, string const & token,
        } else if (token == "\\backgroundcolor") {
                lex.eatLine();
                backgroundcolor = lyx::rgbFromHexName(lex.getString());
+       } else if (token == "\\notefontcolor") {
+               lex.eatLine();
+               string color = lex.getString();
+               notefontcolor = lyx::rgbFromHexName(color);
+               // set the font color within LyX
+               lcolor.setColor(Color_greyedouttext, color);
        } else if (token == "\\paperwidth") {
                lex >> paperwidth;
        } else if (token == "\\paperheight") {
@@ -907,6 +921,8 @@ void BufferParams::writeFile(ostream & os) const
           << '\n';
           if (backgroundcolor != lyx::rgbFromHexName("#ffffff"))
                os << "\\backgroundcolor " << lyx::X11hexname(backgroundcolor) << '\n';
+          if (notefontcolor != lyx::rgbFromHexName("#cccccc"))
+               os << "\\notefontcolor " << lyx::X11hexname(notefontcolor) << '\n';
 
        BranchList::const_iterator it = branchlist().begin();
        BranchList::const_iterator end = branchlist().end();