3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
13 #pragma implementation
16 #include <qtextview.h>
17 #include <qpushbutton.h>
19 #include "QLogDialog.h"
24 #include "QtLyXView.h"
25 #include "ControlLog.h"
30 typedef Qt2CB<ControlLog, Qt2DB<QLogDialog> > base_class;
32 QLog::QLog(ControlLog & c)
33 : base_class(c, _("Log"))
38 void QLog::build_dialog()
40 dialog_.reset(new QLogDialog(this));
42 bc().setCancel(dialog_->closePB);
46 void QLog::update_contents()
48 std::pair<Buffer::LogType, string> const logfile = controller().logfile();
50 if (logfile.first == Buffer::buildlog)
51 dialog_->setCaption(_("Build log"));
53 dialog_->setCaption(_("LaTeX log"));
55 dialog_->logTV->setText("");
57 ifstream ifstr(logfile.second.c_str());
59 if (logfile.first == Buffer::buildlog)
60 dialog_->logTV->setText(_("No build log file found"));
62 dialog_->logTV->setText(_("No LaTeX log file found"));
69 while (getline(ifstr, line))
72 dialog_->logTV->setText(text.c_str());