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
|
|
|
*
|
|
|
|
* 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
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
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 <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"
|
|
|
|
|
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()));
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotClose()));
|
|
|
|
}
|
|
|
|
|
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_->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-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
|
|
|
|
|
|
|
updatePB->setEnabled(!form_->controller().params().templ.automaticProduction);
|
|
|
|
form_->changed();
|
|
|
|
}
|