X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetExternal.cpp;h=ea51664978c33fca4dee8ea53e9d1791182b3240;hb=dbb1ac30e9a87007af7c53f0f93ec9e21826f90b;hp=f3ea34c011eb735ea1cdfd329cdb190e23c6496e;hpb=d866717ef7503a1373dd1cb3925e1ac97b079192;p=lyx.git diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index f3ea34c011..ea51664978 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -36,18 +36,18 @@ #include "graphics/PreviewLoader.h" +#include "support/bind.h" #include "support/convert.h" #include "support/debug.h" #include "support/ExceptionMessage.h" #include "support/filetools.h" #include "support/gettext.h" +#include "support/lassert.h" #include "support/lstrings.h" #include "support/lyxlib.h" -#include "support/Translator.h" - -#include "support/bind.h" #include +#include using namespace std; using namespace lyx::support; @@ -503,8 +503,14 @@ docstring screenLabel(InsetExternalParams const & params, from_utf8(params.templatename())); // FIXME UNICODE docstring gui = _(ptr->guiName); - return from_utf8(external::doSubstitution(params, buffer, - to_utf8(gui), false)); + gui += ": "; + + if (params.filename.empty()) + gui += "???"; + else + gui += from_utf8(params.filename.relFileName(buffer.filePath())); + + return gui; } } // namespace anon @@ -729,6 +735,7 @@ void InsetExternal::validate(LaTeXFeatures & features) const string format; switch (features.runparams().flavor) { case OutputParams::LATEX: + case OutputParams::DVILUATEX: format = "LaTeX"; break; case OutputParams::LUATEX: @@ -745,6 +752,9 @@ void InsetExternal::validate(LaTeXFeatures & features) const case OutputParams::TEXT: format = "text"; break; + case OutputParams::LYX: + format = "lyx"; + break; } external::Template::Formats::const_iterator cit = et.formats.find(format); @@ -760,7 +770,7 @@ void InsetExternal::validate(LaTeXFeatures & features) const return; } - // FIXME: We don't need that always + // FIXME: We don't need that always, see InsetGraphics features.require("lyxdot"); vector::const_iterator it = cit->second.requirements.begin(); @@ -795,9 +805,9 @@ void InsetExternal::addPreview(DocIterator const & /*inset_pos*/, } -docstring InsetExternal::contextMenuName() const +string InsetExternal::contextMenuName() const { - return from_ascii("context-external"); + return "context-external"; }