]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlLog.C
5e0a7a41e886ca569f24ff3de7538d86644a92ff
[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 "ControlLog.h"
21 #include "LyXView.h"
22 #include "Dialogs.h"
23 #include "lyxrc.h"
24
25 using std::make_pair;
26 using SigC::slot;
27
28 ControlLog::ControlLog(LyXView & lv, Dialogs & d)
29         : ControlConnectBD(lv, d)
30 {
31         d_.showLogFile.connect(slot(this, &ControlLog::show));
32 }
33
34
35 void ControlLog::show()
36 {
37         if (!lv_.view()->available())
38                 return;
39
40         logfile_ = lv_.view()->buffer()->getLogName();
41
42         bc().readOnly(isReadonly());
43         view().show();
44 }
45
46
47 void ControlLog::update()
48 {
49         if (!lv_.view()->available())
50                 return;
51
52         logfile_ = lv_.view()->buffer()->getLogName();
53         
54         bc().readOnly(isReadonly());
55         view().update();
56 }
57
58
59 void ControlLog::hide()
60 {
61         logfile_.second.erase();
62         disconnect();
63         view().hide();
64 }