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
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-01-19 13:48:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "ControlTexinfo.h"
|
|
|
|
#include "QTexinfoDialog.h"
|
|
|
|
#include "QTexinfo.h"
|
|
|
|
#include "Qt2BC.h"
|
2002-12-17 20:37:13 +00:00
|
|
|
#include "qt_helpers.h"
|
2002-01-19 13:48:05 +00:00
|
|
|
#include "helper_funcs.h"
|
|
|
|
|
2003-06-20 14:03:49 +00:00
|
|
|
#include "support/filetools.h"
|
2002-04-16 22:37:46 +00:00
|
|
|
#include "support/lstrings.h"
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
#include <qlistbox.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qcheckbox.h>
|
|
|
|
|
2002-01-25 19:34:22 +00:00
|
|
|
using std::vector;
|
|
|
|
|
2003-06-19 17:16:12 +00:00
|
|
|
typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2003-06-19 17:16:12 +00:00
|
|
|
QTexinfo::QTexinfo(Dialog & parent)
|
|
|
|
: base_class(parent, _("LyX: LaTeX 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];
|
|
|
|
getTexFileList(whichStyle, data);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-07-23 13:12:55 +00:00
|
|
|
bool const withFullPath = dialog_->path->isChecked();
|
2003-06-20 14:03:49 +00:00
|
|
|
|
|
|
|
dialog_->fileList->clear();
|
|
|
|
ContentsType::const_iterator it = data.begin();
|
|
|
|
ContentsType::const_iterator end = data.end();
|
|
|
|
for (; it != end; ++it) {
|
|
|
|
string const line = withFullPath ? *it : OnlyFilename(*it);
|
|
|
|
dialog_->fileList->insertItem(toqstr(line));
|
2002-01-19 13:48:05 +00:00
|
|
|
}
|
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);
|
|
|
|
}
|