/**
* \file FormLog.C
- * Copyright 2001 The LyX Team.
- * See the file COPYING.
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * \author John Levon, moz@compsoc.man.ac.uk
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "xformsBC.h"
-#include "ControlLog.h"
#include "FormLog.h"
+#include "ControlLog.h"
#include "forms/form_browser.h"
-#include "gettext.h"
-#include FORMS_H_LOCATION
-FormLog::FormLog(ControlLog & c)
- : FormCB<ControlLog, FormBrowser>(c, _("LaTeX Log"))
+#include "xformsBC.h"
+
+#include "lyx_forms.h"
+
+
+using std::string;
+
+
+FormLog::FormLog(Dialog & parent)
+ : FormController<ControlLog, FormBrowser>(parent, _("LaTeX Log"))
{}
void FormLog::update()
{
- fl_clear_browser(dialog_->browser);
+ bool const buildlog = controller().logfile().first == Buffer::buildlog;
- if (controller().logfile().first == Buffer::buildlog) {
- fl_set_form_title(dialog_->form, _("Build log"));
- if (!fl_load_browser(dialog_->browser,
- controller().logfile().second.c_str()))
- fl_add_browser_line(dialog_->browser,
- _("No build log file found"));
- return;
- }
+ string const title = buildlog ?
+ _("LyX: LaTeX Log") :
+ _("LyX: Literate Programming Build Log");
+ setTitle(title);
- fl_set_form_title(dialog_->form, _("LaTeX Log"));
- if (!fl_load_browser(dialog_->browser,
- controller().logfile().second.c_str()))
- fl_add_browser_line(dialog_->browser,
- _("No LaTeX log file found"));
+ fl_clear_browser(dialog_->browser);
+ int const valid = fl_load_browser(dialog_->browser,
+ controller().logfile().second.c_str());
+ if (!valid) {
+ string const error = buildlog ?
+ _("No LaTeX log file found.") :
+ _("No Literate Programming build log file found.");
+ fl_add_browser_line(dialog_->browser, error.c_str());
+ }
}