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 "insets/InsetLabel.h"
20 #include <QPushButton>
28 /////////////////////////////////////////////////////////////////
32 /////////////////////////////////////////////////////////////////
34 GuiLabel::GuiLabel(QWidget * parent) : InsetParamsWidget(parent)
38 connect(keywordED, SIGNAL(textChanged(const QString &)),
39 this, SIGNAL(changed()));
41 setFocusProxy(keywordED);
45 void GuiLabel::paramsToDialog(Inset const * inset)
47 InsetLabel const * label = static_cast<InsetLabel const *>(inset);
48 InsetCommandParams const & params = label->params();
49 paramsToDialog(params);
53 void GuiLabel::paramsToDialog(InsetCommandParams const & params)
55 keywordED->setText(toqstr(params["name"]));
59 docstring GuiLabel::dialogToParams() const
61 InsetCommandParams params(insetCode());
62 params["name"] = qstring_to_ucs4(keywordED->text());
63 return from_ascii(InsetLabel::params2string(params));
67 bool GuiLabel::checkWidgets() const
69 if (!InsetParamsWidget::checkWidgets())
71 return !keywordED->text().isEmpty();
74 } // namespace frontend
77 #include "moc_GuiLabel.cpp"