#include "support/os.h"
#include "support/userinfo.h"
-namespace os = lyx::support::os;
-using lyx::docstring;
-using lyx::support::ascii_lowercase;
-using lyx::support::bformat;
-using lyx::support::expandPath;
-using lyx::support::getEnv;
-using lyx::support::libFileSearch;
-using lyx::support::token;
-using lyx::support::tokenPos;
+namespace lyx {
+
+namespace os = support::os;
+
+using support::ascii_lowercase;
+using support::bformat;
+using support::expandPath;
+using support::getEnv;
+using support::libFileSearch;
+using support::token;
using std::cout;
using std::endl;
load_session = false;
make_backup = true;
backupdir_path.erase();
- display_graphics = lyx::graphics::ColorDisplay;
+ display_graphics = graphics::ColorDisplay;
// Spellchecker settings:
use_spell_lib = true;
isp_command = "ispell";
show_banner = true;
windows_style_tex_paths = false;
tex_allows_spaces = false;
- date_insert_format = "%A, %e %B %Y";
+ date_insert_format = "%x";
cursor_follows_scrollbar = false;
dialogs_iconify_with_main = false;
label_init_length = 3;
preview_hashed_labels = false;
preview_scale_factor = "0.9";
- user_name = lyx::support::user_name();
+ user_name = support::user_name();
- user_email = lyx::support::user_email();
+ user_email = support::user_email();
}
case RC_DISPLAY_GRAPHICS:
if (lexrc.next()) {
- display_graphics = lyx::graphics::displayTranslator().find(lexrc.getString());
+ display_graphics = graphics::displayTranslator().find(lexrc.getString());
}
break;
viewer = lexrc.getString();
if (lexrc.next())
editor = lexrc.getString();
- // The only supported flag for now is "document".
- // More flags could be added in the future.
- // Therefore we use tokenPos below to read the flag.
string flags;
// Hack to ensure compatibility with versions older
// than 1.5.0
flags.erase();
}
}
- bool const document =
- (tokenPos(flags, ',', "document") >= 0);
- if (!flags.empty() && flags != "document")
- lyxerr << "Ignoring flags other than "
- "`document' in `" << flags
- << "' for format `" << format << "'."
- << endl;
+ int flgs = Format::none;
+ while (!flags.empty()) {
+ string flag;
+ flags = support::split(flags, flag, ',');
+ if (flag == "document")
+ flgs |= Format::document;
+ else if (flag == "vector")
+ flgs |= Format::vector;
+ else
+ lyxerr << "Ignoring unknown flag `"
+ << flag << "' for format `"
+ << format << "'." << endl;
+ }
if (prettyname.empty()) {
if (converters.formatIsUsed(format)) {
lyxerr << "Can't delete format "
}
} else {
formats.add(format, extension, prettyname,
- shortcut, viewer, editor, document);
+ shortcut, viewer, editor, flgs);
}
break;
}
os << "# Display graphics within LyX\n"
<< "# monochrome|grayscale|color|none\n"
<< "\\display_graphics "
- << lyx::graphics::displayTranslator().find(display_graphics)
+ << graphics::displayTranslator().find(display_graphics)
<< '\n';
}
format->shortcut() != cit->shortcut() ||
format->viewer() != cit->viewer() ||
format->editor() != cit->editor() ||
- format->documentFormat() != cit->documentFormat()) {
+ format->documentFormat() != cit->documentFormat() ||
+ format->vectorFormat() != cit->vectorFormat()) {
os << "\\format \"" << cit->name() << "\" \""
<< cit->extension() << "\" \""
<< cit->prettyname() << "\" \""
<< cit->shortcut() << "\" \""
<< cit->viewer() << "\" \""
<< cit->editor() << "\" \"";
+ std::vector<string> flags;
if (cit->documentFormat())
- os << "document";
+ flags.push_back("document");
+ if (cit->vectorFormat())
+ flags.push_back("vector");
+ os << support::getStringFromVector(flags);
os << "\"\n";
}
}
break;
case RC_NUMLASTFILES:
- str = lyx::from_utf8(bformat(lyx::to_utf8(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu.")), maxlastfiles));
+ str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
+ maxlastfiles);
break;
case RC_PATH_PREFIX:
break;
}
- return lyx::to_utf8(str);
+ return to_utf8(str);
}
// The global instance
// The global copy of the system lyxrc entries (everything except preferences)
LyXRC system_lyxrc;
+
+
+} // namespace lyx