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