From 40d9c6ec48cfa221e2f56e47da74dfb2ec40cd69 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 26 Aug 2016 11:35:12 +0200 Subject: [PATCH] Implement proper dialog titles in InsetParamsDialogs Fixes: #10329 --- src/frontends/qt4/FloatPlacement.h | 1 + src/frontends/qt4/GuiBibitem.h | 1 + src/frontends/qt4/GuiBox.h | 1 + src/frontends/qt4/GuiBranch.h | 1 + src/frontends/qt4/GuiERT.h | 1 + src/frontends/qt4/GuiHSpace.h | 1 + src/frontends/qt4/GuiHyperlink.h | 1 + src/frontends/qt4/GuiInfo.h | 1 + src/frontends/qt4/GuiLabel.h | 1 + src/frontends/qt4/GuiLine.h | 1 + src/frontends/qt4/GuiNomenclature.h | 1 + src/frontends/qt4/GuiTabular.h | 1 + src/frontends/qt4/GuiVSpace.h | 1 + src/frontends/qt4/InsetParamsDialog.cpp | 2 +- src/frontends/qt4/InsetParamsWidget.h | 5 +++++ 15 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/FloatPlacement.h b/src/frontends/qt4/FloatPlacement.h index 01ddb2ca40..c5f8dd7ef1 100644 --- a/src/frontends/qt4/FloatPlacement.h +++ b/src/frontends/qt4/FloatPlacement.h @@ -35,6 +35,7 @@ public: //@{ InsetCode insetCode() const { return FLOAT_CODE; } FuncCode creationCode() const { return LFUN_FLOAT_INSERT; } + QString dialogTitle() const { return qt_("Float Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiBibitem.h b/src/frontends/qt4/GuiBibitem.h index 17d901c1ff..d96d7c1fd7 100644 --- a/src/frontends/qt4/GuiBibitem.h +++ b/src/frontends/qt4/GuiBibitem.h @@ -33,6 +33,7 @@ private: //@{ InsetCode insetCode() const { return BIBITEM_CODE; } FuncCode creationCode() const { return LFUN_INSET_INSERT; } + QString dialogTitle() const { return qt_("Bibliography Item Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiBox.h b/src/frontends/qt4/GuiBox.h index 955335037f..4c32dcf8fa 100644 --- a/src/frontends/qt4/GuiBox.h +++ b/src/frontends/qt4/GuiBox.h @@ -41,6 +41,7 @@ private: //@{ InsetCode insetCode() const { return BOX_CODE; } FuncCode creationCode() const { return LFUN_BOX_INSERT; } + QString dialogTitle() const { return qt_("Box Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiBranch.h b/src/frontends/qt4/GuiBranch.h index 326839758b..69aaa81052 100644 --- a/src/frontends/qt4/GuiBranch.h +++ b/src/frontends/qt4/GuiBranch.h @@ -32,6 +32,7 @@ private: //@{ InsetCode insetCode() const { return BRANCH_CODE; } FuncCode creationCode() const { return LFUN_BRANCH_INSERT; } + QString dialogTitle() const { return qt_("Branch Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiERT.h b/src/frontends/qt4/GuiERT.h index 35ca85c332..cc4caefbaf 100644 --- a/src/frontends/qt4/GuiERT.h +++ b/src/frontends/qt4/GuiERT.h @@ -30,6 +30,7 @@ private: //@{ InsetCode insetCode() const { return ERT_CODE; } FuncCode creationCode() const { return LFUN_INSET_INSERT; } + QString dialogTitle() const { return qt_("TeX Mode Inset Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiHSpace.h b/src/frontends/qt4/GuiHSpace.h index 5b09d7a5d0..9be11ab689 100644 --- a/src/frontends/qt4/GuiHSpace.h +++ b/src/frontends/qt4/GuiHSpace.h @@ -36,6 +36,7 @@ private: //@{ InsetCode insetCode() const { return math_mode_ ? MATH_SPACE_CODE : SPACE_CODE; } FuncCode creationCode() const { return LFUN_INSET_INSERT; } + QString dialogTitle() const { return qt_("Horizontal Space Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiHyperlink.h b/src/frontends/qt4/GuiHyperlink.h index 4e31964268..3f24fce848 100644 --- a/src/frontends/qt4/GuiHyperlink.h +++ b/src/frontends/qt4/GuiHyperlink.h @@ -32,6 +32,7 @@ private: //@{ InsetCode insetCode() const { return HYPERLINK_CODE; } FuncCode creationCode() const { return LFUN_INSET_INSERT; } + QString dialogTitle() const { return qt_("Hyperlink Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiInfo.h b/src/frontends/qt4/GuiInfo.h index 2fecdbed7f..f0ebfc474c 100644 --- a/src/frontends/qt4/GuiInfo.h +++ b/src/frontends/qt4/GuiInfo.h @@ -33,6 +33,7 @@ private: //@{ InsetCode insetCode() const { return INFO_CODE; } FuncCode creationCode() const { return LFUN_INFO_INSERT; } + QString dialogTitle() const { return qt_("Info Inset Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiLabel.h b/src/frontends/qt4/GuiLabel.h index 0b7afd21f8..261f145a5e 100644 --- a/src/frontends/qt4/GuiLabel.h +++ b/src/frontends/qt4/GuiLabel.h @@ -32,6 +32,7 @@ private: //@{ InsetCode insetCode() const { return LABEL_CODE; } FuncCode creationCode() const { return LFUN_INSET_INSERT; } + QString dialogTitle() const { return qt_("Label Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiLine.h b/src/frontends/qt4/GuiLine.h index a1fded8ecc..076d5444b1 100644 --- a/src/frontends/qt4/GuiLine.h +++ b/src/frontends/qt4/GuiLine.h @@ -31,6 +31,7 @@ private: //@{ InsetCode insetCode() const { return LINE_CODE; } FuncCode creationCode() const { return LFUN_INSET_INSERT; } + QString dialogTitle() const { return qt_("Line Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiNomenclature.h b/src/frontends/qt4/GuiNomenclature.h index 7e4c7f5c18..30fb2c846f 100644 --- a/src/frontends/qt4/GuiNomenclature.h +++ b/src/frontends/qt4/GuiNomenclature.h @@ -33,6 +33,7 @@ private: //@{ InsetCode insetCode() const { return NOMENCL_CODE; } FuncCode creationCode() const { return LFUN_INSET_INSERT; } + QString dialogTitle() const { return qt_("Nomenclature Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiTabular.h b/src/frontends/qt4/GuiTabular.h index c19e066ddb..20f7681780 100644 --- a/src/frontends/qt4/GuiTabular.h +++ b/src/frontends/qt4/GuiTabular.h @@ -42,6 +42,7 @@ private: //@{ InsetCode insetCode() const { return TABULAR_CODE; } FuncCode creationCode() const { return LFUN_TABULAR_INSERT; } + QString dialogTitle() const { return qt_("Tabular Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/GuiVSpace.h b/src/frontends/qt4/GuiVSpace.h index f26d40e763..36b4fecffa 100644 --- a/src/frontends/qt4/GuiVSpace.h +++ b/src/frontends/qt4/GuiVSpace.h @@ -37,6 +37,7 @@ private: //@{ InsetCode insetCode() const { return VSPACE_CODE; } FuncCode creationCode() const { return LFUN_INSET_INSERT; } + QString dialogTitle() const { return qt_("Vertical Space Settings"); } void paramsToDialog(Inset const *); docstring dialogToParams() const; bool checkWidgets(bool readonly) const; diff --git a/src/frontends/qt4/InsetParamsDialog.cpp b/src/frontends/qt4/InsetParamsDialog.cpp index 81652af61a..44f49b5a44 100644 --- a/src/frontends/qt4/InsetParamsDialog.cpp +++ b/src/frontends/qt4/InsetParamsDialog.cpp @@ -74,7 +74,7 @@ struct InsetParamsDialog::Private InsetParamsDialog::InsetParamsDialog(GuiView & lv, InsetParamsWidget * widget) : DialogView(lv, toqstr(insetName(widget->insetCode())), - toqstr(insetName(widget->insetCode()))), d(new Private) + widget->dialogTitle()), d(new Private) { setupUi(this); setInsetParamsWidget(widget); diff --git a/src/frontends/qt4/InsetParamsWidget.h b/src/frontends/qt4/InsetParamsWidget.h index a5316454d2..96f90d1801 100644 --- a/src/frontends/qt4/InsetParamsWidget.h +++ b/src/frontends/qt4/InsetParamsWidget.h @@ -13,6 +13,9 @@ #define INSET_PARAMS_WIDGET_H #include "insets/InsetCode.h" +#include "insets/Inset.h" + +#include "qt_helpers.h" #include "FuncCode.h" @@ -58,6 +61,8 @@ public: /// This is a base class; destructor must exist and be virtual. virtual ~InsetParamsWidget() {} /// + virtual QString dialogTitle() const { return toqstr(insetName(insetCode())); } + /// virtual InsetCode insetCode() const = 0; /// virtual FuncCode creationCode() const = 0;