2001-08-28 01:27:35 +00:00
|
|
|
/**
|
|
|
|
* \file QIncludeDialog.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-28 01:27:35 +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-28 01:27:35 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2004-05-20 09:36:28 +00:00
|
|
|
#include "QIncludeDialog.h"
|
|
|
|
#include "QInclude.h"
|
2005-05-16 09:14:18 +00:00
|
|
|
#include "validators.h"
|
2004-05-20 09:36:28 +00:00
|
|
|
|
2001-08-28 01:27:35 +00:00
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qcheckbox.h>
|
2002-09-11 17:42:45 +00:00
|
|
|
#include <qlineedit.h>
|
2001-08-28 01:27:35 +00:00
|
|
|
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2001-08-28 01:27:35 +00:00
|
|
|
QIncludeDialog::QIncludeDialog(QInclude * form)
|
2004-06-02 20:13:18 +00:00
|
|
|
: QIncludeDialogBase(0, 0, false, 0),
|
2001-08-28 01:27:35 +00:00
|
|
|
form_(form)
|
|
|
|
{
|
|
|
|
connect(okPB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotOK()));
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotClose()));
|
2005-05-16 09:14:18 +00:00
|
|
|
|
|
|
|
filenameED->setValidator(new PathValidator(true, filenameED));
|
2001-08-28 01:27:35 +00:00
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-09-11 17:42:45 +00:00
|
|
|
void QIncludeDialog::show()
|
|
|
|
{
|
|
|
|
QIncludeDialogBase::show();
|
|
|
|
filenameED->setFocus();
|
2002-10-20 01:48:28 +00:00
|
|
|
}
|
|
|
|
|
2002-09-11 17:42:45 +00:00
|
|
|
|
2001-08-28 01:27:35 +00:00
|
|
|
void QIncludeDialog::change_adaptor()
|
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-28 01:27:35 +00:00
|
|
|
void QIncludeDialog::closeEvent(QCloseEvent * e)
|
|
|
|
{
|
|
|
|
form_->slotWMHide();
|
|
|
|
e->accept();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QIncludeDialog::typeChanged(int v)
|
|
|
|
{
|
|
|
|
switch (v) {
|
|
|
|
case 0:
|
2002-12-03 05:27:19 +00:00
|
|
|
visiblespaceCB->setEnabled(false);
|
|
|
|
visiblespaceCB->setChecked(false);
|
|
|
|
previewCB->setEnabled(true);
|
|
|
|
break;
|
|
|
|
|
2001-08-28 01:27:35 +00:00
|
|
|
case 1:
|
|
|
|
visiblespaceCB->setEnabled(false);
|
|
|
|
visiblespaceCB->setChecked(false);
|
2002-12-03 05:27:19 +00:00
|
|
|
previewCB->setEnabled(false);
|
|
|
|
previewCB->setChecked(false);
|
2001-08-28 01:27:35 +00:00
|
|
|
break;
|
2003-02-25 13:35:26 +00:00
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
default:
|
2001-08-28 01:27:35 +00:00
|
|
|
visiblespaceCB->setEnabled(true);
|
2002-12-03 05:27:19 +00:00
|
|
|
previewCB->setEnabled(false);
|
|
|
|
previewCB->setChecked(false);
|
2001-08-28 01:27:35 +00:00
|
|
|
break;
|
2002-03-21 21:21:28 +00:00
|
|
|
}
|
2001-08-28 01:27:35 +00:00
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-28 01:27:35 +00:00
|
|
|
void QIncludeDialog::loadClicked()
|
|
|
|
{
|
|
|
|
form_->load();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-28 01:27:35 +00:00
|
|
|
void QIncludeDialog::browseClicked()
|
|
|
|
{
|
|
|
|
form_->browse();
|
|
|
|
}
|
2004-05-19 15:11:37 +00:00
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|