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 "qt_helpers.h"
18 #include "ButtonController.h"
21 #include <QPushButton>
23 #include <QCloseEvent>
28 /////////////////////////////////////////////////////////////////////
32 /////////////////////////////////////////////////////////////////////
37 GuiIndexDialog::GuiIndexDialog(GuiIndex * form)
42 connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
43 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
44 connect(keywordED, SIGNAL(textChanged(const QString &)),
45 this, SLOT(change_adaptor()));
47 setFocusProxy(keywordED);
49 keywordED->setWhatsThis( qt_(
50 "The format of the entry in the index.\n"
52 "An entry can be specified as a sub-entry of\n"
53 "another with \"!\":\n"
57 "You can cross-refer to another entry like so:\n"
59 "cars!mileage|see{economy}\n"
61 "For further details refer to the local LaTeX\n"
67 void GuiIndexDialog::change_adaptor()
73 void GuiIndexDialog::reject()
79 void GuiIndexDialog::closeEvent(QCloseEvent * e)
86 /////////////////////////////////////////////////////////////////////
90 /////////////////////////////////////////////////////////////////////
93 GuiIndex::GuiIndex(Dialog & parent, docstring const & title, QString const & label)
94 : GuiView<GuiIndexDialog>(parent, title), label_(label)
99 void GuiIndex::build_dialog()
101 dialog_.reset(new GuiIndexDialog(this));
103 dialog_->keywordLA->setText(label_);
105 bcview().setOK(dialog_->okPB);
106 bcview().setCancel(dialog_->closePB);
107 bcview().addReadOnly(dialog_->keywordED);
111 void GuiIndex::update_contents()
113 docstring const contents = controller().params()["name"];
114 dialog_->keywordED->setText(toqstr(contents));
116 bc().valid(!contents.empty());
120 void GuiIndex::apply()
122 controller().params()["name"] = qstring_to_ucs4(dialog_->keywordED->text());
126 bool GuiIndex::isValid()
128 return !dialog_->keywordED->text().isEmpty();
131 } // namespace frontend
134 #include "GuiIndex_moc.cpp"