From d1e0a0e4ed238b17072ac821231a1698c419108b Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Tue, 14 Dec 2010 23:16:19 +0000 Subject: [PATCH] Allow customization of label string for note insets. We actually had strings in the layout file, but they were not used. Question: Should we just remove InsetNote::setButtonLabel() now? The only purpose it is serving is to provide a backup in case no label is defined. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36884 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/layouts/stdinsets.inc | 6 +++--- src/insets/InsetNote.cpp | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index f2443a902b..58e19a358c 100644 --- a/lib/layouts/stdinsets.inc +++ b/lib/layouts/stdinsets.inc @@ -77,7 +77,7 @@ InsetLayout Foot End InsetLayout Note:Comment - LabelString comment + LabelString Comment LatexType environment LatexName comment BgColor commentbg @@ -92,7 +92,7 @@ End InsetLayout Note:Note - LabelString note + LabelString Note LatexType command LatexName note BgColor notebg @@ -107,7 +107,7 @@ End InsetLayout Note:Greyedout - LabelString greyedout + LabelString Greyedout LatexType environment LatexName lyxgreyedout BgColor greyedoutbg diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index 5198524da6..1ab8edd95a 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -156,7 +156,11 @@ void InsetNote::read(Lexer & lex) void InsetNote::setButtonLabel() { - docstring const label = notetranslator_loc().find(params_.type); + docstring label = getLayout().labelstring(); + if (label.empty()) + label = notetranslator_loc().find(params_.type); + else + label = translateIfPossible(label); setLabel(label); }