2001-08-27 01:19:32 +00:00
|
|
|
/**
|
|
|
|
* \file QExternalDialog.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.
|
2001-08-27 01:19:32 +00:00
|
|
|
*
|
2002-10-20 01:48:28 +00:00
|
|
|
* \author John Levon
|
2002-09-24 13:57:09 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-08-27 01:19:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-12-17 20:37:13 +00:00
|
|
|
#include "qt_helpers.h"
|
2002-06-19 03:38:44 +00:00
|
|
|
#include "ControlExternal.h"
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qfiledialog.h>
|
|
|
|
#include <qtextview.h>
|
2002-03-21 21:21:28 +00:00
|
|
|
#include <qlineedit.h>
|
2003-06-04 09:16:29 +00:00
|
|
|
#include <qvalidator.h>
|
2001-08-27 01:19:32 +00:00
|
|
|
|
|
|
|
#include "QExternalDialog.h"
|
|
|
|
#include "QExternal.h"
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
QExternalDialog::QExternalDialog(QExternal * form)
|
|
|
|
: QExternalDialogBase(0, 0, false, 0),
|
|
|
|
form_(form)
|
|
|
|
{
|
|
|
|
connect(okPB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotOK()));
|
2003-03-06 05:52:13 +00:00
|
|
|
connect(applyPB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotApply()));
|
2001-08-27 01:19:32 +00:00
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotClose()));
|
2003-06-04 09:16:29 +00:00
|
|
|
|
|
|
|
QIntValidator * validator = new QIntValidator(displayscale);
|
|
|
|
validator->setBottom(1);
|
|
|
|
displayscale->setValidator(validator);
|
2001-08-27 01:19:32 +00:00
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-09-11 17:42:45 +00:00
|
|
|
void QExternalDialog::show()
|
|
|
|
{
|
|
|
|
QExternalDialogBase::show();
|
|
|
|
fileED->setFocus();
|
|
|
|
}
|
|
|
|
|
2002-10-20 01:48: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_->controller().editExternal();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 01:19:32 +00:00
|
|
|
void QExternalDialog::browseClicked()
|
|
|
|
{
|
2002-10-20 01:48:28 +00:00
|
|
|
QString file =
|
|
|
|
QFileDialog::getOpenFileName(QString::null,
|
2002-12-17 20:37:13 +00:00
|
|
|
qt_("External material (*)"),
|
2002-10-20 01:48:28 +00:00
|
|
|
this, 0,
|
2002-12-17 20:37:13 +00:00
|
|
|
qt_("Select external material"));
|
2001-08-27 20:41:45 +00:00
|
|
|
if (!file.isNull()) {
|
2002-12-17 20:37:13 +00:00
|
|
|
fileED->setText(file);
|
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()
|
|
|
|
{
|
2002-12-17 20:37:13 +00:00
|
|
|
externalTV->setText(toqstr(form_->helpText()));
|
2001-08-27 01:19:32 +00:00
|
|
|
form_->changed();
|
|
|
|
}
|