]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToc.cpp
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiToc.cpp
index 0d7643f869dec289c59b33708358e8b28cae078a..43485fa320c1c66494eb14b799a3a63ecc560146 100644 (file)
 #include "Buffer.h"
 #include "BufferView.h"
 #include "BufferParams.h"
-#include "support/debug.h"
 #include "FloatList.h"
 #include "FuncRequest.h"
-#include "support/gettext.h"
 #include "TextClass.h"
 
 #include "support/convert.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 
 #include <algorithm>
 
@@ -43,7 +43,7 @@ namespace frontend {
 GuiToc::GuiToc(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
        : DockView(parent, "toc", qt_("Outline"), area, flags)
 {
-       widget_ = new TocWidget(*this);
+       widget_ = new TocWidget(*this, &parent);
        setWidget(widget_);
 }
 
@@ -96,12 +96,6 @@ QModelIndex GuiToc::currentIndex(int type) const
        if (type < 0)
                return QModelIndex();
 
-       // FIXME: The TocBackend infrastructure is not ready for LOF and LOT
-       // This is because a proper ParConstIterator is not constructed in
-       // InsetCaption::addToToc()
-       if(!canOutline(type))
-               return QModelIndex();
-
        return toc_models_[type]->modelIndex(currentTocItem(type));
 }
 
@@ -141,12 +135,16 @@ bool GuiToc::initialiseParams(string const & data)
 {
        LYXERR(Debug::GUI, data);
        QString str = QString::fromUtf8(data.c_str());
-       string new_type = "tableofcontents";
-       if (str.contains("floatlist")) {
-               if (str.contains("figure"))
+       string new_type;
+       if (str.contains("tableofcontents"))
+               new_type = "tableofcontents";
+       else if (str.contains("floatlist")) {
+               if (str.contains("\"figure"))
                        new_type = "figure";
-               else if (str.contains("table"))
+               else if (str.contains("\"table"))
                        new_type = "table";
+               else if (str.contains("\"algorithm"))
+                       new_type = "algorithm";
        }
 
        types_.clear();
@@ -168,7 +166,6 @@ bool GuiToc::initialiseParams(string const & data)
                        break;
                }
        }
-
        widget_->updateGui(selected_type);
 
        return true;
@@ -224,14 +221,24 @@ docstring GuiToc::guiName(string const & type) const
 {
        if (type == "tableofcontents")
                return _("Table of Contents");
-
+       if (type == "equation")
+               return _("List of Equations");
        if (type == "footnote")
                return _("List of Foot notes");
-
+       if (type == "listing")
+               return _("List of Listings");
+       if (type == "index")
+               return _("List of Indexes");
+       if (type == "marginalnote")
+               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");
 
-       FloatList const & floats = buffer().params().getTextClass().floats();
+       FloatList const & floats = buffer().params().documentClass().floats();
        if (floats.typeExist(type))
                return _(floats.getType(type).listName());