GuiInfo::GuiInfo(GuiView & lv)
- : InsetDialog(lv, INFO_CODE, "info", qt_("Info"))
+ : InsetDialog(lv, INFO_CODE, LFUN_INFO_INSERT, "info", "Info")
{
setupUi(this);
}
-void GuiInfo::on_newPB_clicked()
-{
- // FIXME: if we used a standard LFUN_INSET_INSERT command,
- // This slot could be transferred to InsetDialog.
- docstring const argument = dialogToParams();
- dispatch(FuncRequest(LFUN_INFO_INSERT, argument));
-}
-
-
void GuiInfo::on_typeCO_currentIndexChanged(int)
{
applyView();
//@}
private Q_SLOTS:
- void on_newPB_clicked();
void on_typeCO_currentIndexChanged(int);
void on_nameLE_textChanged(QString const &);
/////////////////////////////////////////////////////////////////\r
\r
\r
-InsetDialog::InsetDialog(GuiView & lv, InsetCode code,\r
- QString const & name, QString const & title)\r
- : DialogView(lv, name, title), code_(code)\r
+InsetDialog::InsetDialog(GuiView & lv, InsetCode code, FuncCode creation_code,\r
+ char const * name, char const * display_name)\r
+ : DialogView(lv, name, qt_(display_name)), inset_code_(code),\r
+ creation_code_(creation_code)\r
{\r
}\r
\r
}\r
\r
\r
+void InsetDialog::on_newPB_clicked()\r
+{\r
+ docstring const argument = dialogToParams();\r
+ dispatch(FuncRequest(creation_code_, argument));\r
+}\r
+\r
+\r
void InsetDialog::applyView()\r
{\r
- Inset const * i = inset(code_);\r
+ Inset const * i = inset(inset_code_);\r
if (!i)\r
return;\r
\r
\r
void InsetDialog::updateView()\r
{\r
- Inset const * i = inset(code_);\r
+ Inset const * i = inset(inset_code_);\r
if (i)\r
paramsToDialog(i);\r
else\r
\r
#include "DialogView.h"\r
\r
+#include "qt_i18n.h"\r
+\r
namespace lyx {\r
\r
class Inset;\r
\r
namespace frontend {\r
\r
+\r
class InsetDialog : public DialogView\r
{\r
Q_OBJECT\r
\r
public:\r
- InsetDialog(GuiView & lv, InsetCode code, \r
- QString const & name, QString const & title);\r
+ InsetDialog(GuiView & lv, InsetCode code, FuncCode creation_code,\r
+ char const * name, char const * display_name);\r
\r
/// \name DialogView inherited methods\r
//@{\r
//@}\r
\r
protected Q_SLOTS:\r
+ void on_newPB_clicked();\r
void on_closePB_clicked();\r
\r
protected:\r
virtual void paramsToDialog(Inset const *) = 0;\r
///\r
virtual docstring dialogToParams() const = 0;\r
+\r
+private:\r
+ ///\r
+ InsetCode inset_code_;\r
///\r
- InsetCode const code_;\r
+ FuncCode creation_code_;\r
};\r
\r
} // namespace frontend\r