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.
13 #include "qt_helpers.h"
14 #include "ControlLog.h"
15 #include "support/std_sstream.h"
17 #include <qtextview.h>
18 #include <qpushbutton.h>
20 #include "QLogDialog.h"
27 using std::ostringstream;
29 typedef QController<ControlLog, QView<QLogDialog> > base_class;
31 QLog::QLog(Dialog & parent)
32 : base_class(parent, _("LyX: LaTeX Log"))
37 void QLog::build_dialog()
39 dialog_.reset(new QLogDialog(this));
41 bcview().setCancel(dialog_->closePB);
45 void QLog::update_contents()
47 std::pair<Buffer::LogType, string> const & logfile =
48 controller().logfile();
50 if (logfile.first == Buffer::buildlog)
51 setTitle(_("Build log"));
53 setTitle(_("LaTeX log"));
55 dialog_->logTV->setText("");
57 ifstream ifstr(logfile.second.c_str());
59 if (logfile.first == Buffer::buildlog)
60 dialog_->logTV->setText(qt_("No build log file found."));
62 dialog_->logTV->setText(qt_("No LaTeX log file found."));
69 dialog_->logTV->setText(toqstr(ost.str()));