2002-01-19 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* \file QTexinfoDialog.C
|
|
|
|
* Copyright 2002 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven <leuven@fee.uva.nl>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <vector>
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
#include <qlistbox.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qcombobox.h>
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTexinfoDialog::rescanClicked()
|
|
|
|
{
|
|
|
|
// build new *Files.lst
|
|
|
|
form_->controller().rescanStyles();
|
|
|
|
form_->updateStyles();
|
2002-07-23 13:12:55 +00:00
|
|
|
enableViewPB();
|
2002-01-19 13:48:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTexinfoDialog::viewClicked()
|
|
|
|
{
|
2002-07-23 13:12:55 +00:00
|
|
|
int const fitem = fileList->currentItem();
|
|
|
|
|
|
|
|
string sel;
|
|
|
|
switch (whatStyle->currentItem()) {
|
|
|
|
case 0:
|
|
|
|
sel = form_->cls_[fitem];
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
sel = form_->sty_[fitem];
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
sel = form_->bst_[fitem];
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2002-01-19 13:48:05 +00:00
|
|
|
// a valid entry?
|
|
|
|
if (!sel.empty()) {
|
|
|
|
form_->controller().viewFile(sel.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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-07-23 13:12:55 +00:00
|
|
|
|
|
|
|
enableViewPB();
|
|
|
|
}
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-07-23 13:12:55 +00:00
|
|
|
void QTexinfoDialog::enableViewPB()
|
|
|
|
{
|
|
|
|
viewPB->setEnabled(fileList->currentItem()>-1);
|
2002-01-19 13:48:05 +00:00
|
|
|
}
|
2002-07-23 13:12:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|