]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormLog.C
fix crash with "save as"
[lyx.git] / src / frontends / xforms / FormLog.C
1 /**
2  * \file FormLog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "xformsBC.h"
18 #include "ControlLog.h"
19 #include "FormLog.h"
20 #include "forms/form_browser.h"
21 #include "gettext.h"
22 #include FORMS_H_LOCATION
23
24 FormLog::FormLog()
25         : FormCB<ControlLog, FormBrowser>( _("LaTeX Log"))
26 {}
27
28
29 void FormLog::update()
30 {
31         bool const buildlog = controller().logfile().first == Buffer::buildlog;
32
33         string const title = buildlog ?
34                 _("LyX: LaTeX Log") :
35                 _("LyX: Literate Programming Build Log");
36         fl_set_form_title(dialog_->form, title.c_str());
37
38         fl_clear_browser(dialog_->browser);
39         int const valid = fl_load_browser(dialog_->browser,
40                                           controller().logfile().second.c_str());
41         if (!valid) {
42                 string const error = buildlog ?
43                         _("No LaTeX log file found.") :
44                         _("No Literate Programming build log file found.");
45                 fl_add_browser_line(dialog_->browser, error.c_str());
46         }
47 }