+#include "gettext.h"
+#include "lyxlex.h"
+
+#include <sstream>
+#include <fstream>
+
+using std::istringstream;
+using std::ostream;
+using std::string;
+
+namespace lyx {
+
+using support::FileName;
+
+namespace frontend {
+
+ControlLog::ControlLog(Dialog & parent)
+ : Dialog::Controller(parent),
+ type_(LatexLog)
+{}
+
+
+bool ControlLog::initialiseParams(string const & data)
+{
+ istringstream is(data);
+ LyXLex lex(0,0);
+ lex.setStream(is);
+
+ string logtype, logfile;
+ lex >> logtype;
+ if (lex.isOK()) {
+ lex.next(true);
+ logfile = lex.getString();
+ }
+ if (!lex)
+ // Parsing of the data failed.
+ return false;
+
+ if (logtype == "latex")
+ type_ = LatexLog;
+ else if (logtype == "literate")
+ type_ = LiterateLog;
+ else if (logtype == "lyx2lyx")
+ type_ = Lyx2lyxLog;
+ else if (logtype == "vc")
+ type_ = VCLog;
+ else
+ return false;
+
+ logfile_ = FileName(logfile);
+ return true;
+}
+