]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QVCLog.C
use boost::format
[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 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "Lsstream.h"
18 #include "gettext.h"
19 #include "LyXView.h"
20 #include "ControlVCLog.h"
21
22 #include "QVCLog.h"
23 #include "QVCLogDialog.h"
24 #include "Qt2BC.h"
25
26 #include <qtextview.h>
27 #include <qpushbutton.h>
28
29 #include "BoostFormat.h"
30
31 typedef Qt2CB<ControlVCLog, Qt2DB<QVCLogDialog> > base_class;
32
33
34 QVCLog::QVCLog()
35         : base_class(_("VCLog"))
36 {
37 }
38
39
40 void QVCLog::build_dialog()
41 {
42         dialog_.reset(new QVCLogDialog(this));
43
44         bc().setCancel(dialog_->closePB);
45 }
46
47
48 void QVCLog::update_contents()
49 {
50         dialog_->setCaption(boost::io::str(boost::format(_("Version control log for %1$s")) % controller().getBufferFileName()).c_str());
51
52         dialog_->vclogTV->setText("");
53
54         ostringstream ss;
55         controller().getVCLogFile(ss);
56
57         dialog_->vclogTV->setText(ss.str().c_str());
58 }