]> git.lyx.org Git - features.git/commitdiff
Do not set the statusbar message in GuiView::toolbar(). We don't really want to see...
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 30 Jan 2010 16:07:53 +0000 (16:07 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 30 Jan 2010 16:07:53 +0000 (16:07 +0000)
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

index 76abfc49ed84e4349e9606923e4e547cbf0b1005..145a7b9b6605d8253cd1145e44c657e004d27d36 100644 (file)
@@ -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;