new_type = "table";
else if (str.contains("\"algorithm"))
new_type = "algorithm";
- }
+ } else
+ new_type = toqstr(data);
types_.clear();
type_names_.clear();
return _("Child Documents");
if (type == "embedded")
return _("Embedded Files");
+ if (type == "graphics")
+ return _("List of Graphics");
if (type == "equation")
return _("List of Equations");
if (type == "footnote")
if (cit->first == "tableofcontents")
continue;
- // All the rest is for floats
- MenuDefinition submenu;
- TocIterator ccit = cit->second.begin();
- TocIterator eend = cit->second.end();
- for (; ccit != eend; ++ccit) {
- QString const label = limitStringLength(ccit->str());
- submenu.add(MenuItem(MenuItem::Command, label,
- FuncRequest(ccit->action())));
- }
string const & floatName = floatlist.getType(cit->first).listName();
QString label;
bool in_other_list = true;
in_other_list = false;
} else if (cit->first == "embedded")
label = qt_("Embedded Files");
+ else if (cit->first == "graphics")
+ label = qt_("List of Graphics");
else if (cit->first == "equation")
label = qt_("List of Equations");
else if (cit->first == "index")
// This should not happen unless the entry is missing above.
label = qt_("Other floats: ") + toqstr(cit->first);
+ MenuDefinition submenu;
+
+ if (cit->second.size() >= 30) {
+ FuncRequest f(LFUN_DIALOG_SHOW, "toc " + cit->first);
+ submenu.add(MenuItem(MenuItem::Command, qt_("Open Navigator..."), f));
+ } else {
+ TocIterator ccit = cit->second.begin();
+ TocIterator eend = cit->second.end();
+ for (; ccit != eend; ++ccit) {
+ QString const label = limitStringLength(ccit->str());
+ submenu.add(MenuItem(MenuItem::Command, label,
+ FuncRequest(ccit->action())));
+ }
+ }
+
MenuItem item(MenuItem::Submenu, label);
item.setSubmenu(submenu);
if (in_other_list)
#include "Converter.h"
#include "Cursor.h"
#include "DispatchResult.h"
+#include "EmbeddedFiles.h"
#include "ErrorList.h"
#include "Exporter.h"
#include "Format.h"
#include "Mover.h"
#include "OutputParams.h"
#include "sgml.h"
-#include "EmbeddedFiles.h"
+#include "TocBackend.h"
#include "frontends/alert.h"
}
+void InsetGraphics::addToToc(ParConstIterator const & cpit) const
+{
+ TocBackend & backend = buffer().tocBackend();
+
+ docstring str = params_.filename.displayName();
+ if (params_.filename.embedded()) {
+ backend.toc("embedded").push_back(TocItem(cpit, 0, str));
+ str += _(" (embedded)");
+ }
+ backend.toc("graphics").push_back(TocItem(cpit, 0, str));
+}
+
+
string const InsetGraphicsMailer::name_("graphics");
InsetGraphicsMailer::InsetGraphicsMailer(InsetGraphics & inset)
///
~InsetGraphics();
///
+ bool isLabeled() const { return true; }
void metrics(MetricsInfo &, Dimension &) const;
///
EDITABLE editable() const;
void registerEmbeddedFiles(EmbeddedFileList &) const;
///
void updateEmbeddedFile(EmbeddedFile const &);
+ ///
+ void addToToc(ParConstIterator const &) const;
+
/// Force inset into LTR environment if surroundings are RTL?
virtual bool forceLTR() const { return true; }
protected:
if (caption.empty())
return;
Toc & toc = backend.toc("listing");
- docstring const str = convert<docstring>(toc.size() + 1)
+ docstring str = convert<docstring>(toc.size() + 1)
+ ". " + from_utf8(caption);
+ if (embedded_status) {
+ backend.toc("embedded").push_back(TocItem(cpit, 0, str));
+ str += _(" (embedded)");
+ }
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());
Toc & toc = backend.toc("child");
docstring str = childbuffer->fileName().displayName();
- if (embedded_status)
+ if (embedded_status) {
+ backend.toc("embedded").push_back(TocItem(cpit, 0, str));
str += _(" (embedded)");
+ }
toc.push_back(TocItem(cpit, 0, str));
- if (embedded_status)
- backend.toc("embedded").push_back(TocItem(cpit, 0, str));
TocList & toclist = backend.tocs();
TocList const & childtoclist = childbuffer->tocBackend().tocs();