#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);
exit(1);
}
lyxerr << bformat(_("Using built-in default %1$s but expect problems."),
- static_cast<char *>(LYX_DIR)) << endl;
+ LYX_DIR) << endl;
} else {
lyxerr << _("Expect problems.") << endl;
}
enum Uitags {
ui_menuset = 1,
ui_toolbar,
+ ui_toolbars,
ui_include,
ui_last
};
struct keyword_item uitags[ui_last - 1] = {
{ "include", ui_include },
{ "menuset", ui_menuset },
- { "toolbar", ui_toolbar }
+ { "toolbar", ui_toolbar },
+ { "toolbars", ui_toolbars }
};
// Ensure that a file is read only once (prevents include loops)
toolbarbackend.read(lex);
break;
+ case ui_toolbars:
+ toolbarbackend.readToolbars(lex);
+ break;
+
default:
if (!rtrim(lex.getString()).empty())
lex.printError("LyX::ReadUIFile: "