2002-01-19 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* \file QTexinfo.C
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-01-19 13:48:05 +00:00
|
|
|
*
|
2002-10-20 01:48:28 +00:00
|
|
|
* \author Edwin Leuven
|
2002-09-24 13:57:09 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-01-19 13:48:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "QTexinfo.h"
|
2004-05-20 09:36:28 +00:00
|
|
|
#include "QTexinfoDialog.h"
|
2002-01-19 13:48:05 +00:00
|
|
|
#include "Qt2BC.h"
|
2002-12-17 20:37:13 +00:00
|
|
|
#include "qt_helpers.h"
|
2002-01-19 13:48:05 +00:00
|
|
|
|
2003-06-20 14:03:49 +00:00
|
|
|
#include "support/filetools.h"
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2004-05-20 09:36:28 +00:00
|
|
|
#include <qcheckbox.h>
|
2002-01-19 13:48:05 +00:00
|
|
|
#include <qlistbox.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
|
2006-04-08 22:31:11 +00:00
|
|
|
using lyx::support::onlyFilename;
|
2003-06-30 23:56:22 +00:00
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
using std::string;
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
2002-01-25 19:34:22 +00:00
|
|
|
|
2003-06-19 17:16:12 +00:00
|
|
|
typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2003-06-19 17:16:12 +00:00
|
|
|
QTexinfo::QTexinfo(Dialog & parent)
|
2006-09-09 15:27:44 +00:00
|
|
|
: base_class(parent, lyx::to_utf8(_("TeX Information"))),
|
2003-02-16 05:08:14 +00:00
|
|
|
warningPosted(false), activeStyle(ControlTexinfo::cls)
|
2002-01-19 13:48:05 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTexinfo::build_dialog()
|
|
|
|
{
|
|
|
|
dialog_.reset(new QTexinfoDialog(this));
|
|
|
|
|
|
|
|
updateStyles(ControlTexinfo::cls);
|
|
|
|
|
2003-03-10 03:13:28 +00:00
|
|
|
bcview().setCancel(dialog_->closePB);
|
2002-01-19 13:48:05 +00:00
|
|
|
}
|
|
|
|
|
2002-01-25 17:46:18 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
|
|
|
|
{
|
2003-06-20 14:03:49 +00:00
|
|
|
ContentsType & data = texdata_[whichStyle];
|
2002-07-23 13:12:55 +00:00
|
|
|
bool const withFullPath = dialog_->path->isChecked();
|
2003-06-20 14:03:49 +00:00
|
|
|
|
2005-07-27 17:46:15 +00:00
|
|
|
getTexFileList(whichStyle, data, withFullPath);
|
|
|
|
|
2003-06-20 14:03:49 +00:00
|
|
|
dialog_->fileList->clear();
|
|
|
|
ContentsType::const_iterator it = data.begin();
|
|
|
|
ContentsType::const_iterator end = data.end();
|
2005-07-27 17:46:15 +00:00
|
|
|
for (; it != end; ++it)
|
|
|
|
dialog_->fileList->insertItem(toqstr(*it));
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
activeStyle = whichStyle;
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
void QTexinfo::updateStyles()
|
|
|
|
{
|
|
|
|
updateStyles(activeStyle);
|
|
|
|
}
|
2004-05-19 15:11:37 +00:00
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|