]> git.lyx.org Git - features.git/commitdiff
Introduce LFUN_CLOSE_TAB_GROUP.
authorAbdelrazak Younes <younes@lyx.org>
Thu, 21 Feb 2008 14:53:09 +0000 (14:53 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 21 Feb 2008 14:53:09 +0000 (14:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23097 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXAction.cpp
src/LyXFunc.cpp
src/frontends/qt4/GuiView.cpp
src/lfuns.h

index 2f8d8623773e4aa51e3fd1a63e0e541a4161a959..de87b5479d9185eb98fc4a485ea6f86aa572eab8 100644 (file)
@@ -1144,7 +1144,7 @@ void LyXAction::init()
  * \var lyx::kb_action lyx::LFUN_SPLIT_VIEW
  * \li Action: Creates another split view of current buffer.
  * \li Notion: All split views act in the same way indpendently.
- * \li Syntax: split-buffer <vertical|horizontal>
+ * \li Syntax: split-view <vertical|horizontal>
  * \li Params: horizontal : The work areas are laid out side by side.\n
                vertical   : The work areas laid out vertically.\n
  * \li Origin: abdel, 20 Feb 2007
@@ -1152,6 +1152,16 @@ void LyXAction::init()
  */
                { LFUN_SPLIT_VIEW, "split-view", ReadOnly, Buffer },
 
+/*!
+ * \var lyx::kb_action lyx::LFUN_CLOSE_TAB_GROUP
+ * \li Action: Close the current tab group.
+ * \li Notion: This only closes the work areas, not the buffer themselves.
+               The still opened buffers can be visualized in another tab group.
+ * \li Syntax: close-tab-group
+ * \li Origin: abdel, 21 Feb 2007
+ * \endvar
+ */
+               { LFUN_CLOSE_TAB_GROUP, "close-tab-group", ReadOnly, Buffer },
                { LFUN_DIALOG_SHOW, "dialog-show", NoBuffer, Edit },
                { LFUN_DIALOG_SHOW_NEW_INSET, "dialog-show-new-inset", Noop, Edit },
                { LFUN_DIALOG_UPDATE, "dialog-update", NoBuffer, Edit },
index af99332674af2b43424cbc80da023ad382360b40..f78ac4b3f746c098e5029a7036bd3396e8d90d0b 100644 (file)
@@ -453,6 +453,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        case LFUN_BUFFER_WRITE:
        case LFUN_BUFFER_WRITE_AS:
        case LFUN_SPLIT_VIEW:
+       case LFUN_CLOSE_TAB_GROUP:
                if (lyx_view_)
                        return lyx_view_->getStatus(cmd);
                enable = false;
index 361c1e1a5435f28e4f2da15ad690630df3200a46..c51f7176bbcc1b231d681c97054633658125f455 100644 (file)
@@ -964,6 +964,10 @@ FuncStatus GuiView::getStatus(FuncRequest const & cmd)
                enable = buf;
                break;
 
+       case LFUN_CLOSE_TAB_GROUP:
+               enable = d.currentTabWorkArea();
+               break;
+
        case LFUN_TOOLBAR_TOGGLE:
                flag.setOnOff(d.toolbars_->visible(cmd.getArg(0)));
                break;
@@ -1822,6 +1826,11 @@ bool GuiView::dispatch(FuncRequest const & cmd)
                        }
                        break;
 
+               case LFUN_CLOSE_TAB_GROUP:
+                       if (TabWorkArea * twa = d.currentTabWorkArea())
+                               delete twa;
+                       break;
+
                default:
                        return false;
        }
index c3f31b0a91a39ea5f4b8a6c3838798675af7f2b0..1a56269df12a7a15e9cc15945ccb2e219be8e73f 100644 (file)
@@ -414,6 +414,7 @@ enum kb_action {
        LFUN_SCROLL,
        LFUN_UI_TOGGLE,
        LFUN_SPLIT_VIEW,
+       LFUN_CLOSE_TAB_GROUP,
        LFUN_LASTACTION                  // end of the table
 };