Commit 1b8613cc authored by Dominik Haumann's avatar Dominik Haumann
Browse files

add View > Split View > Close Inactive Views

BUG: 297619
FIXED-IN: 4.11
parent ff290137
......@@ -144,6 +144,13 @@ void KateViewManager::setupActions ()
m_closeView->setWhatsThis(i18n("Close the currently active split view"));
m_closeOtherViews = m_mainWindow->actionCollection()->addAction("view_close_others");
m_closeOtherViews->setIcon(KIcon("view-close"));
m_closeOtherViews->setText(i18n("Close Inactive Views"));
connect(m_closeOtherViews, SIGNAL(triggered()), this, SLOT(slotCloseOtherViews()));
m_closeOtherViews->setWhatsThis(i18n("Close every view but the active one"));
goNext = m_mainWindow->actionCollection()->addAction( "go_next_split_view" );
goNext->setText( i18n("Next Split View") );
goNext->setShortcut( Qt::Key_F8 );
......@@ -219,6 +226,7 @@ void KateViewManager::setupActions ()
void KateViewManager::updateViewSpaceActions ()
{
m_closeView->setEnabled (viewSpaceCount() > 1);
m_closeOtherViews->setEnabled(viewSpaceCount() > 1);
goNext->setEnabled (viewSpaceCount() > 1);
goPrev->setEnabled (viewSpaceCount() > 1);
}
......@@ -811,6 +819,16 @@ void KateViewManager::slotCloseCurrentViewSpace()
removeViewSpace(activeViewSpace());
}
void KateViewManager::slotCloseOtherViews()
{
foreach (KateViewSpace *v, m_viewSpaceList) {
if (activeViewSpace() != v) {
removeViewSpace(v);
}
}
}
/**
* session config functions
*/
......
......@@ -244,9 +244,12 @@ class KateViewManager : public QSplitter
}
void slotCloseCurrentViewSpace();
/** closes every view but the active one */
void slotCloseOtherViews();
void reactivateActiveView();
/**
* get views => age mapping
* useful to show views in a LRU way
......@@ -262,6 +265,7 @@ class KateViewManager : public QSplitter
bool m_init;
KAction *m_closeView;
KAction *m_closeOtherViews;
KAction *goNext;
KAction *goPrev;
KAction *m_cursorPosToggle;
......
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kate" version="72">
<kpartgui name="kate" version="73">
<MenuBar>
<Menu name="file" noMerge="1"><text>&amp;File</text>
......@@ -56,7 +56,8 @@
<Separator />
<Action name="view_split_vert"/>
<Action name="view_split_horiz"/>
<Action name="view_close_current_space" />
<Action name="view_close_current_space"/>
<Action name="view_close_others"/>
<Separator />
<Action name="view_split_move_left" />
<Action name="view_split_move_right" />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment