mirror of
https://github.com/KDE/konsole.git
synced 2026-05-04 12:44:23 -04:00
Add action to jump to last tab.
Allows user to select a shortcut to jump to the far right tab. There is no default shortcut. Patch by Francesco Cecconi <francesco.cecconi@gmail.com> REVIEW: 102687 BUG: 279166 FIXED-IN: 4.8
This commit is contained in:
@@ -137,6 +137,7 @@ void ViewManager::setupActions()
|
||||
|
||||
KAction* nextViewAction = new KAction( i18n("Next Tab") , this );
|
||||
KAction* previousViewAction = new KAction( i18n("Previous Tab") , this );
|
||||
KAction* lastViewAction = new KAction( i18n("Switch to Last Tab") , this);
|
||||
KAction* nextContainerAction = new KAction( i18n("Next View Container") , this);
|
||||
|
||||
KAction* moveViewLeftAction = new KAction( i18n("Move Tab Left") , this );
|
||||
@@ -207,6 +208,7 @@ void ViewManager::setupActions()
|
||||
// Next / Previous View , Next Container
|
||||
collection->addAction("next-view",nextViewAction);
|
||||
collection->addAction("previous-view",previousViewAction);
|
||||
collection->addAction("last-tab",lastViewAction);
|
||||
collection->addAction("next-container",nextContainerAction);
|
||||
collection->addAction("move-view-left",moveViewLeftAction);
|
||||
collection->addAction("move-view-right",moveViewRightAction);
|
||||
@@ -254,6 +256,9 @@ void ViewManager::setupActions()
|
||||
moveViewRightAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Right) );
|
||||
connect( moveViewRightAction , SIGNAL(triggered()) , this , SLOT(moveActiveViewRight()) );
|
||||
_viewSplitter->addAction(moveViewRightAction);
|
||||
|
||||
connect( lastViewAction, SIGNAL(triggered()) , this , SLOT(lastView()));
|
||||
_viewSplitter->addAction(lastViewAction);
|
||||
}
|
||||
void ViewManager::switchToView(int index)
|
||||
{
|
||||
@@ -314,6 +319,15 @@ void ViewManager::previousView()
|
||||
container->activatePreviousView();
|
||||
}
|
||||
|
||||
void ViewManager::lastView()
|
||||
{
|
||||
ViewContainer* container = _viewSplitter->activeContainer();
|
||||
|
||||
Q_ASSERT( container );
|
||||
|
||||
container->activateLastView();
|
||||
}
|
||||
|
||||
void ViewManager::detachActiveView()
|
||||
{
|
||||
// find the currently active view and remove it from its container
|
||||
@@ -715,6 +729,9 @@ void ViewManager::setNavigationMethod(NavigationMethod method)
|
||||
action = collection->action( "previous-view" );
|
||||
if ( action ) action->setEnabled( _navigationMethod != NoNavigation );
|
||||
|
||||
action = collection->action( "last-tab" );
|
||||
if ( action ) action->setEnabled( _navigationMethod != NoNavigation );
|
||||
|
||||
action = collection->action( "split-view-left-right" );
|
||||
if ( action ) action->setEnabled( _navigationMethod != NoNavigation );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user