#include "LyXRC.h"
+#include "BufferList.h"
#include "ColorSet.h"
#include "Converter.h"
#include "FontEnums.h"
// The format should also be updated in configure.py, and conversion code
// should be added to prefs2prefs_prefs.py.
-static unsigned int const LYXRC_FILEFORMAT = 19; // rgh: remove print support
+static unsigned int const LYXRC_FILEFORMAT = 22; // ef: pygmentize_command
// when adding something to this array keep it sorted!
LexerKeyword lyxrcTags[] = {
{ "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
{ "\\index_command", LyXRC::RC_INDEX_COMMAND },
{ "\\input", LyXRC::RC_INPUT },
+ { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
{ "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
{ "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
{ "\\kbmap", LyXRC::RC_KBMAP },
{ "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
{ "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
{ "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
+ { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
{ "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
{ "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
{ "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
{ "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
{ "\\ui_file", LyXRC::RC_UIFILE },
{ "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
+ { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
+ { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
{ "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
{ "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
{ "\\use_qimage", LyXRC::RC_USE_QIMAGE },
default_view_format = "pdf2";
default_otf_view_format = "pdf4";
chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
- bibtex_command = "bibtex";
+ bibtex_command = "automatic";
fontenc = "default";
index_command = "makeindex -c -q";
nomencl_command = "makeindex -s nomencl.ist";
+ pygmentize_command = string();
dpi = 75;
// Because a screen is typically wider than a piece of paper:
zoom = 150;
+ currentZoom = zoom;
allow_geometry_session = true;
// Default LaTeX font size:
font_sizes[FONT_SIZE_TINY] = "5.0";
preview_hashed_labels = false;
preview_scale_factor = 1.0;
use_converter_cache = true;
+ use_converter_needauth_forbidden = true;
+ use_converter_needauth = true;
use_system_colors = false;
use_tooltip = true;
use_pixmap_cache = false;
lexrc >> print_paper_flag;
break;
+ case RC_PYGMENTIZE_COMMAND:
+ if (lexrc.next(true)) {
+ pygmentize_command = lexrc.getString();
+ }
+ break;
+
case RC_VIEWDVI_PAPEROPTION:
if (lexrc.next())
view_dvi_paper_option = lexrc.getString();
}
break;
+ case RC_JBIBTEX_ALTERNATIVES:
+ if (lexrc.next(true)) {
+ jbibtex_alternatives.insert(lexrc.getString());
+ }
+ break;
+
case RC_INDEX_ALTERNATIVES:
if (lexrc.next(true)) {
index_alternatives.insert(lexrc.getString());
case RC_SCREEN_ZOOM:
lexrc >> zoom;
+ if (zoom < 10)
+ zoom = 10;
break;
case RC_GEOMETRY_SESSION:
break;
case RC_DOCUMENTPATH:
- if (lexrc.next()) {
+ if (lexrc.next())
document_path = os::internal_path(lexrc.getString());
- document_path = expandPath(document_path);
- }
break;
case RC_EXAMPLEPATH:
- if (lexrc.next()) {
+ if (lexrc.next())
example_path = os::internal_path(lexrc.getString());
- example_path = expandPath(example_path);
- }
break;
case RC_TEMPLATEPATH:
- if (lexrc.next()) {
+ if (lexrc.next())
template_path = os::internal_path(lexrc.getString());
- template_path = expandPath(template_path);
- }
break;
case RC_TEMPDIRPATH:
- if (lexrc.next()) {
+ if (lexrc.next())
tempdir_path = os::internal_path(lexrc.getString());
- tempdir_path = expandPath(tempdir_path);
- }
break;
case RC_THESAURUSDIRPATH:
- if (lexrc.next()) {
+ if (lexrc.next())
thesaurusdir_path = os::internal_path(lexrc.getString());
- thesaurusdir_path = expandPath(thesaurusdir_path);
- }
break;
case RC_HUNSPELLDIR_PATH:
- if (lexrc.next()) {
+ if (lexrc.next())
hunspelldir_path = os::internal_path(lexrc.getString());
- hunspelldir_path = expandPath(hunspelldir_path);
- }
break;
case RC_USELASTFILEPOS:
break;
case RC_SERVERPIPE:
- if (lexrc.next()) {
+ if (lexrc.next())
lyxpipes = os::internal_path(lexrc.getString());
- lyxpipes = expandPath(lyxpipes);
- }
break;
case RC_CURSOR_FOLLOWS_SCROLLBAR:
lexrc >> save_origin;
break;
case RC_BACKUPDIR_PATH:
- if (lexrc.next()) {
+ if (lexrc.next())
backupdir_path = os::internal_path(lexrc.getString());
- backupdir_path = expandPath(backupdir_path);
- }
break;
case RC_DEFAULT_DECIMAL_POINT:
lexrc >> default_decimal_point;
case RC_VIEWER: {
string format, command;
lexrc >> format >> command;
- formats.setViewer(format, command);
+ theFormats().setViewer(format, command);
break;
}
case RC_FILEFORMAT: {
bool ok = true;
- string format, extensions, prettyname, shortcut;
+ string format, extensions, shortcut;
+ docstring prettyname;
if (!(lexrc >> format >> extensions))
ok = false;
if (ok && lexrc.next(true))
- prettyname = lexrc.getString();
+ prettyname = lexrc.getDocString();
else
ok = false;
if (ok)
if (theConverters().formatIsUsed(format))
LYXERR0("Can't delete format " << format);
else
- formats.erase(format);
+ theFormats().erase(format);
} else {
- formats.add(format, extensions, prettyname,
+ theFormats().add(format, extensions, prettyname,
shortcut, viewer, editor, mime, flgs);
}
break;
case RC_USE_CONVERTER_CACHE:
lexrc >> use_converter_cache;
break;
+ case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
+ lexrc >> use_converter_needauth_forbidden;
+ break;
+ case RC_USE_CONVERTER_NEEDAUTH:
+ lexrc >> use_converter_needauth;
+ break;
case RC_CONVERTER_CACHE_MAXAGE:
lexrc >> converter_cache_maxage;
break;
}
/// Update converters data-structures
- theConverters().update(formats);
+ theConverters().update(theFormats());
theConverters().buildGraph();
+ theBufferList().invalidateConverterCache();
return ReadOK;
}
}
if (tag != RC_LAST)
break;
+ case RC_JBIBTEX_ALTERNATIVES: {
+ CommandSet::const_iterator it = jbibtex_alternatives.begin();
+ CommandSet::const_iterator end = jbibtex_alternatives.end();
+ for ( ; it != end; ++it) {
+ if (ignore_system_lyxrc
+ || !system_lyxrc.jbibtex_alternatives.count(*it))
+ os << "\\jbibtex_alternatives \""
+ << *it << "\"\n";
+ }
+ if (tag != RC_LAST)
+ break;
+ }
case RC_INDEX_ALTERNATIVES: {
CommandSet::const_iterator it = index_alternatives.begin();
CommandSet::const_iterator end = index_alternatives.end();
}
if (tag != RC_LAST)
break;
+ case RC_PYGMENTIZE_COMMAND:
+ if (ignore_system_lyxrc ||
+ pygmentize_command != system_lyxrc.pygmentize_command) {
+ os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
+ }
+ if (tag != RC_LAST)
+ break;
case RC_TEX_EXPECTS_WINDOWS_PATHS:
// Don't write this setting to the preferences file,
// but allow temporary changes (bug 7557).
if (tag != RC_LAST)
break;
+ case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
+ if (ignore_system_lyxrc ||
+ use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
+ os << "\\use_converter_needauth_forbidden "
+ << convert<string>(use_converter_needauth_forbidden) << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
+
+ case RC_USE_CONVERTER_NEEDAUTH:
+ if (ignore_system_lyxrc ||
+ use_converter_needauth != system_lyxrc.use_converter_needauth) {
+ os << "\\use_converter_needauth "
+ << convert<string>(use_converter_needauth) << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
+
case RC_CONVERTER_CACHE_MAXAGE:
if (ignore_system_lyxrc ||
converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
case RC_FILEFORMAT:
// New/modified formats
- for (Formats::const_iterator cit = formats.begin();
- cit != formats.end(); ++cit) {
+ for (Formats::const_iterator cit = theFormats().begin();
+ cit != theFormats().end(); ++cit) {
Format const * format =
- system_formats.getFormat(cit->name());
+ theSystemFormats().getFormat(cit->name());
if (!format ||
format->extensions() != cit->extensions() ||
format->prettyname() != cit->prettyname() ||
format->mime() != cit->mime()) {
os << "\\format \"" << cit->name() << "\" \""
<< cit->extensions() << "\" \""
- << cit->prettyname() << "\" \""
+ << to_utf8(cit->prettyname()) << "\" \""
<< cit->shortcut() << "\" \""
<< escapeCommand(cit->viewer()) << "\" \""
<< escapeCommand(cit->editor()) << "\" \"";
}
// Look for deleted formats
- for (Formats::const_iterator cit = system_formats.begin();
- cit != system_formats.end(); ++cit)
- if (!formats.getFormat(cit->name()))
+ for (Formats::const_iterator cit = theSystemFormats().begin();
+ cit != theSystemFormats().end(); ++cit)
+ if (!theFormats().getFormat(cit->name()))
os << "\\format \"" << cit->name()
<< "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
if (tag != RC_LAST)
case LyXRC::RC_INDEX_ALTERNATIVES:
case LyXRC::RC_INDEX_COMMAND:
case LyXRC::RC_JBIBTEX_COMMAND:
+ case LyXRC::RC_JBIBTEX_ALTERNATIVES:
case LyXRC::RC_JINDEX_COMMAND:
case LyXRC::RC_NOMENCL_COMMAND:
+ case LyXRC::RC_PYGMENTIZE_COMMAND:
case LyXRC::RC_INPUT:
case LyXRC::RC_KBMAP:
case LyXRC::RC_KBMAP_PRIMARY:
case LyXRC::RC_USER_EMAIL:
case LyXRC::RC_USER_NAME:
case LyXRC::RC_USE_CONVERTER_CACHE:
+ case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
+ case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
case LyXRC::RC_USE_SYSTEM_COLORS:
case LyXRC::RC_USE_TOOLTIP:
case LyXRC::RC_USE_PIXMAP_CACHE:
case RC_CONVERTER:
break;
+ case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
+ str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
+ break;
+
+ case RC_CONVERTER_NEEDAUTH:
+ str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
+ break;
+
case RC_COPIER:
break;
str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
break;
+ case RC_PYGMENTIZE_COMMAND:
+ str = _("The command to run the python pygments syntax highlighter.");
+ break;
+
case RC_INPUT:
break;