]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QTexinfo.C
Fix unreported bug related to 3246 by Richard Heck:
[lyx.git] / src / frontends / qt4 / QTexinfo.C
1 /**
2  * \file QTexinfo.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "QTexinfo.h"
14 #include "QTexinfoDialog.h"
15 #include "Qt2BC.h"
16 #include "qt_helpers.h"
17
18 #include "support/filetools.h"
19
20 #include <QCheckBox>
21 #include <QListWidget>
22 #include <QPushButton>
23
24 using std::string;
25
26 namespace lyx {
27 namespace frontend {
28
29 typedef QController<ControlTexinfo, QView<QTexinfoDialog> > texinfo_base_class;
30
31 QTexinfo::QTexinfo(Dialog & parent)
32         : texinfo_base_class(parent, _("TeX Information")),
33           warningPosted(false), activeStyle(ControlTexinfo::cls)
34 {
35 }
36
37
38 void QTexinfo::build_dialog()
39 {
40         dialog_.reset(new QTexinfoDialog(this));
41
42         updateStyles(ControlTexinfo::cls);
43
44         bcview().setCancel(dialog_->closePB);
45 }
46
47
48 void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
49 {
50         ContentsType & data = texdata_[whichStyle];
51         bool const withFullPath = dialog_->pathCB->isChecked();
52
53         getTexFileList(whichStyle, data, withFullPath);
54
55         dialog_->fileListLW->clear();
56         ContentsType::const_iterator it  = data.begin();
57         ContentsType::const_iterator end = data.end();
58         for (; it != end; ++it)
59                 dialog_->fileListLW->addItem(toqstr(*it));
60
61         activeStyle = whichStyle;
62 }
63
64
65 void QTexinfo::updateStyles()
66 {
67         updateStyles(activeStyle);
68 }
69
70 } // namespace frontend
71 } // namespace lyx