]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QTexinfo.C
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / 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 "debug.h"
14 #include "QTexinfoDialog.h"
15 #include "QTexinfo.h"
16 #include "Qt2BC.h"
17 #include "qt_helpers.h"
18
19 #include "support/filetools.h"
20
21 #include <qlistbox.h>
22 #include <qpushbutton.h>
23 #include <qcheckbox.h>
24
25 using lyx::support::OnlyFilename;
26
27 using std::string;
28
29
30 typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
31
32 QTexinfo::QTexinfo(Dialog & parent)
33         : base_class(parent, _("LyX: LaTeX Information")),
34           warningPosted(false), activeStyle(ControlTexinfo::cls)
35 {
36 }
37
38
39 void QTexinfo::build_dialog()
40 {
41         dialog_.reset(new QTexinfoDialog(this));
42
43         updateStyles(ControlTexinfo::cls);
44
45         bcview().setCancel(dialog_->closePB);
46 }
47
48
49 void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
50 {
51         ContentsType & data = texdata_[whichStyle];
52         getTexFileList(whichStyle, data);
53
54         bool const withFullPath = dialog_->path->isChecked();
55
56         dialog_->fileList->clear();
57         ContentsType::const_iterator it  = data.begin();
58         ContentsType::const_iterator end = data.end();
59         for (; it != end; ++it) {
60                 string const line = withFullPath ? *it : OnlyFilename(*it);
61                 dialog_->fileList->insertItem(toqstr(line));
62         }
63
64         activeStyle = whichStyle;
65 }
66
67
68 void QTexinfo::updateStyles()
69 {
70         updateStyles(activeStyle);
71 }