3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
13 #include "FormVCLog.h"
16 #include "support/lstrings.h"
25 FormVCLog::FormVCLog(LyXView *v, Dialogs *d)
26 : dialog_(0), lv_(v), d_(d), h_(0), u_(0)
28 d->showVCLogFile.connect(slot(this, &FormVCLog::show));
32 FormVCLog::~FormVCLog()
38 void FormVCLog::update()
44 void FormVCLog::supdate(bool)
46 const string logfile = lv_->view()->buffer()->lyxvc.getLogFile();
48 dialog_->setCaption(string(_("Version control log for ") + lv_->view()->buffer()->fileName()).c_str());
50 dialog_->setLogText("");
52 ifstream ifstr(logfile.c_str());
54 dialog_->setLogText(_("No version control log file found"));
62 while (getline(ifstr, line))
65 dialog_->setLogText(text);
71 void FormVCLog::show()
74 dialog_ = new LogDialog(this, 0, _("LyX: Version Control Log"));
76 if (!dialog_->isVisible()) {
77 h_ = d_->hideBufferDependent.connect(slot(this, &FormVCLog::hide));
78 u_ = d_->updateBufferDependent.connect(slot(this, &FormVCLog::supdate));
82 dialog_->setActiveWindow();
89 void FormVCLog::close()
96 void FormVCLog::hide()