]> git.lyx.org Git - features.git/commitdiff
Add citations to Navigator.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 4 Mar 2008 17:47:47 +0000 (17:47 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 4 Mar 2008 17:47:47 +0000 (17:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23458 a592a061-630c-0410-9148-cb99ea01b6c8

src/MenuBackend.cpp
src/frontends/qt4/GuiToc.cpp
src/insets/InsetCitation.cpp
src/insets/InsetCitation.h

index df4de67b54a86b341a9bea3ce5eeef6577cc6321..de7172f5d0bfa8436591fc56391729786c231207 100644 (file)
@@ -780,6 +780,8 @@ void expandToc(Menu & tomenu, Buffer const * buf)
                        label = _("List of Foot notes");
                else if (cit->first == "label")
                        label = _("Labels and References");
+               else if (cit->first == "citation")
+                       label = _("List of Citations");
                // this should not happen now, but if something else like
                // listings is added later, this can avoid an empty menu name.
                else
index 40233e83f4c77aec2d67bc9a1c7eb0505b22cadc..43485fa320c1c66494eb14b799a3a63ecc560146 100644 (file)
@@ -233,6 +233,8 @@ docstring GuiToc::guiName(string const & type) const
                return _("List of Marginal notes");
        if (type == "note")
                return _("List of Notes");
+       if (type == "citation")
+               return _("List of Citations");
        if (type == "label")
                return _("Labels and References");
 
index 8407f997ba3198ba2060bd34747e66bd5eb94392..917b8fd8f499d394e369614b089c7e17aa06bbb7 100644 (file)
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "DispatchResult.h"
-#include "support/gettext.h"
 #include "EmbeddedFiles.h"
 #include "FuncRequest.h"
 #include "LaTeXFeatures.h"
+#include "ParIterator.h"
+#include "TocBackend.h"
 
 #include "support/debug.h"
 #include "support/docstream.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 
 #include <algorithm>
@@ -425,10 +427,16 @@ docstring InsetCitation::generateLabel() const
 
 
 docstring InsetCitation::screenLabel() const
+{
+       return cache.screen_label;
+}
+
+
+void InsetCitation::updateLabels(ParIterator const &)
 {
        biblio::CiteEngine const engine = buffer().params().getEngine();
        if (cache.params == params() && cache.engine == engine)
-               return cache.screen_label;
+               return;
 
        // The label has changed, so we have to re-create it.
        docstring const glabel = generateLabel();
@@ -445,8 +453,13 @@ docstring InsetCitation::screenLabel() const
        cache.params = params();
        cache.generated_label = glabel;
        cache.screen_label = label;
+}
 
-       return label;
+
+void InsetCitation::addToToc(ParConstIterator const & cpit) const
+{
+       Toc & toc = buffer().tocBackend().toc("citation");
+       toc.push_back(TocItem(cpit, 0, cache.screen_label));
 }
 
 
index 0cf4f77a15484d12ff4fae837f7a20e09ac56c4f..e30d036caa72eca817f16c2046c510753cf50cf0 100644 (file)
@@ -45,6 +45,11 @@ public:
        void textString(odocstream &) const;
        ///
        void validate(LaTeXFeatures &) const;
+       ///
+       void updateLabels(ParIterator const & it);
+       ///
+       void addToToc(ParConstIterator const &) const;
+
        ///
        static ParamInfo const & findInfo(std::string const &);
        //FIXME This is the locus of the design problem we have.