* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#include "bufferview_funcs.h"
#include "LaTeX.h"
#include "LyXView.h"
-#include "minibuffer.h"
#include "lyx_gui_misc.h"
#include "lyx_cb.h" // ShowMessage()
#include "support/lyxfunctional.h"
+#include "gettext.h"
+#include "BufferView.h"
using std::vector;
using std::queue;
using std::reverse;
using std::sort;
-static string const token_from("$$i");
-static string const token_base("$$b");
-static string const token_to("$$o");
+namespace {
+
+string const token_from("$$i");
+string const token_base("$$b");
+string const token_to("$$o");
//////////////////////////////////////////////////////////////////////////////
-static inline
+inline
string const add_options(string const & command, string const & options)
{
string head;
return head + ' ' + options + ' ' + tail;
}
+} // namespace anon
+
//////////////////////////////////////////////////////////////////////////////
bool Format::dummy() const
{
FormatList::const_iterator cit =
find_if(formatlist.begin(), formatlist.end(),
- compare_memfun(&Format::name, name));
+ lyx::compare_memfun(&Format::name, name));
if (cit != formatlist.end())
return &(*cit);
else
{
FormatList::const_iterator cit =
find_if(formatlist.begin(), formatlist.end(),
- compare_memfun(&Format::name, name));
+ lyx::compare_memfun(&Format::name, name));
if (cit != formatlist.end())
return cit - formatlist.begin();
else
{
FormatList::iterator it =
find_if(formatlist.begin(), formatlist.end(),
- compare_memfun(&Format::name, name));
+ lyx::compare_memfun(&Format::name, name));
if (it == formatlist.end())
formatlist.push_back(Format(name, extension, prettyname,
shortcut, ""));
{
FormatList::iterator it =
find_if(formatlist.begin(), formatlist.end(),
- compare_memfun(&Format::name, name));
+ lyx::compare_memfun(&Format::name, name));
if (it != formatlist.end())
formatlist.erase(it);
}
Add(name);
FormatList::iterator it =
find_if(formatlist.begin(), formatlist.end(),
- compare_memfun(&Format::name, name));
+ lyx::compare_memfun(&Format::name, name));
if (it != formatlist.end())
it->setViewer(command);
}
command += " " + QuoteName(OnlyFilename((filename)));
- lyxerr << "Executing command: " << command << endl;
+ lyxerr[Debug::FILES] << "Executing command: " << command << endl;
ShowMessage(buffer, _("Executing command:"), command);
Path p(OnlyPath(filename));
Converter const & conv = converterlist[*cit];
bool dummy = conv.To->dummy() && conv.to != "program";
if (!dummy)
- lyxerr << "Converting from "
+ lyxerr[Debug::FILES] << "Converting from "
<< conv.from << " to " << conv.to << endl;
infile = outfile;
outfile = conv.result_dir.empty()
if (conv.latex) {
run_latex = true;
string command = subst(conv.command, token_from, "");
- lyxerr << "Running " << command << endl;
+ lyxerr[Debug::FILES] << "Running " << command << endl;
if (!runLaTeX(buffer, command))
return false;
} else {
if (conv.need_aux && !run_latex
&& !latex_command.empty()) {
- lyxerr << "Running " << latex_command
- << " to update aux file"<< endl;
+ lyxerr[Debug::FILES]
+ << "Running " << latex_command
+ << " to update aux file"<< endl;
runLaTeX(buffer, latex_command);
}
command = add_options(command,
dvipdfm_options(buffer));
- lyxerr << "Calling " << command << endl;
+ lyxerr[Debug::FILES] << "Calling " << command << endl;
if (buffer)
ShowMessage(buffer, _("Executing command:"), command);
it != files.end(); ++it)
if (prefixIs(*it, base)) {
string from2 = path + *it;
- string to2 = to_base + (*it).substr(base.length());
+ string to2 = to_base + it->substr(base.length());
to2 = ChangeExtension(to2, to_extension);
- lyxerr << "moving " << from2 << " to " << to2 << endl;
+ lyxerr[Debug::FILES] << "moving " << from2
+ << " to " << to2 << endl;
bool moved = (copy)
? lyx::copy(from2, to2)
: lyx::rename(from2, to2);
BufferView * bv = buffer->getUser();
bool need_redraw = false;
if (bv) {
- ProhibitInput(bv);
+ bv->owner()->prohibitInput();
// Remove all error insets
need_redraw = bv->removeAutoInsets();
}
bv->redraw();
bv->fitCursor(bv->text);
}
- AllowInput(bv);
+ bv->owner()->allowInput();
}
if ((result & LaTeX::ERRORS)) {
bool need_redraw = false;
if (bv) {
- ProhibitInput(bv);
- bv->owner()->getMiniBuffer()->Set(_("Running LaTeX..."));
+ bv->owner()->prohibitInput();
+ bv->owner()->message(_("Running LaTeX..."));
// Remove all error insets
need_redraw = bv->removeAutoInsets();
}
TeXErrors terr;
LaTeX latex(command, name, buffer->filepath);
int result = latex.run(terr,
- bv ? bv->owner()->getMiniBuffer() : 0);
+ bv ? bv->owner()->getLyXFunc() : 0);
if (bv) {
}
if (bv)
- AllowInput(bv);
+ bv->owner()->allowInput();
int const ERROR_MASK =
LaTeX::NO_LOGFILE |