]> git.lyx.org Git - features.git/commitdiff
Add getStatus check that >1 tab for switching
authorScott Kostyshak <skostysh@lyx.org>
Wed, 8 Apr 2015 02:55:20 +0000 (22:55 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Wed, 8 Apr 2015 02:55:20 +0000 (22:55 -0400)
buffer-next and buffer-previous are now only enabled
if there is more than one tab. Note that it does not
matter whether we are at the first or last tab because
we cycle.

src/frontends/qt4/GuiView.cpp

index 6ac747187698a216dfc99f3d80c282c8b37bd1ba..65fe9195e2ab31a0e38096148c75922b8df59dbc 100644 (file)
@@ -1922,9 +1922,12 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                break;
 
        case LFUN_BUFFER_NEXT:
-       case LFUN_BUFFER_PREVIOUS:
-               // FIXME: should we check is there is an previous or next buffer?
+       case LFUN_BUFFER_PREVIOUS: {
+               // because we cycle, it doesn't matter whether on first or last
+               if (d.currentTabWorkArea()->count() <= 1)
+                       enable = false;
                break;
+       }
        case LFUN_BUFFER_SWITCH:
                // toggle on the current buffer, but do not toggle off
                // the other ones (is that a good idea?)