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