Fix the guiName of external insets.

- Remove hack with $$AbsOrRelPath substitution in the guiName.
    Instead, let LyX display the filename automatically in the gui,
    consistent with InsetInclude.

  - Use the guiName in the drop-down menu in the dialog instead of the
    internal lyxName. These guiNames ought to be more descriptive.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39675 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Julien Rioux 2011-09-13 21:50:07 +00:00
parent b794fc078a
commit a5f72061d1
3 changed files with 15 additions and 9 deletions

View File

@ -34,7 +34,7 @@ PreambleDef InputOrWarn
PreambleDefEnd PreambleDefEnd
Template GnumericSpreadsheet Template GnumericSpreadsheet
GuiName "Spreadsheet" GuiName "Gnumeric spreadsheet"
HelpText HelpText
A spreadsheet made with gnumeric, openoffice or excel. A spreadsheet made with gnumeric, openoffice or excel.
It imports as a long table, so any length It imports as a long table, so any length
@ -76,7 +76,7 @@ TemplateEnd
Template RasterImage Template RasterImage
# By default, InsetExternal is displayed as a grey button # By default, InsetExternal is displayed as a grey button
# containing this text. # containing this text.
GuiName "Bitmap: $$AbsOrRelPathParent$$Basename" GuiName "Raster image"
# This text is used in the External dialog. # This text is used in the External dialog.
# Provide enough information to explain to the user just # Provide enough information to explain to the user just
# what the template can provide him with. # what the template can provide him with.
@ -146,7 +146,7 @@ TemplateEnd
Template XFig Template XFig
GuiName "Xfig: $$AbsOrRelPathParent$$Basename" GuiName "Xfig figure"
HelpText HelpText
An Xfig figure. An Xfig figure.
HelpTextEnd HelpTextEnd
@ -199,7 +199,7 @@ TemplateEnd
Template ChessDiagram Template ChessDiagram
GuiName "Chess: $$AbsOrRelPathParent$$Basename" GuiName "Chess diagram"
HelpText HelpText
A chess position diagram. A chess position diagram.
This template will use XBoard to edit the position. This template will use XBoard to edit the position.
@ -298,7 +298,7 @@ Template LilyPond
TemplateEnd TemplateEnd
Template PDFPages Template PDFPages
GuiName "PDF pages: $$AbsOrRelPathParent$$Basename" GuiName "PDF pages"
HelpText HelpText
Includes PDF documents, using the 'pdfpages' package. Includes PDF documents, using the 'pdfpages' package.
To include multiple pages, use the 'pages'-option, To include multiple pages, use the 'pages'-option,
@ -370,7 +370,7 @@ Template Date
TemplateEnd TemplateEnd
Template Dia Template Dia
GuiName "Dia: $$AbsOrRelPathParent$$Basename" GuiName "Dia diagram"
HelpText HelpText
Dia diagram. Dia diagram.
HelpTextEnd HelpTextEnd

View File

@ -199,7 +199,7 @@ GuiExternal::GuiExternal(GuiView & lv)
i1 = external::TemplateManager::get().getTemplates().begin(); i1 = external::TemplateManager::get().getTemplates().begin();
i2 = external::TemplateManager::get().getTemplates().end(); i2 = external::TemplateManager::get().getTemplates().end();
for (; i1 != i2; ++i1) for (; i1 != i2; ++i1)
externalCO->addItem(qt_(i1->second.lyxName)); externalCO->addItem(qt_(i1->second.guiName));
// Fill the origins combo // Fill the origins combo
for (size_t i = 0; i != sizeof(origins) / sizeof(origins[0]); ++i) for (size_t i = 0; i != sizeof(origins) / sizeof(origins[0]); ++i)

View File

@ -503,8 +503,14 @@ docstring screenLabel(InsetExternalParams const & params,
from_utf8(params.templatename())); from_utf8(params.templatename()));
// FIXME UNICODE // FIXME UNICODE
docstring gui = _(ptr->guiName); docstring gui = _(ptr->guiName);
return from_utf8(external::doSubstitution(params, buffer, gui += ": ";
to_utf8(gui), false));
if (params.filename.empty())
gui += "???";
else
gui += from_utf8(params.filename.relFileName(buffer.filePath()));
return gui;
} }
} // namespace anon } // namespace anon