summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorNikhil Marathe <nsm.nikhil@gmail.com>2010-05-24 16:48:49 +0530
committerNikhil Marathe <nsm.nikhil@gmail.com>2010-05-24 16:48:49 +0530
commit9dc07f24c01c152d23c22cefab50db43fe517e95 (patch)
tree1e34e1f6724306f34279694435478b450bfa6781 /src/mainwindow.cpp
parentrekonq 0.4.71 (diff)
downloadrekonq-9dc07f24c01c152d23c22cefab50db43fe517e95.tar.xz
Added actions to switch to Tab #n
BUG: 235107
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f5be73ee..d14f2254 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -398,6 +398,16 @@ void MainWindow::setupActions()
closedTabsMenu->setDelayed(false);
actionCollection()->addAction(QL1S("closed_tab_menu"), closedTabsMenu);
+ // shortcuts for quickly switching to a tab
+ for( int i = 1; i <= 9; i++ ) {
+ a = new KAction(i18n("Switch to Tab %1", i), this);
+ a->setShortcut(KShortcut( QString("Alt+%1").arg(i) ));
+ a->setData( QVariant(i) );
+ actionCollection()->addAction(QL1S(("switch_tab_" + QString::number(i)).toAscii()), a);
+ connect(a, SIGNAL(triggered(bool)), m_view, SLOT(switchToTab()));
+ }
+
+
// ============================== Indexed Tab Actions ====================================
a = new KAction(KIcon("tab-close"), i18n("&Close Tab"), this);
actionCollection()->addAction(QL1S("close_tab"), a);