3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
15 #pragma implementation
20 #include "ControlLog.h"
22 #include <qtextview.h>
23 #include <qpushbutton.h>
25 #include "QLogDialog.h"
32 typedef Qt2CB<ControlLog, Qt2DB<QLogDialog> > base_class;
35 : base_class(_("Log"))
40 void QLog::build_dialog()
42 dialog_.reset(new QLogDialog(this));
44 bc().setCancel(dialog_->closePB);
48 void QLog::update_contents()
50 std::pair<Buffer::LogType, string> const logfile = controller().logfile();
52 if (logfile.first == Buffer::buildlog)
53 dialog_->setCaption(_("Build log"));
55 dialog_->setCaption(_("LaTeX log"));
57 dialog_->logTV->setText("");
59 ifstream ifstr(logfile.second.c_str());
61 if (logfile.first == Buffer::buildlog)
62 dialog_->logTV->setText(_("No build log file found"));
64 dialog_->logTV->setText(_("No LaTeX log file found"));
71 while (getline(ifstr, line))
74 dialog_->logTV->setText(text.c_str());