]> git.lyx.org Git - features.git/commitdiff
Fix the guiName of external insets.
authorJulien Rioux <jrioux@lyx.org>
Tue, 13 Sep 2011 21:50:07 +0000 (21:50 +0000)
committerJulien Rioux <jrioux@lyx.org>
Tue, 13 Sep 2011 21:50:07 +0000 (21:50 +0000)
  - 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

lib/external_templates
src/frontends/qt4/GuiExternal.cpp
src/insets/InsetExternal.cpp

index 61dbddf2fc3d2253330c04e558c0fea3e60b7a54..4c6278a1aaab270bff1b4b2937b968580f1c4302 100644 (file)
@@ -34,7 +34,7 @@ PreambleDef InputOrWarn
 PreambleDefEnd
 
 Template GnumericSpreadsheet
-       GuiName "Spreadsheet"
+       GuiName "Gnumeric spreadsheet"
        HelpText
                A spreadsheet made with gnumeric, openoffice or excel.
                It imports as a long table, so any length
@@ -76,7 +76,7 @@ TemplateEnd
 Template RasterImage
        # By default, InsetExternal is displayed as a grey button
        # containing this text.
-       GuiName "Bitmap: $$AbsOrRelPathParent$$Basename"
+       GuiName "Raster image"
        # This text is used in the External dialog.
        # Provide enough information to explain to the user just
        # what the template can provide him with.
@@ -146,7 +146,7 @@ TemplateEnd
 
 
 Template XFig
-       GuiName "Xfig: $$AbsOrRelPathParent$$Basename"
+       GuiName "Xfig figure"
        HelpText
                An Xfig figure.
        HelpTextEnd
@@ -199,7 +199,7 @@ TemplateEnd
 
 
 Template ChessDiagram
-       GuiName "Chess: $$AbsOrRelPathParent$$Basename"
+       GuiName "Chess diagram"
        HelpText
                A chess position diagram.
                This template will use XBoard to edit the position.
@@ -298,7 +298,7 @@ Template LilyPond
 TemplateEnd
 
 Template PDFPages
-       GuiName "PDF pages: $$AbsOrRelPathParent$$Basename"
+       GuiName "PDF pages"
        HelpText
                Includes PDF documents, using the 'pdfpages' package.
                To include multiple pages, use the 'pages'-option,
@@ -370,7 +370,7 @@ Template Date
 TemplateEnd
 
 Template Dia
-       GuiName "Dia: $$AbsOrRelPathParent$$Basename"
+       GuiName "Dia diagram"
        HelpText
                Dia diagram.
        HelpTextEnd
index 00e2b66a3aaf6b5cec7263ee7ab18f75db0cfcab..94decc7b3b9978f3c69dc3c980c14f054fc17c08 100644 (file)
@@ -199,7 +199,7 @@ GuiExternal::GuiExternal(GuiView & lv)
        i1 = external::TemplateManager::get().getTemplates().begin();
        i2 = external::TemplateManager::get().getTemplates().end();
        for (; i1 != i2; ++i1)
-               externalCO->addItem(qt_(i1->second.lyxName));
+               externalCO->addItem(qt_(i1->second.guiName));
 
        // Fill the origins combo
        for (size_t i = 0; i != sizeof(origins) / sizeof(origins[0]); ++i)
index 8126d459a9f9d5b637a6c2feae246db2a59a3240..77d1b2f7bfd4073a94310707fca82312fafd2a40 100644 (file)
@@ -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