]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiToolbars.cpp
reduce line noise
[features.git] / src / frontends / qt4 / GuiToolbars.cpp
index 3b3effb7bf5b560ab15131cf0d4c44201d82e968..e5999ef2d9f30a41e0d6b49661feeb9d6ace6168 100644 (file)
@@ -40,7 +40,7 @@ namespace frontend {
 #define TurnOnFlag(x)   flags |= ToolbarInfo::x
 #define TurnOffFlag(x)  flags &= ~ToolbarInfo::x
 
-GuiToolbars::GuiToolbars(GuiViewBase & owner)
+GuiToolbars::GuiToolbars(GuiView & owner)
        : owner_(owner),
          layout_(0),
          last_textclass_(TextClassPtr())
@@ -131,8 +131,8 @@ void GuiToolbars::init()
        int last_posx = 0;
        int last_posy = 0;
        for (; tb != te; ++tb) {
-               LYXERR(Debug::INIT) << "Adding " << tb->key << " at position "
-                       << tb->info.posx << " " << tb->info.posy << endl;
+               LYXERR(Debug::INIT, "Adding " << tb->key << " at position "
+                       << tb->info.posx << " " << tb->info.posy);
                // add toolbar break if posx or posy changes
                bool newline = tb->info.location == last_loc && (
                        // if two toolbars at the same location, assume uninitialized and add toolbar break
@@ -174,8 +174,7 @@ void GuiToolbars::display(string const & name, bool show)
                }
        }
 
-       LYXERR(Debug::GUI) << "Toolbar::display: no toolbar named "
-               << name << endl;
+       LYXERR(Debug::GUI, "Toolbar::display: no toolbar named " << name);
 }
 
 
@@ -190,8 +189,7 @@ void GuiToolbars::toggleToolbarState(string const & name, bool allowauto)
        ToolbarInfo * tbi = toolbarbackend.getUsedToolbarInfo(name);
 
        if (!tbi) {
-               LYXERR(Debug::GUI) << "Toolbar::display: no toolbar named "
-                       << name << endl;
+               LYXERR(Debug::GUI, "Toolbar::display: no toolbar named " << name);
                return;
        }
 
@@ -295,10 +293,10 @@ void GuiToolbars::setLayout(docstring const & layout)
 }
 
 
-bool GuiToolbars::updateLayoutList(TextClassPtr textclass)
+bool GuiToolbars::updateLayoutList(TextClassPtr textclass, bool force)
 {
        // update the layout display
-       if (last_textclass_ != textclass) {
+       if (last_textclass_ != textclass || force) {
                if (layout_)
                        layout_->updateContents();
                last_textclass_ = textclass;
@@ -378,11 +376,13 @@ void GuiToolbars::showCommandBuffer(bool show_it)
                if (!cb)
                        continue;
                if (!show_it) {
-                       it->second->hide();
+                       // FIXME: this is a hack, "minibuffer" should not be
+                       // hardcoded.
+                       display("minibuffer", false);
                        return;
                }
                if (!it->second->isVisible())
-                       it->second->show();
+                       display("minibuffer", true);
                cb->setFocus();
                return;
        }