#include "bufferlist.h"
#include "buffer.h"
+#include "buffer_funcs.h"
#include "lyxserver.h"
#include "kbmap.h"
#include "lyxfunc.h"
#include "frontends/lyx_gui.h"
#include <boost/function.hpp>
+#include <boost/bind.hpp>
+#include <boost/signals/signal1.hpp>
#include <cstdlib>
#include <csignal>
+#include <iostream>
using std::vector;
using std::endl;
vector<string>::iterator it = files.begin();
vector<string>::iterator end = files.end();
for (; it != end; ++it) {
- last_loaded = bufferlist.loadLyXFile(*it);
+ last_loaded = bufferlist.newBuffer(*it, false);
+ last_loaded->parseError.connect(boost::bind(&LyX::printError, this, _1));
+ loadLyXFile(last_loaded, *it);
}
files.clear();
// no buffer loaded, create one
+ string const tmpfile = "tmpfile";
if (!last_loaded)
- last_loaded = bufferlist.newFile("tmpfile", string());
+ last_loaded = newFile(tmpfile, string());
bool success = false;
}
+void LyX::printError(ErrorItem const & ei)
+{
+ std::cerr << _("LyX: ") << ei.error
+ << ':' << ei.description << std::endl;
+
+}
+
+
void LyX::init(bool gui)
{
signal(SIGHUP, error_handler);