summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-28 00:58:42 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-10-28 00:58:42 +0100
commit6ab095181e81be314df4dbd39a0bab4318ec15eb (patch)
treefd59a59078a10eaf1a89d019415bf73386a5237c
parentMerge commit 'refs/merge-requests/1938' of git://gitorious.org/rekonq/mainlin... (diff)
downloadrekonq-6ab095181e81be314df4dbd39a0bab4318ec15eb.tar.xz
Restoring CTRL + W shortcut (close tab)
-rw-r--r--src/mainwindow.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index d09bb490..e6543e86 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -362,7 +362,6 @@ void MainWindow::setupActions()
// ============================== Indexed Tab Actions ====================================
a = new KAction(KIcon("tab-close"), i18n("&Close Tab"), this);
- a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_W));
actionCollection()->addAction(QLatin1String("close_tab"), a);
connect(a, SIGNAL(triggered(bool)), m_view->tabBar(), SLOT(closeTab()));
@@ -892,24 +891,34 @@ bool MainWindow::queryClose()
void MainWindow::keyPressEvent(QKeyEvent *event)
{
+ // hide findbar
if (event->key() == Qt::Key_Escape)
{
m_findBar->hide();
return;
}
+ // ctrl + tab action
if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_Tab))
{
emit ctrlTabPressed();
return;
}
+ // shift + ctrl + tab action
if ((event->modifiers() == Qt::ControlModifier + Qt::ShiftModifier) && (event->key() == Qt::Key_Backtab))
{
emit shiftCtrlTabPressed();
return;
}
+ // close current tab action
+ if ((event->modifiers() == Qt::ControlModifier) && event->key() == Qt::Key_W)
+ {
+ m_view->slotCloseTab(m_view->currentIndex());
+ return;
+ }
+
KMainWindow::keyPressEvent(event);
}