From 022a231f3e31230754094c811fce7c79fcacff36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Sat, 8 Sep 2007 22:08:46 +0000 Subject: [PATCH] fix some index/label issue git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20162 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiDocument.cpp | 2 +- src/frontends/qt4/GuiIndex.cpp | 52 +++++++++++++++++++++++++++++-- src/frontends/qt4/GuiIndex.h | 11 +++---- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 3382cfe712..5416079e6b 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -838,7 +838,7 @@ void GuiDocumentDialog::updatePagestyle(string const & items, string const & sel toqstr(pagestyles[i].second)); if (nn > 0) - pageLayoutModule->pagestyleCO->setCurrentIndex(n); + pageLayoutModule->pagestyleCO->setCurrentIndex(nn); } diff --git a/src/frontends/qt4/GuiIndex.cpp b/src/frontends/qt4/GuiIndex.cpp index 2fcbbe5711..0607c3e917 100644 --- a/src/frontends/qt4/GuiIndex.cpp +++ b/src/frontends/qt4/GuiIndex.cpp @@ -28,14 +28,20 @@ using std::string; namespace lyx { namespace frontend { +///////////////////////////////////////////////////////////////// +// +// Base implementation +// +///////////////////////////////////////////////////////////////// + GuiIndexDialogBase::GuiIndexDialogBase(LyXView & lv, - docstring const & title, QString const & label) - : GuiDialog(lv, "index") + docstring const & title, QString const & label, std::string const & name) + : GuiDialog(lv, name) { label_ = label; setupUi(this); setViewTitle(title); - setController(new ControlCommand(*this, "index", "index")); + setController(new ControlCommand(*this, name, name)); connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); @@ -113,6 +119,46 @@ bool GuiIndexDialogBase::isValid() return !keywordED->text().isEmpty(); } + +///////////////////////////////////////////////////////////////// +// +// Index Dialog +// +///////////////////////////////////////////////////////////////// + + +GuiIndexDialog::GuiIndexDialog(LyXView & lv) + : GuiIndexDialogBase(lv, _("Index Entry"), qt_("&Keyword:"), "index") +{ + keywordED->setWhatsThis( qt_( + "The format of the entry in the index.\n" + "\n" + "An entry can be specified as a sub-entry of\n" + "another with \"!\":\n" + "\n" + "cars!mileage\n" + "\n" + "You can cross-refer to another entry like so:\n" + "\n" + "cars!mileage|see{economy}\n" + "\n" + "For further details refer to the local LaTeX\n" + "documentation.\n") + ); +} + + +///////////////////////////////////////////////////////////////// +// +// Label Dialog +// +///////////////////////////////////////////////////////////////// + +GuiLabelDialog::GuiLabelDialog(LyXView & lv) + : GuiIndexDialogBase(lv, _("Label"), qt_("&Label:"), "label") +{} + + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiIndex.h b/src/frontends/qt4/GuiIndex.h index bbfb4ebbd5..e6c8445f5a 100644 --- a/src/frontends/qt4/GuiIndex.h +++ b/src/frontends/qt4/GuiIndex.h @@ -26,7 +26,7 @@ class GuiIndexDialogBase : public GuiDialog, public Ui::IndexUi public: GuiIndexDialogBase(LyXView & lv, docstring const & title, - QString const & label); + QString const & label, std::string const & name); private Q_SLOTS: void change_adaptor(); @@ -52,20 +52,17 @@ private: class GuiIndexDialog : public GuiIndexDialogBase { public: - GuiIndexDialog(LyXView & lv) - : GuiIndexDialogBase(lv, _("Index Entry"), qt_("&Keyword:")) - {} + GuiIndexDialog(LyXView & lv); }; class GuiLabelDialog : public GuiIndexDialogBase { public: - GuiLabelDialog(LyXView & lv) - : GuiIndexDialogBase(lv, _("Label"), qt_("&Label:")) - {} + GuiLabelDialog(LyXView & lv); }; + } // namespace frontend } // namespace lyx -- 2.39.2