2001-08-19 13:25:15 +00:00
|
|
|
/**
|
|
|
|
* \file QIndex.C
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author John Levon <moz@compsoc.man.ac.uk>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "QIndexDialog.h"
|
2001-08-25 03:00:19 +00:00
|
|
|
#include "ControlIndex.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
#include "QIndex.h"
|
2001-08-26 00:29:39 +00:00
|
|
|
#include "Qt2BC.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
#include "gettext.h"
|
|
|
|
|
|
|
|
#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
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
QIndex::QIndex(ControlIndex & c)
|
|
|
|
: base_class(c, _("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()
|
|
|
|
{
|
|
|
|
return !string(dialog_->keywordED->text()).empty();
|
|
|
|
}
|