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 "ControlCommand.h"
15 #include "qt_helpers.h"
17 #include "QIndexDialog.h"
20 #include "ButtonController.h"
22 #include <qlineedit.h>
23 #include <qpushbutton.h>
30 typedef QController<ControlCommand, QView<QIndexDialog> > index_base_class;
33 QIndex::QIndex(Dialog & parent, docstring const & title, QString const & label)
34 : index_base_class(parent, title), label_(label)
39 void QIndex::build_dialog()
41 dialog_.reset(new QIndexDialog(this));
43 dialog_->keywordLA->setText(label_);
45 bcview().setOK(dialog_->okPB);
46 bcview().setCancel(dialog_->closePB);
47 bcview().addReadOnly(dialog_->keywordED);
51 void QIndex::update_contents()
53 docstring const contents = controller().params()["name"];
54 dialog_->keywordED->setText(toqstr(contents));
56 bc().valid(!contents.empty());
62 controller().params()["name"] = qstring_to_ucs4(dialog_->keywordED->text());
66 bool QIndex::isValid()
68 return !dialog_->keywordED->text().isEmpty();
71 } // namespace frontend