]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormLog.C
Compile fixes for DEC cxx, John's maths and keymap patches.
[lyx.git] / src / frontends / xforms / FormLog.C
1 /* FormLog.C
2  * (C) 2001 LyX Team
3  * John Levon, moz@compsoc.man.ac.uk
4  */
5
6 #include <config.h>
7
8 #include FORMS_H_LOCATION
9
10 #ifdef __GNUG__
11 #pragma implementation
12 #endif
13
14 #include "gettext.h" 
15 #include "FormLog.h"
16 #include "form_browser.h"
17 #include "LyXView.h"
18 #include "Dialogs.h"
19 #include "lyxrc.h"
20 #include "buffer.h"
21
22 using SigC::slot;
23
24 FormLog::FormLog(LyXView * lv, Dialogs * d)
25         : FormBrowser(lv, d, _("LaTeX Log"))
26 {
27         // let the dialog be shown
28         // This is a permanent connection so we won't bother
29         // storing a copy because we won't be disconnecting.
30         d->showLogFile.connect(slot(this, &FormLog::show));
31 }
32
33
34 void FormLog::update()
35 {
36         if (!dialog_.get() || !lv_->view()->available())
37                 return;
38  
39         std::pair<Buffer::LogType, string> const logfile
40                 = lv_->view()->buffer()->getLogName();
41
42         fl_clear_browser(dialog_->browser);
43
44         if (logfile.first == Buffer::buildlog) {
45                 fl_set_form_title(dialog_->form, _("Build log"));
46                 if (!fl_load_browser(dialog_->browser, logfile.second.c_str()))
47                         fl_add_browser_line(dialog_->browser,
48                                             _("No build log file found"));
49                 return;
50         }
51
52         fl_set_form_title(dialog_->form, _("LaTeX Log"));
53         if (!fl_load_browser(dialog_->browser, logfile.second.c_str()))
54                 fl_add_browser_line(dialog_->browser,
55                                     _("No LaTeX log file found"));
56 }