]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QTexinfo.C
This new citation dialog follows a new design similar to lyx-1.3:
[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.h>
21 #include <q3listbox.h>
22 #include <qpushbutton.h>
23
24 using lyx::support::OnlyFilename;
25
26 using std::string;
27
28 namespace lyx {
29 namespace frontend {
30
31 typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
32
33 QTexinfo::QTexinfo(Dialog & parent)
34         : base_class(parent, _("TeX Information")),
35           warningPosted(false), activeStyle(ControlTexinfo::cls)
36 {
37 }
38
39
40 void QTexinfo::build_dialog()
41 {
42         dialog_.reset(new QTexinfoDialog(this));
43
44         updateStyles(ControlTexinfo::cls);
45
46         bcview().setCancel(dialog_->closePB);
47 }
48
49
50 void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
51 {
52         ContentsType & data = texdata_[whichStyle];
53         bool const withFullPath = dialog_->path->isChecked();
54
55         getTexFileList(whichStyle, data, withFullPath);
56
57         dialog_->fileList->clear();
58         ContentsType::const_iterator it  = data.begin();
59         ContentsType::const_iterator end = data.end();
60         for (; it != end; ++it)
61                 dialog_->fileList->insertItem(toqstr(*it));
62
63         activeStyle = whichStyle;
64 }
65
66
67 void QTexinfo::updateStyles()
68 {
69         updateStyles(activeStyle);
70 }
71
72 } // namespace frontend
73 } // namespace lyx