]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormVCLog.C
0fd056768cd1705f51e9a6a8ddc036ec43eca0e9
[lyx.git] / src / frontends / xforms / FormVCLog.C
1 /* FormVCLog.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 "FormVCLog.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 FormVCLog::FormVCLog(LyXView * lv, Dialogs * d)
25         : FormBrowser(lv, d, _("Version Control 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->showVCLogFile.connect(slot(this, &FormVCLog::show));
31 }
32
33
34 void FormVCLog::update()
35 {
36         if (!dialog_.get() || !lv_->view()->available())
37                 return;
38  
39         const string logfile = lv_->view()->buffer()->lyxvc.getLogFile();
40
41         fl_clear_browser(dialog_->browser);
42
43         if (logfile=="" || !fl_load_browser(dialog_->browser, logfile.c_str()))
44                 fl_add_browser_line(dialog_->browser, _("No version control log file available"));
45
46         lyx::unlink(logfile); 
47 }