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"
20 #include <qlineedit.h>
21 #include <qpushbutton.h>
23 typedef Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > base_class;
27 : base_class(qt_("LyX: Insert Index Entry"))
32 void QIndex::build_dialog()
34 dialog_.reset(new QIndexDialog(this));
36 bc().setOK(dialog_->okPB);
37 bc().setCancel(dialog_->closePB);
38 bc().addReadOnly(dialog_->keywordED);
42 void QIndex::update_contents()
44 string const contents = controller().params().getContents();
45 dialog_->keywordED->setText(toqstr(contents));
47 bc().valid(!contents.empty());
53 controller().params().setContents(fromqstr(dialog_->keywordED->text()));
57 bool QIndex::isValid()
59 return !dialog_->keywordED->text().isEmpty();