X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiInfo.cpp;h=8994b9431e8fdb54fbe41fafb3b325a5356a2c1b;hb=1f10969bb5c5f36017bf5ba8671381b09945cf57;hp=89ebfd298b63efc8299c15aa8861ce63b2cc47f8;hpb=db19378bbe185f9bcbc3e67f63fa9434e18b0a7c;p=lyx.git diff --git a/src/frontends/qt4/GuiInfo.cpp b/src/frontends/qt4/GuiInfo.cpp index 89ebfd298b..8994b9431e 100644 --- a/src/frontends/qt4/GuiInfo.cpp +++ b/src/frontends/qt4/GuiInfo.cpp @@ -19,11 +19,11 @@ #include "BufferParams.h" #include "BufferView.h" #include "Cursor.h" -#include "FuncRequest.h" #include "insets/InsetInfo.h" #include "support/debug.h" +#include "support/gettext.h" #include "support/lstrings.h" @@ -40,15 +40,14 @@ namespace frontend { ///////////////////////////////////////////////////////////////// char const * info_types[] = -{ "unknown", "shortcut", "shortcuts", "lyxrc", "package", "textclass", "menu", "icon", "buffer", "" }; +{ "unknown", "shortcut", "shortcuts", "lyxrc", "package", "textclass", "menu", "icon", "buffer", "lyxinfo", "" }; char const * info_types_gui[] = { N_("unknown"), N_("shortcut"), N_("shortcuts"), N_("lyxrc"), N_("package"), N_("textclass"), - N_("menu"), N_("icon"), N_("buffer"), ""}; + N_("menu"), N_("icon"), N_("buffer"), N_("lyxinfo"), ""}; -GuiInfo::GuiInfo(GuiView & lv) - : InsetDialog(lv, INFO_CODE, LFUN_INFO_INSERT, "info", "Info") +GuiInfo::GuiInfo(QWidget * parent) : InsetParamsWidget(parent) { setupUi(this); @@ -56,18 +55,9 @@ GuiInfo::GuiInfo(GuiView & lv) for (int n = 0; info_types[n][0]; ++n) typeCO->addItem(qt_(info_types_gui[n])); typeCO->blockSignals(false); -} - -void GuiInfo::on_typeCO_currentIndexChanged(int) -{ - applyView(); -} - - -void GuiInfo::on_nameLE_textChanged(QString const &) -{ - applyView(); + connect(typeCO, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); + connect(nameLE, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); } @@ -100,17 +90,16 @@ docstring GuiInfo::dialogToParams() const } -void GuiInfo::enableView(bool enable) +bool GuiInfo::checkWidgets(bool readonly) const { - typeCO->setEnabled(enable); - nameLE->setEnabled(enable); - newPB->setEnabled(!enable); + nameLE->setReadOnly(readonly); + typeCO->setEnabled(!readonly); + if (!InsetParamsWidget::checkWidgets()) + return false; + return !nameLE->text().isEmpty(); } -Dialog * createGuiInfo(GuiView & lv) { return new GuiInfo(lv); } - - } // namespace frontend } // namespace lyx