2002-01-19 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* \file QTexinfoDialog.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>
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
#include "LString.h"
|
|
|
|
|
|
|
|
#include "ControlTexinfo.h"
|
2002-01-19 13:48:05 +00:00
|
|
|
#include "QTexinfoDialog.h"
|
|
|
|
#include "QTexinfo.h"
|
2002-12-17 20:37:13 +00:00
|
|
|
#include "qt_helpers.h"
|
2002-01-19 13:48:05 +00:00
|
|
|
|
|
|
|
#include <qlistbox.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qcombobox.h>
|
|
|
|
|
2003-06-20 14:03:49 +00:00
|
|
|
using std::vector;
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
QTexinfoDialog::QTexinfoDialog(QTexinfo * form)
|
|
|
|
: QTexinfoDialogBase(0, 0, false, 0),
|
|
|
|
form_(form)
|
|
|
|
{
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotClose()));
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
void QTexinfoDialog::change_adaptor()
|
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
void QTexinfoDialog::closeEvent(QCloseEvent * e)
|
|
|
|
{
|
|
|
|
form_->slotWMHide();
|
|
|
|
e->accept();
|
|
|
|
}
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
void QTexinfoDialog::rescanClicked()
|
|
|
|
{
|
|
|
|
// build new *Files.lst
|
2003-06-20 14:03:49 +00:00
|
|
|
rescanTexStyles();
|
2002-01-19 13:48:05 +00:00
|
|
|
form_->updateStyles();
|
2002-07-23 13:12:55 +00:00
|
|
|
enableViewPB();
|
2002-01-19 13:48:05 +00:00
|
|
|
}
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
void QTexinfoDialog::viewClicked()
|
|
|
|
{
|
2003-06-20 14:03:49 +00:00
|
|
|
vector<string>::size_type const fitem = fileList->currentItem();
|
|
|
|
vector<string> const & data = form_->texdata_[form_->activeStyle];
|
|
|
|
form_->controller().viewFile(data[fitem]);
|
2002-01-19 13:48:05 +00:00
|
|
|
}
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
void QTexinfoDialog::update()
|
|
|
|
{
|
2002-07-23 13:12:55 +00:00
|
|
|
switch (whatStyle->currentItem()) {
|
2002-01-19 13:48:05 +00:00
|
|
|
case 0:
|
|
|
|
form_->updateStyles(ControlTexinfo::cls);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
form_->updateStyles(ControlTexinfo::sty);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
form_->updateStyles(ControlTexinfo::bst);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-07-23 13:12:55 +00:00
|
|
|
enableViewPB();
|
|
|
|
}
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-07-23 13:12:55 +00:00
|
|
|
void QTexinfoDialog::enableViewPB()
|
|
|
|
{
|
2002-10-20 01:48:28 +00:00
|
|
|
viewPB->setEnabled(fileList->currentItem() > -1);
|
2002-01-19 13:48:05 +00:00
|
|
|
}
|