mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
Do not set the statusbar message in GuiView::toolbar(). We don't really want to see the statusbar message when this function is called from initToolbars or from LFUN_COMMAND_EXECUTE. Instead, set the message in getStatus to indicate why the LFUN cannot be executed.
Also, disable the LFUN if the toolbar is not found. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33278 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8186ecfef9
commit
6ab07eb870
@ -507,7 +507,6 @@ GuiToolbar * GuiView::toolbar(string const & name)
|
||||
return it->second;
|
||||
|
||||
LYXERR(Debug::GUI, "Toolbar::display: no toolbar named " << name);
|
||||
message(bformat(_("Unknown toolbar \"%1$s\""), from_utf8(name)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1441,10 +1440,18 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
|
||||
enable = d.currentTabWorkArea();
|
||||
break;
|
||||
|
||||
case LFUN_TOOLBAR_TOGGLE:
|
||||
if (GuiToolbar * t = toolbar(cmd.getArg(0)))
|
||||
case LFUN_TOOLBAR_TOGGLE: {
|
||||
string const name = cmd.getArg(0);
|
||||
if (GuiToolbar * t = toolbar(name))
|
||||
flag.setOnOff(t->isVisible());
|
||||
else {
|
||||
enable = false;
|
||||
docstring const msg =
|
||||
bformat(_("Unknown toolbar \"%1$s\""), from_utf8(name));
|
||||
flag.message(msg);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_DROP_LAYOUTS_CHOICE:
|
||||
enable = buf;
|
||||
|
Loading…
Reference in New Issue
Block a user