*
* \author John Levon
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "LyXView.h"
+#include "QLog.h"
+#include "QLogDialog.h"
#include "qt_helpers.h"
-#include "ControlLog.h"
-#include "Lsstream.h"
-#include <qtextview.h>
-#include <qpushbutton.h>
+#include "controllers/ControlLog.h"
-#include "QLogDialog.h"
-#include "QLog.h"
-#include "Qt2BC.h"
+#include <sstream>
-#include <fstream>
+#include <qtextview.h>
+#include <qpushbutton.h>
-using std::ifstream;
-using std::getline;
+namespace lyx {
+namespace frontend {
-typedef Qt2CB<ControlLog, Qt2DB<QLogDialog> > base_class;
+typedef QController<ControlLog, QView<QLogDialog> > base_class;
-QLog::QLog()
- : base_class(qt_("Log"))
-{
-}
+QLog::QLog(Dialog & parent)
+ : base_class(parent, "")
+{}
void QLog::build_dialog()
{
dialog_.reset(new QLogDialog(this));
-
- bc().setCancel(dialog_->closePB);
}
void QLog::update_contents()
{
- std::pair<Buffer::LogType, string> const & logfile =
- controller().logfile();
+ setTitle(controller().title());
- if (logfile.first == Buffer::buildlog)
- dialog_->setCaption(qt_("Build log"));
- else
- dialog_->setCaption(qt_("LaTeX log"));
+ std::ostringstream ss;
+ controller().getContents(ss);
- dialog_->logTV->setText("");
-
- ifstream ifstr(logfile.second.c_str());
- if (!ifstr) {
- if (logfile.first == Buffer::buildlog)
- dialog_->logTV->setText(qt_("No build log file found."));
- else
- dialog_->logTV->setText(qt_("No LaTeX log file found."));
- return;
- }
-
- ostringstream ost;
- ost << ifstr.rdbuf();
-
- dialog_->logTV->setText(toqstr(ost.str()));
+ dialog_->logTV->setText(toqstr(ss.str()));
}
+
+} // namespace frontend
+} // namespace lyx