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.
14 #include "qt_helpers.h"
15 #include "ControlLog.h"
16 #include "support/std_sstream.h"
18 #include <qtextview.h>
19 #include <qpushbutton.h>
21 #include "QLogDialog.h"
28 using std::ostringstream;
31 typedef QController<ControlLog, QView<QLogDialog> > base_class;
33 QLog::QLog(Dialog & parent)
34 : base_class(parent, _("LyX: LaTeX Log"))
39 void QLog::build_dialog()
41 dialog_.reset(new QLogDialog(this));
43 bcview().setCancel(dialog_->closePB);
47 void QLog::update_contents()
49 std::pair<Buffer::LogType, string> const & logfile =
50 controller().logfile();
52 if (logfile.first == Buffer::buildlog)
53 setTitle(_("Build log"));
55 setTitle(_("LaTeX log"));
57 dialog_->logTV->setText("");
59 ifstream ifstr(logfile.second.c_str());
61 if (logfile.first == Buffer::buildlog)
62 dialog_->logTV->setText(qt_("No build log file found."));
64 dialog_->logTV->setText(qt_("No LaTeX log file found."));
71 dialog_->logTV->setText(toqstr(ost.str()));