]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormLog.C
try this for distinguishing inner and outer tabs
[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 #ifdef SIGC_CXX_NAMESPACES
23 using SigC::slot;
24 #endif
25
26 FormLog::FormLog(LyXView * lv, Dialogs * d)
27         : FormBrowser(lv, d, _("LaTeX Log"))
28 {
29         // let the dialog be shown
30         // This is a permanent connection so we won't bother
31         // storing a copy because we won't be disconnecting.
32         d->showLogFile.connect(slot(this, &FormLog::show));
33 }
34
35 FormLog::~FormLog()
36 {
37 }
38
39 void FormLog::update()
40 {
41         if (!dialog_ || !lv_->view()->available())
42                 return;
43  
44         std::pair<Buffer::LogType, string> const logfile
45                 = lv_->view()->buffer()->getLogName();
46
47         fl_clear_browser(dialog_->browser);
48
49         if (logfile.first == Buffer::buildlog) {
50                 fl_set_form_title(dialog_->form, _("Build log"));
51                 if (!fl_load_browser(dialog_->browser, logfile.second.c_str()))
52                         fl_add_browser_line(dialog_->browser,
53                                             _("No build log file found"));
54                 return;
55         }
56
57         fl_set_form_title(dialog_->form, _("LaTeX Log"));
58         if (!fl_load_browser(dialog_->browser, logfile.second.c_str()))
59                 fl_add_browser_line(dialog_->browser,
60                                     _("No LaTeX log file found"));
61 }