2001-08-27 01:19:32 +00:00
|
|
|
/**
|
|
|
|
* \file QExternalDialog.C
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author John Levon <moz@compsoc.man.ac.uk>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
#include "gettext.h"
|
|
|
|
#include "ControlExternal.h"
|
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
#include <qwidget.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qfiledialog.h>
|
|
|
|
#include <qcombobox.h>
|
|
|
|
#include <qtextview.h>
|
2002-03-21 21:21:28 +00:00
|
|
|
#include <qlineedit.h>
|
2001-08-27 01:19:32 +00:00
|
|
|
|
|
|
|
#include "QExternalDialog.h"
|
|
|
|
#include "QExternal.h"
|
|
|
|
|
|
|
|
QExternalDialog::QExternalDialog(QExternal * form)
|
|
|
|
: QExternalDialogBase(0, 0, false, 0),
|
|
|
|
form_(form)
|
|
|
|
{
|
|
|
|
connect(okPB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotOK()));
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotClose()));
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
void QExternalDialog::change_adaptor()
|
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
void QExternalDialog::closeEvent(QCloseEvent * e)
|
|
|
|
{
|
|
|
|
form_->slotWMHide();
|
|
|
|
e->accept();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
void QExternalDialog::editClicked()
|
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
form_->controller().editExternal();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
void QExternalDialog::viewClicked()
|
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
form_->controller().viewExternal();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
void QExternalDialog::updateClicked()
|
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
form_->controller().updateExternal();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
void QExternalDialog::browseClicked()
|
|
|
|
{
|
2002-03-21 21:21:28 +00:00
|
|
|
QString file = QFileDialog::getOpenFileName(QString::null,
|
|
|
|
_("External material (*)"), this, 0, _("Select external material"));
|
2001-08-27 20:41:45 +00:00
|
|
|
if (!file.isNull()) {
|
|
|
|
fileED->setText(file.latin1());
|
2001-08-27 01:19:32 +00:00
|
|
|
form_->changed();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
void QExternalDialog::templateChanged()
|
|
|
|
{
|
|
|
|
externalTV->setText(form_->helpText().c_str());
|
|
|
|
|
|
|
|
updatePB->setEnabled(!form_->controller().params().templ.automaticProduction);
|
|
|
|
form_->changed();
|
|
|
|
}
|