]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormLog.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormLog.C
index 4baadfc0cef3a8f61da93b41c69abe0ba8ee9c17..bcbf7ffb38c93b9c2c2f75a3d204e606bc6e8d9d 100644 (file)
@@ -1,56 +1,36 @@
-/* FormLog.C
- * (C) 2001 LyX Team
- * John Levon, moz@compsoc.man.ac.uk
+/**
+ * \file FormLog.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#include FORMS_H_LOCATION
+#include "FormLog.h"
+#include "ControlLog.h"
+#include "forms/form_browser.h"
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include "support/std_sstream.h"
 
-#include "gettext.h" 
-#include "FormLog.h"
-#include "form_browser.h"
-#include "LyXView.h"
-#include "Dialogs.h"
-#include "lyxrc.h"
-#include "buffer.h"
+#include "lyx_forms.h"
 
-using SigC::slot;
 
-FormLog::FormLog(LyXView * lv, Dialogs * d)
-       : FormBrowser(lv, d, _("LaTeX Log"))
-{
-       // let the dialog be shown
-       // This is a permanent connection so we won't bother
-       // storing a copy because we won't be disconnecting.
-       d->showLogFile.connect(slot(this, &FormLog::show));
-}
+FormLog::FormLog(Dialog & parent)
+       : FormController<ControlLog, FormBrowser>(parent, "")
+{}
 
 
 void FormLog::update()
 {
-       if (!dialog_.get() || !lv_->view()->available())
-               return;
-       std::pair<Buffer::LogType, string> const logfile
-               = lv_->view()->buffer()->getLogName();
+       setTitle(controller().title());
 
-       fl_clear_browser(dialog_->browser);
+       std::ostringstream ss;
+       controller().getContents(ss);
 
-       if (logfile.first == Buffer::buildlog) {
-               fl_set_form_title(dialog_->form, _("Build log"));
-               if (!fl_load_browser(dialog_->browser, logfile.second.c_str()))
-                       fl_add_browser_line(dialog_->browser,
-                                           _("No build log file found"));
-               return;
-       }
-
-       fl_set_form_title(dialog_->form, _("LaTeX Log"));
-       if (!fl_load_browser(dialog_->browser, logfile.second.c_str()))
-               fl_add_browser_line(dialog_->browser,
-                                   _("No LaTeX log file found"));
+       fl_clear_browser(dialog_->browser);
+       fl_add_browser_line(dialog_->browser, ss.str().c_str());
 }