summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-04-18 03:24:47 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-04-18 03:24:47 +0200
commitcc6c9e776848b49dc717a8d351d103f3f7be9642 (patch)
treea4e242d5fa35119b59ad2feace8d0df1122a52c5 /src
parentpedantic (diff)
downloadrekonq-cc6c9e776848b49dc717a8d351d103f3f7be9642.tar.xz
clear location bar action. As requested
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp21
-rw-r--r--src/mainwindow.h1
2 files changed, 20 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index b68a6ad1..077a057b 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -162,7 +162,7 @@ void MainWindow::setupToolBars()
// location bar
a = new KAction(i18n("Location Bar"), this);
- a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_L, Qt::Key_F6));
+ a->setShortcut(KShortcut(Qt::Key_F6));
a->setDefaultWidget(m_view->lineEditStack());
actionCollection()->addAction(QLatin1String("url_bar"), a);
@@ -284,6 +284,15 @@ void MainWindow::setupActions()
a->setShortcuts(QApplication::isRightToLeft() ? KStandardShortcut::tabNext() : KStandardShortcut::tabPrev());
actionCollection()->addAction(QLatin1String("show_prev_tab"), a);
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(previousTab()));
+
+ // clear Location Bar action (Henry de Valance WISH)
+ a = new KAction(KIcon("edit-clear-locationbar-rtl"), i18n("Clear Location Bar"), this);
+ a->setShortcut(Qt::CTRL+Qt::Key_L);
+ actionCollection()->addAction(QLatin1String("clear_location"),a);
+ connect(a, SIGNAL(triggered(bool)), this, SLOT(slotClearLocationBar()));
+ a->setWhatsThis(i18n( "<html>Clear Location bar<br /><br />"
+ "Clears the contents of the location bar.</html>" ));
+
}
@@ -841,4 +850,12 @@ bool MainWindow::queryClose()
return true;
}
- \ No newline at end of file
+
+
+void MainWindow::slotClearLocationBar()
+{
+ QLineEdit *lineEdit = m_view->currentLineEdit();
+ lineEdit->clear();
+ lineEdit->setFocus();
+}
+
diff --git a/src/mainwindow.h b/src/mainwindow.h
index a9363d8a..b9b90b5e 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -82,6 +82,7 @@ private slots:
void slotOpenLocation();
void slotAboutToShowBackMenu();
void geometryChangeRequested(const QRect &geometry);
+ void slotClearLocationBar();
// history related
void slotOpenActionUrl(QAction *action);