3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
14 #include "ControlIndex.h"
15 #include "qt_helpers.h"
17 #include "QIndexDialog.h"
21 #include <qlineedit.h>
22 #include <qpushbutton.h>
24 typedef QController<ControlCommand, QView<QIndexDialog> > base_class;
27 QIndex::QIndex(Dialog & parent, QString const & title, QString const & label)
28 : base_class(parent, title), label_(label)
33 void QIndex::build_dialog()
35 dialog_.reset(new QIndexDialog(this));
37 dialog_->keywordLA->setText(label_);
39 bc().setOK(dialog_->okPB);
40 bc().setCancel(dialog_->closePB);
41 bc().addReadOnly(dialog_->keywordED);
45 void QIndex::update_contents()
47 string const contents = controller().params().getContents();
48 dialog_->keywordED->setText(toqstr(contents));
50 bc().valid(!contents.empty());
56 controller().params().setContents(fromqstr(dialog_->keywordED->text()));
60 bool QIndex::isValid()
62 return !dialog_->keywordED->text().isEmpty();