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 "qt_helpers.h"
17 #include "support/debug.h"
20 #include <QPushButton>
28 /////////////////////////////////////////////////////////////////
30 // Base implementation
32 /////////////////////////////////////////////////////////////////
34 GuiLabel::GuiLabel(GuiView & lv)
35 : GuiCommand(lv, "label", qt_("Label"))
39 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
40 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
41 connect(keywordED, SIGNAL(textChanged(const QString &)),
42 this, SLOT(change_adaptor()));
44 setFocusProxy(keywordED);
46 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
48 bc().setCancel(closePB);
49 bc().addReadOnly(keywordED);
53 void GuiLabel::change_adaptor()
59 void GuiLabel::reject()
65 void GuiLabel::updateContents()
67 docstring const contents = params_["name"];
68 keywordED->setText(toqstr(contents));
69 bc().setValid(!contents.empty());
73 void GuiLabel::applyView()
75 params_["name"] = qstring_to_ucs4(keywordED->text());
79 bool GuiLabel::isValid()
81 return !keywordED->text().isEmpty();
85 Dialog * createGuiLabel(GuiView & lv) { return new GuiLabel(lv); }
88 } // namespace frontend
91 #include "GuiLabel_moc.cpp"