]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlLog.C
ff00b6cf5622b23a71b339ba86543cf92b876818
[lyx.git] / src / frontends / controllers / ControlLog.C
1 /* This file is part of
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file ControlLog.h
11  * \author John Levon, moz@compsoc.man.ac.uk
12  * \author Angus Leeming <a.leeming@ic.ac.uk>
13  */
14
15 #ifdef __GNUG__
16 #pragma implementation
17 #endif
18
19 #include <config.h>
20 #include "ButtonController.h"
21 #include "ControlLog.h"
22 #include "LyXView.h"
23 #include "Dialogs.h"
24 #include "lyxrc.h"
25 #include "ViewBase.h"
26
27 using std::make_pair;
28 using SigC::slot;
29
30 ControlLog::ControlLog(LyXView & lv, Dialogs & d)
31         : ControlConnectBD(lv, d)
32 {
33         d_.showLogFile.connect(slot(this, &ControlLog::show));
34 }
35
36
37 void ControlLog::show()
38 {
39         if (!lv_.view()->available())
40                 return;
41
42         logfile_ = lv_.view()->buffer()->getLogName();
43
44         bc().readOnly(isReadonly());
45         view().show();
46 }
47
48
49 void ControlLog::update()
50 {
51         if (!lv_.view()->available())
52                 return;
53
54         logfile_ = lv_.view()->buffer()->getLogName();
55         
56         bc().readOnly(isReadonly());
57         view().update();
58 }
59
60
61 void ControlLog::hide()
62 {
63         logfile_.second.erase();
64         disconnect();
65         view().hide();
66 }