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>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "ControlTexinfo.h"
|
|
|
|
#include "QTexinfoDialog.h"
|
|
|
|
#include "QTexinfo.h"
|
|
|
|
#include "Qt2BC.h"
|
|
|
|
#include "gettext.h"
|
|
|
|
#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;
|
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
typedef Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> > base_class;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-08-12 14:28:43 +00:00
|
|
|
QTexinfo::QTexinfo()
|
|
|
|
: base_class(_("LaTeX Information")), 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);
|
|
|
|
|
|
|
|
bc().setCancel(dialog_->closePB);
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
dialog_->fileList->insertItem((*fitem).c_str());
|
|
|
|
}
|
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);
|
|
|
|
}
|