mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
add "Embedded Files" to Navigator.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23658 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b1742b5736
commit
f53467871f
@ -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")
|
||||
|
@ -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");
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user