]> git.lyx.org Git - features.git/commitdiff
add "Embedded Files" to Navigator.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 11 Mar 2008 09:04:09 +0000 (09:04 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 11 Mar 2008 09:04:09 +0000 (09:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23658 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiToc.cpp
src/frontends/qt4/Menus.cpp
src/insets/InsetInclude.cpp
src/insets/InsetInclude.h

index 274ba3e1b6eaabb2ec670c90eb1839905f5b1e7b..076c62a0f473f5529db15583c18b8eb809d18095 100644 (file)
@@ -223,6 +223,8 @@ docstring GuiToc::guiName(string const & type) const
                return _("Table of Contents");
        if (type == "child")
                return _("Child Documents");
+       if (type == "embedded")
+               return _("Embedded Files");
        if (type == "equation")
                return _("List of Equations");
        if (type == "footnote")
index de4732af03a47d99ad5c211496cc9f4151174f1f..671d426ddb6af867e85ec57254f901edae0ec7e8 100644 (file)
@@ -923,7 +923,9 @@ void MenuDefinition::expandToc(Buffer const * buf)
                else if (cit->first == "child") {
                        label = qt_("Child Documents");
                        in_other_list = false;
-               } else if (cit->first == "equation")
+               } else if (cit->first == "embedded")
+                       label = qt_("Embedded Files");
+               else if (cit->first == "equation")
                        label = qt_("List of Equations");
                else if (cit->first == "index")
                        label = qt_("List of Indexes");
index caafae4be579b7cd94abc8f951ae966cb765aedc..c2b3aeb6ed46ea9656b2be3553e16a0cc86b8dd6 100644 (file)
@@ -863,6 +863,9 @@ void InsetInclude::addPreview(graphics::PreviewLoader & ploader) const
 
 void InsetInclude::addToToc(ParConstIterator const & cpit) const
 {
+       bool const embedded_status = !params()["embed"].empty();
+       TocBackend & backend = buffer().tocBackend();
+
        if (isListings(params())) {
                if (label_)
                        label_->addToToc(cpit);
@@ -871,25 +874,34 @@ void InsetInclude::addToToc(ParConstIterator const & cpit) const
                string caption = p.getParamValue("caption");
                if (caption.empty())
                        return;
-               Toc & toc = buffer().tocBackend().toc("listing");
+               Toc & toc = backend.toc("listing");
                docstring const str = convert<docstring>(toc.size() + 1)
                        + ". " +  from_utf8(caption);
                ParConstIterator pit = cpit;
                pit.push_back(*this);
                toc.push_back(TocItem(pit, 0, str));
+               if (embedded_status)
+                       backend.toc("embedded").push_back(TocItem(cpit, 0, str));
                return;
        }
        Buffer const * const childbuffer = getChildBuffer(buffer(), params());
-       if (!childbuffer)
+       if (!childbuffer) {
+               if (embedded_status) 
+                       // Add it to the embedded list nonetheless.
+                       backend.toc("embedded").push_back(TocItem(cpit, 0,
+                               params()["filename"]));
                return;
+       }
 
-       Toc & toc = buffer().tocBackend().toc("child");
+       Toc & toc = backend.toc("child");
        docstring str = childbuffer->fileName().displayName();
-       if (!params()["embed"].empty())
+       if (embedded_status)
                str += _(" (embedded)");
        toc.push_back(TocItem(cpit, 0, str));
+       if (embedded_status)
+               backend.toc("embedded").push_back(TocItem(cpit, 0, str));
 
-       TocList & toclist = buffer().tocBackend().tocs();
+       TocList & toclist = backend.tocs();
        TocList const & childtoclist = childbuffer->tocBackend().tocs();
        TocList::const_iterator it = childtoclist.begin();
        TocList::const_iterator const end = childtoclist.end();
index 405a4c0c2f5765b0540c22a2f3be2f6980aa2e1d..78cfa959a6ad61ae4ce574098622d6927106f325 100644 (file)
@@ -39,6 +39,7 @@ public:
        ~InsetInclude();
 
        void setBuffer(Buffer & buffer);
+       bool isLabeled() const { return true; }
 
        /// Override these InsetButton methods if Previewing
        void metrics(MetricsInfo & mi, Dimension & dim) const;