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 #pragma implementation
17 #include "ControlIndex.h"
18 #include "qt_helpers.h"
20 #include "QIndexDialog.h"
23 #include <qlineedit.h>
24 #include <qpushbutton.h>
26 typedef Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > base_class;
30 : base_class(qt_("Index"))
35 void QIndex::build_dialog()
37 dialog_.reset(new QIndexDialog(this));
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();