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"
27 typedef Qt2CB<ControlLog, Qt2DB<QLogDialog> > base_class;
29 QLog::QLog(ControlLog & c)
30 : base_class(c, _("Log"))
35 void QLog::build_dialog()
37 dialog_.reset(new QLogDialog(this));
39 bc().setCancel(dialog_->closePB);
43 void QLog::update_contents()
45 std::pair<Buffer::LogType, string> const logfile = controller().logfile();
47 if (logfile.first == Buffer::buildlog)
48 dialog_->setCaption(_("Build log"));
50 dialog_->setCaption(_("LaTeX log"));
52 dialog_->logTV->setText("");
54 ifstream ifstr(logfile.second.c_str());
56 if (logfile.first == Buffer::buildlog)
57 dialog_->logTV->setText(_("No build log file found"));
59 dialog_->logTV->setText(_("No LaTeX log file found"));
66 while (getline(ifstr, line))
69 dialog_->logTV->setText(text.c_str());