]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QVCLog.C
Joao latest bits
[lyx.git] / src / frontends / qt2 / QVCLog.C
1 /**
2  * \file QVCLog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "debug.h"
14 #include "support/std_sstream.h"
15 #include "qt_helpers.h"
16 #include "support/lstrings.h"
17 #include "ControlVCLog.h"
18
19 #include "QVCLog.h"
20 #include "QVCLogDialog.h"
21 #include "Qt2BC.h"
22
23 #include <qtextview.h>
24 #include <qpushbutton.h>
25
26 using lyx::support::bformat;
27
28 using std::ostringstream;
29
30
31 typedef QController<ControlVCLog, QView<QVCLogDialog> > base_class;
32
33 QVCLog::QVCLog(Dialog & parent)
34         : base_class(parent, _("LyX: Version Control Log"))
35 {
36 }
37
38
39 void QVCLog::build_dialog()
40 {
41         dialog_.reset(new QVCLogDialog(this));
42
43         bcview().setCancel(dialog_->closePB);
44 }
45
46
47 void QVCLog::update_contents()
48 {
49         setTitle(bformat(_("Version control log for %1$s"),
50                          controller().getBufferFileName()));
51
52         dialog_->vclogTV->setText("");
53
54         ostringstream ss;
55         controller().getVCLogFile(ss);
56
57         dialog_->vclogTV->setText(toqstr(ss.str()));
58 }