mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-24 21:55:29 +00:00
Allow to separate menu string from label string for arguments
This commit is contained in:
parent
86559aa318
commit
25ef8e7eef
@ -1,5 +1,5 @@
|
||||
#LyX 2.1 created this file. For more info see http://www.lyx.org/
|
||||
\lyxformat 449
|
||||
\lyxformat 452
|
||||
\begin_document
|
||||
\begin_header
|
||||
\textclass scrbook
|
||||
@ -10338,7 +10338,7 @@ Argument
|
||||
|
||||
\begin_layout Itemize
|
||||
|
||||
\change_inserted -712698321 1353691469
|
||||
\change_inserted -712698321 1355076779
|
||||
\begin_inset Flex Code
|
||||
status collapsed
|
||||
|
||||
@ -10365,7 +10365,19 @@ status collapsed
|
||||
\end_inset
|
||||
|
||||
The string that will appear both in the menu (to insert this argument)
|
||||
and on the argument inset button.
|
||||
and on the argument inset button (unless you also specify a separate
|
||||
\begin_inset Flex Code
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\change_inserted -712698321 1355076779
|
||||
MenuString
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
).
|
||||
For the menu, you can define an accelerator by appending the respective
|
||||
character to the string, divided by
|
||||
\begin_inset Quotes eld
|
||||
@ -10406,6 +10418,85 @@ Short Title|S
|
||||
|
||||
\begin_layout Itemize
|
||||
|
||||
\change_inserted -712698321 1355076754
|
||||
\begin_inset Flex Code
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\change_inserted -712698321 1355076658
|
||||
MenuString
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\begin_inset Flex Code
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\change_inserted -712698321 1355076654
|
||||
[string]
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
A separate string for the menu.
|
||||
You can define an accelerator by appending the respective character to
|
||||
the string, divided by
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
|
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
(e.
|
||||
\begin_inset space \thinspace{}
|
||||
\end_inset
|
||||
|
||||
g.
|
||||
|
||||
\begin_inset Flex Code
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\change_inserted -712698321 1355076654
|
||||
\begin_inset Quotes eld
|
||||
\end_inset
|
||||
|
||||
Short Title|S
|
||||
\begin_inset Quotes erd
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
).
|
||||
This specification is optional.
|
||||
If it is not given the
|
||||
\begin_inset Flex Code
|
||||
status collapsed
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
\change_inserted -712698321 1355076736
|
||||
LabelString
|
||||
\change_unchanged
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
will be used instead for the menu.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
|
||||
\change_inserted -712698321 1353680665
|
||||
\begin_inset Flex Code
|
||||
status collapsed
|
||||
|
@ -93,7 +93,8 @@ Style Itemize
|
||||
Tooltip "A customized item string"
|
||||
EndArgument
|
||||
Argument item:2
|
||||
LabelString "Item Overlay Specifications"
|
||||
MenuString "Item Overlay Specifications"
|
||||
LabelString "On Slide"
|
||||
Tooltip "Overlay specifications for this item"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -129,7 +130,8 @@ Style Enumerate
|
||||
Tooltip "A customized item string"
|
||||
EndArgument
|
||||
Argument item:2
|
||||
LabelString "Item Overlay Specifications"
|
||||
MenuString "Item Overlay Specifications"
|
||||
LabelString "On Slide"
|
||||
Tooltip "Overlay specifications for this item"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -163,7 +165,8 @@ Style Description
|
||||
Tooltip "The longest label in this list (to determine the indendation width)"
|
||||
EndArgument
|
||||
Argument item:1
|
||||
LabelString "Item Overlay Specifications"
|
||||
MenuString "Item Overlay Specifications"
|
||||
LabelString "On Slide"
|
||||
Tooltip "Overlay specifications for this item"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -194,7 +197,8 @@ Style Part
|
||||
LatexType Command
|
||||
LatexName part
|
||||
Argument 1
|
||||
LabelString "Mode Specification|S"
|
||||
LabelString "Mode"
|
||||
MenuString "Mode Specification|S"
|
||||
Tooltip "Specify in which mode (article, presentation etc.) this header appears"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -243,7 +247,8 @@ Style Section
|
||||
LabelString "Section \arabic{section}"
|
||||
RefPrefix sec
|
||||
Argument 1
|
||||
LabelString "Mode Specification|S"
|
||||
LabelString "Mode"
|
||||
MenuString "Mode Specification|S"
|
||||
Tooltip "Specify in which mode (article, presentation etc.) this header appears"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -272,7 +277,8 @@ Style Section*
|
||||
LabelType No_Label
|
||||
ResetArgs 1
|
||||
Argument 1
|
||||
LabelString "Mode Specification|S"
|
||||
LabelString "Mode"
|
||||
MenuString "Mode Specification|S"
|
||||
Tooltip "Specify in which mode (article, presentation etc.) this header appears"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -298,7 +304,8 @@ Style Subsection
|
||||
LabelString "Subsection \arabic{section}.\arabic{subsection}"
|
||||
RefPrefix sub
|
||||
Argument 1
|
||||
LabelString "Mode Specification|S"
|
||||
LabelString "Mode"
|
||||
MenuString "Mode Specification|S"
|
||||
Tooltip "Specify in which mode (article, presentation etc.) this header appears"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -327,7 +334,8 @@ Style Subsection*
|
||||
LabelType No_Label
|
||||
ResetArgs 1
|
||||
Argument 1
|
||||
LabelString "Mode Specification|S"
|
||||
LabelString "Mode"
|
||||
MenuString "Mode Specification|S"
|
||||
Tooltip "Specify in which mode (article, presentation etc.) this header appears"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -353,7 +361,8 @@ Style Subsubsection
|
||||
LabelString "Subsubsection \arabic{section}.\arabic{subsection}.\arabic{subsubsection}"
|
||||
RefPrefix sub
|
||||
Argument 1
|
||||
LabelString "Mode Specification|S"
|
||||
LabelString "Mode"
|
||||
MenuString "Mode Specification|S"
|
||||
Tooltip "Specify in which mode (article, presentation etc.) this header appears"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -382,7 +391,8 @@ Style Subsubsection*
|
||||
LabelType No_Label
|
||||
ResetArgs 1
|
||||
Argument 1
|
||||
LabelString "Mode Specification|S"
|
||||
LabelString "Mode"
|
||||
MenuString "Mode Specification|S"
|
||||
Tooltip "Specify in which mode (article, presentation etc.) this header appears"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -478,7 +488,8 @@ Style AgainFrame
|
||||
LatexType Command
|
||||
LatexName lyxframeend{}\againframe
|
||||
Argument 1
|
||||
LabelString "Overlay Specifications|S"
|
||||
LabelString "On Slide"
|
||||
MenuString "Overlay Specifications|S"
|
||||
Tooltip "Overlay specifications for this frame"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -490,7 +501,8 @@ Style AgainFrame
|
||||
RightDelim >]
|
||||
EndArgument
|
||||
Argument 3
|
||||
LabelString "Frame Options"
|
||||
MenuString "Frame Options"
|
||||
LabelString "Options"
|
||||
Tooltip "Frame options (see beamer manual)"
|
||||
EndArgument
|
||||
Margin First_Dynamic
|
||||
@ -559,7 +571,8 @@ Style FrameSubtitle
|
||||
Color Blue
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "On Slide"
|
||||
MenuString "Overlay Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -586,7 +599,8 @@ Style Column
|
||||
LabelSep xx
|
||||
LabelString "Start column (increase depth!), width:"
|
||||
Argument 1
|
||||
LabelString "Column Options"
|
||||
MenuString "Column Options"
|
||||
LabelString "Options"
|
||||
Tooltip "Column options (see beamer manual)"
|
||||
EndArgument
|
||||
LeftMargin "Start column (increase depth!), width:xx"
|
||||
@ -693,7 +707,8 @@ Style Overprint
|
||||
Color latex
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overprint Area Width"
|
||||
MenuString "Overprint Area Width"
|
||||
LabelString "Width"
|
||||
Tooltip "The width of the overprint area (default: text width)"
|
||||
EndArgument
|
||||
End
|
||||
@ -723,7 +738,8 @@ Style OverlayArea
|
||||
Mandatory 1
|
||||
EndArgument
|
||||
Argument 2
|
||||
LabelString "Overlay Area Height"
|
||||
MenuString "Overlay Area Height"
|
||||
LabelString "Height"
|
||||
Tooltip "The height of the overlay area"
|
||||
Mandatory 1
|
||||
EndArgument
|
||||
@ -749,7 +765,8 @@ Style Uncover
|
||||
Color Latex
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "On Slide"
|
||||
MenuString "Overlay Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -776,7 +793,8 @@ Style Only
|
||||
Color Latex
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "On Slide"
|
||||
MenuString "Overlay Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -807,7 +825,8 @@ Style Block
|
||||
Color latex
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Action Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specification|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1059,7 +1078,8 @@ Style Quotation
|
||||
Align Block
|
||||
AlignPossible Block, Left, Right, Center
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "On Slide"
|
||||
MenuString "Overlay Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1081,7 +1101,8 @@ Style Quote
|
||||
AlignPossible Block, Left, Right, Center
|
||||
LabelType No_Label
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "On Slide"
|
||||
MenuString "Overlay Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1106,7 +1127,8 @@ Style Verse
|
||||
AlignPossible Block, Left
|
||||
LabelType No_Label
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "On Slide"
|
||||
MenuString "Overlay Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1140,7 +1162,8 @@ Style Corollary
|
||||
Size Large
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Action Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1279,7 +1302,8 @@ Style NoteItem
|
||||
Color latex
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "On Slide"
|
||||
MenuString "Overlay Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1300,7 +1324,8 @@ InsetLayout Flex:Emphasize
|
||||
Shape italic
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Action Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1316,7 +1341,8 @@ InsetLayout Flex:Alert
|
||||
Color red
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Action Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1332,7 +1358,8 @@ InsetLayout Flex:Structure
|
||||
Color blue
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Action Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1348,7 +1375,8 @@ InsetLayout Flex:Only
|
||||
Color red
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1364,7 +1392,8 @@ InsetLayout Flex:Uncover
|
||||
Color red
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1380,7 +1409,8 @@ InsetLayout Flex:Visible
|
||||
Color red
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1396,7 +1426,8 @@ InsetLayout Flex:Invisible
|
||||
Color red
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1412,7 +1443,8 @@ InsetLayout Flex:Alternative
|
||||
Color red
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
@ -1434,7 +1466,8 @@ InsetLayout Flex:Beamer_Note
|
||||
Color blue
|
||||
EndFont
|
||||
Argument 1
|
||||
LabelString "Overlay Specification|S"
|
||||
LabelString "Action"
|
||||
MenuString "Action Specifications|S"
|
||||
Tooltip "Specify the overlay settings (see beamer manual)"
|
||||
LeftDelim <
|
||||
RightDelim >
|
||||
|
@ -83,6 +83,7 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
||||
Style = re.compile(r'^\s*Style\s+(.*)\s*$', re.IGNORECASE)
|
||||
# match LabelString, EndLabelString, LabelStringAppendix and maybe others but no comments
|
||||
LabelString = re.compile(r'^[^#]*LabelString\S*\s+(.*)\s*$', re.IGNORECASE)
|
||||
MenuString = re.compile(r'^[^#]*MenuString\S*\s+(.*)\s*$', re.IGNORECASE)
|
||||
Tooltip = re.compile(r'^[^#]*Tooltip\S*\s+(.*)\s*$', re.IGNORECASE)
|
||||
GuiName = re.compile(r'^\s*GuiName\s+(.*)\s*$', re.IGNORECASE)
|
||||
ListName = re.compile(r'^\s*ListName\s+(.*)\s*$', re.IGNORECASE)
|
||||
@ -237,6 +238,12 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
||||
writeString(out, src, base, lineno, string)
|
||||
continue
|
||||
res = LabelString.search(line)
|
||||
if res != None:
|
||||
string = res.group(1)
|
||||
if not layouttranslations:
|
||||
writeString(out, src, base, lineno, string)
|
||||
continue
|
||||
res = MenuString.search(line)
|
||||
if res != None:
|
||||
string = res.group(1)
|
||||
if not layouttranslations:
|
||||
|
@ -900,6 +900,9 @@ void Layout::readArgument(Lexer & lex)
|
||||
} else if (tok == "labelstring") {
|
||||
lex.next();
|
||||
arg.labelstring = lex.getDocString();
|
||||
} else if (tok == "menustring") {
|
||||
lex.next();
|
||||
arg.menustring = lex.getDocString();
|
||||
} else if (tok == "mandatory") {
|
||||
lex.next();
|
||||
arg.mandatory = lex.getBool();
|
||||
|
@ -90,6 +90,7 @@ public:
|
||||
/// The arguments of this layout
|
||||
struct latexarg {
|
||||
docstring labelstring;
|
||||
docstring menustring;
|
||||
bool mandatory;
|
||||
docstring ldelim;
|
||||
docstring rdelim;
|
||||
|
@ -1570,7 +1570,8 @@ void MenuDefinition::expandArguments(BufferView const * bv, bool switcharg)
|
||||
Layout::LaTeXArgMap::const_iterator const laend = args.end();
|
||||
for (; lait != laend; ++lait) {
|
||||
Layout::latexarg arg = (*lait).second;
|
||||
QString item = toqstr(translateIfPossible(arg.labelstring));
|
||||
docstring str = arg.menustring.empty()? arg.labelstring : arg.menustring;
|
||||
QString item = toqstr(translateIfPossible(str));
|
||||
if (switcharg)
|
||||
add(MenuItem(MenuItem::Command, item,
|
||||
FuncRequest(LFUN_INSET_MODIFY,
|
||||
|
@ -528,6 +528,9 @@ void InsetLayout::readArgument(Lexer & lex)
|
||||
} else if (tok == "labelstring") {
|
||||
lex.next();
|
||||
arg.labelstring = lex.getDocString();
|
||||
} else if (tok == "menustring") {
|
||||
lex.next();
|
||||
arg.menustring = lex.getDocString();
|
||||
} else if (tok == "mandatory") {
|
||||
lex.next();
|
||||
arg.mandatory = lex.getBool();
|
||||
|
Loading…
Reference in New Issue
Block a user