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 "QTexinfoDialog.h"
17 #include "qt_helpers.h"
19 #include "support/filetools.h"
22 #include <qpushbutton.h>
23 #include <qcheckbox.h>
25 using lyx::support::OnlyFilename;
30 typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
32 QTexinfo::QTexinfo(Dialog & parent)
33 : base_class(parent, _("LyX: LaTeX Information")),
34 warningPosted(false), activeStyle(ControlTexinfo::cls)
39 void QTexinfo::build_dialog()
41 dialog_.reset(new QTexinfoDialog(this));
43 updateStyles(ControlTexinfo::cls);
45 bcview().setCancel(dialog_->closePB);
49 void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
51 ContentsType & data = texdata_[whichStyle];
52 getTexFileList(whichStyle, data);
54 bool const withFullPath = dialog_->path->isChecked();
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));
64 activeStyle = whichStyle;
68 void QTexinfo::updateStyles()
70 updateStyles(activeStyle);