3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
14 #include "ControlTexinfo.h"
15 #include "QTexinfoDialog.h"
18 #include "qt_helpers.h"
19 #include "helper_funcs.h"
21 #include "support/filetools.h"
22 #include "support/lstrings.h"
25 #include <qpushbutton.h>
26 #include <qcheckbox.h>
28 using namespace lyx::support;
32 typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
35 QTexinfo::QTexinfo(Dialog & parent)
36 : base_class(parent, _("LyX: LaTeX Information")),
37 warningPosted(false), activeStyle(ControlTexinfo::cls)
42 void QTexinfo::build_dialog()
44 dialog_.reset(new QTexinfoDialog(this));
46 updateStyles(ControlTexinfo::cls);
48 bcview().setCancel(dialog_->closePB);
52 void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
54 ContentsType & data = texdata_[whichStyle];
55 getTexFileList(whichStyle, data);
57 bool const withFullPath = dialog_->path->isChecked();
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));
67 activeStyle = whichStyle;
71 void QTexinfo::updateStyles()
73 updateStyles(activeStyle);