2002-01-19 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* \file QTexinfo.C
|
|
|
|
* Copyright 2002 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven <leuven@fee.uva.nl>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#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-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-07-11 01:01:38 +00:00
|
|
|
QTexinfo::QTexinfo(ControlTexinfo & c, Dialogs &)
|
2002-01-19 13:48:05 +00:00
|
|
|
: base_class(c, _("LaTeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls)
|
|
|
|
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
bool const withFullPath = dialog_->path->isChecked();
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
string const str = controller().getContents(whichStyle, withFullPath);
|
2002-04-16 22:37:46 +00:00
|
|
|
std::vector<string> flist = getVectorFromString(str, "\n");
|
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-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);
|
|
|
|
}
|