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"
|
|
|
|
|
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)
|
|
|
|
{
|
2002-07-23 13:12:55 +00:00
|
|
|
string const fstr = controller().getContents(whichStyle, true);
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-07-23 13:12:55 +00:00
|
|
|
switch (whichStyle) {
|
2002-10-20 01:48:28 +00:00
|
|
|
case ControlTexinfo::bst:
|
2002-07-23 13:12:55 +00:00
|
|
|
bst_ = getVectorFromString(fstr, "\n");
|
|
|
|
break;
|
|
|
|
case ControlTexinfo::cls:
|
|
|
|
cls_ = getVectorFromString(fstr, "\n");
|
|
|
|
break;
|
|
|
|
case ControlTexinfo::sty:
|
|
|
|
sty_ = getVectorFromString(fstr, "\n");
|
|
|
|
break;
|
|
|
|
}
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
dialog_->fileList->clear();
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-07-23 13:12:55 +00:00
|
|
|
bool const withFullPath = dialog_->path->isChecked();
|
|
|
|
string const str = controller().getContents(whichStyle, withFullPath);
|
|
|
|
vector<string> flist = getVectorFromString(str, "\n");
|
2002-01-19 13:48:05 +00:00
|
|
|
for (vector<string>::const_iterator fitem = flist.begin();
|
|
|
|
fitem != flist.end(); ++fitem) {
|
2002-12-17 20:37:13 +00:00
|
|
|
dialog_->fileList->insertItem(toqstr((*fitem)));
|
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);
|
|
|
|
}
|