2001-08-19 13:25:15 +00:00
|
|
|
/**
|
|
|
|
* \file QIndex.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-19 13:25:15 +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-19 13:25:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
2001-08-25 03:00:19 +00:00
|
|
|
#include "ControlIndex.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
#include "gettext.h"
|
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
#include "QIndexDialog.h"
|
|
|
|
#include "QIndex.h"
|
|
|
|
#include "Qt2BC.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
#include <qlineedit.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
typedef Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > base_class;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-08-12 14:28:43 +00:00
|
|
|
QIndex::QIndex()
|
|
|
|
: base_class(_("Index"))
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
void QIndex::build_dialog()
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
2001-08-21 01:14:54 +00:00
|
|
|
dialog_.reset(new QIndexDialog(this));
|
2001-08-19 13:25:15 +00:00
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
bc().setOK(dialog_->okPB);
|
2001-08-25 03:00:19 +00:00
|
|
|
bc().setCancel(dialog_->closePB);
|
2001-08-21 01:14:54 +00:00
|
|
|
bc().addReadOnly(dialog_->keywordED);
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-25 20:04:15 +00:00
|
|
|
void QIndex::update_contents()
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
2001-12-05 18:32:49 +00:00
|
|
|
dialog_->keywordED->setText(controller().params().getContents().c_str());
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
void QIndex::apply()
|
|
|
|
{
|
2001-12-05 18:32:49 +00:00
|
|
|
controller().params().setContents(dialog_->keywordED->text().latin1());
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
2001-08-25 20:04:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
bool QIndex::isValid()
|
|
|
|
{
|
2002-11-30 02:09:16 +00:00
|
|
|
return !dialog_->keywordED->text().isEmpty();
|
2001-08-25 20:04:15 +00:00
|
|
|
}
|