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.
15 #include "support/debug.h"
16 #include "qt_helpers.h"
19 #include <QPushButton>
27 /////////////////////////////////////////////////////////////////
29 // Base implementation
31 /////////////////////////////////////////////////////////////////
33 GuiLabel::GuiLabel(GuiView & lv)
34 : GuiCommand(lv, "label", qt_("Label"))
38 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
39 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
40 connect(keywordED, SIGNAL(textChanged(const QString &)),
41 this, SLOT(change_adaptor()));
43 setFocusProxy(keywordED);
45 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
47 bc().setCancel(closePB);
48 bc().addReadOnly(keywordED);
52 void GuiLabel::change_adaptor()
58 void GuiLabel::reject()
64 void GuiLabel::updateContents()
66 docstring const contents = params_["name"];
67 keywordED->setText(toqstr(contents));
68 bc().setValid(!contents.empty());
72 void GuiLabel::applyView()
74 params_["name"] = qstring_to_ucs4(keywordED->text());
78 bool GuiLabel::isValid()
80 return !keywordED->text().isEmpty();
84 Dialog * createGuiLabel(GuiView & lv) { return new GuiLabel(lv); }
87 } // namespace frontend
90 #include "GuiLabel_moc.cpp"