mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
Disable InsetInfo for VC when VC is not active.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34190 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9d7e5b6b41
commit
aeac2f8cb9
@ -155,9 +155,11 @@ bool InsetInfo::validateModifyArgument(docstring const & arg) const
|
|||||||
{
|
{
|
||||||
string type;
|
string type;
|
||||||
string const name = trim(split(to_utf8(arg), type, ' '));
|
string const name = trim(split(to_utf8(arg), type, ' '));
|
||||||
|
|
||||||
switch (nameTranslator().find(type)) {
|
switch (nameTranslator().find(type)) {
|
||||||
case UNKNOWN_INFO:
|
case UNKNOWN_INFO:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case SHORTCUT_INFO:
|
case SHORTCUT_INFO:
|
||||||
case SHORTCUTS_INFO:
|
case SHORTCUTS_INFO:
|
||||||
case MENU_INFO:
|
case MENU_INFO:
|
||||||
@ -165,21 +167,29 @@ bool InsetInfo::validateModifyArgument(docstring const & arg) const
|
|||||||
FuncRequest func = lyxaction.lookupFunc(name);
|
FuncRequest func = lyxaction.lookupFunc(name);
|
||||||
return func.action() != LFUN_UNKNOWN_ACTION;
|
return func.action() != LFUN_UNKNOWN_ACTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
case LYXRC_INFO: {
|
case LYXRC_INFO: {
|
||||||
ostringstream oss;
|
ostringstream oss;
|
||||||
lyxrc.write(oss, true, name);
|
lyxrc.write(oss, true, name);
|
||||||
return !oss.str().empty();
|
return !oss.str().empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
case PACKAGE_INFO:
|
case PACKAGE_INFO:
|
||||||
case TEXTCLASS_INFO:
|
case TEXTCLASS_INFO:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case BUFFER_INFO:
|
case BUFFER_INFO:
|
||||||
return name == "name" || name == "path" || name == "class" ||
|
if (name == "name" || name == "path" || name == "class")
|
||||||
name == "vcs-revision" || name == "vcs-tree-revision" ||
|
return true;
|
||||||
name == "vcs-author" || name == "vcs-date" || name == "vcs-time";
|
if (name == "vcs-revision" || name == "vcs-tree-revision" ||
|
||||||
|
name == "vcs-author" || name == "vcs-date" || name == "vcs-time")
|
||||||
|
return buffer().lyxvc().inUse();
|
||||||
|
return false;
|
||||||
|
|
||||||
case LYX_INFO:
|
case LYX_INFO:
|
||||||
return name == "version";
|
return name == "version";
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user