From 6ab07eb870fab7a674ed6387eceacd024984bc63 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 30 Jan 2010 16:07:53 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiView.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 76abfc49ed..145a7b9b66 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -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; -- 2.39.2