summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Rohrbach <fxrh@gmx.de>2011-01-10 21:10:39 +0100
committerFelix Rohrbach <fxrh@gmx.de>2011-01-15 12:13:00 +0100
commitbdf8ed4c678acb07f273fd3b722dd39773348395 (patch)
treeda3780d90278d79d48a63255f04ea4f27fe5b68c
parentFixes as pointed out by Krazy (diff)
downloadrekonq-bdf8ed4c678acb07f273fd3b722dd39773348395.tar.xz
This commit contains the changes to the context menu which we decided in our meeting:
1. Hide new tab entry if it is not necessary. 2. Print and Search action: I removed the print action. The search action is now in the "search with" submenu if some text is selected. 3. Hide the development menu entries and add an option to show them. RB: 100374
-rw-r--r--src/mainwindow.cpp6
-rw-r--r--src/mainwindow.h1
-rw-r--r--src/rekonq.kcfg3
-rw-r--r--src/settings/settings_webkit.ui7
-rw-r--r--src/webview.cpp32
5 files changed, 34 insertions, 15 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 599295f7..13660eb9 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -863,6 +863,12 @@ void MainWindow::updateHighlight()
}
}
+void MainWindow::findSelectedText()
+{
+ // FindBar::setVisible() gets the selected text by itself
+ m_findBar->show();
+}
+
void MainWindow::viewFullScreen(bool makeFullScreen)
{
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 7dfc186b..02cd7237 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -107,6 +107,7 @@ public Q_SLOTS:
void findNext();
void findPrevious();
void updateHighlight();
+ void findSelectedText();
Q_SIGNALS:
// switching tabs
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index cda76d88..c655d359 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -30,6 +30,9 @@
<entry name="recoverOnCrash" type="Int">
<default>0</default>
</entry>
+ <entry name="showDeveloperTools" type="Bool">
+ <default>false</default>
+ </entry>
</group>
diff --git a/src/settings/settings_webkit.ui b/src/settings/settings_webkit.ui
index 58fbe459..00bced99 100644
--- a/src/settings/settings_webkit.ui
+++ b/src/settings/settings_webkit.ui
@@ -120,6 +120,13 @@
</property>
</widget>
</item>
+ <item row="7" column="0">
+ <widget class="QCheckBox" name="kcfg_showDeveloperTools">
+ <property name="text">
+ <string>Show web developer tools</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
diff --git a/src/webview.cpp b/src/webview.cpp
index 49fa1032..d3eb2f49 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -166,13 +166,6 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
menu.addSeparator();
}
- // add find action.
- if(result.pixmap().isNull())
- {
- a = mainwindow->actionByName(KStandardAction::name(KStandardAction::Find));
- menu.addAction(a);
- }
-
// is content editable && selected? Add CUT
if (result.isContentEditable() && result.isContentSelected())
{
@@ -224,8 +217,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
{
menu.addAction(pageAction(KWebPage::Paste));
}
- a = mainwindow->actionByName(KStandardAction::name(KStandardAction::Print));
- menu.addAction(a);
+
// is content selected? Add SEARCH actions
if (result.isContentSelected())
{
@@ -240,6 +232,10 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
searchMenu->addAction(a);
}
+ a = new KAction(KIcon("edit-find"), i18n("On Current Page"), this);
+ connect(a, SIGNAL(triggered()), Application::instance()->mainWindow(), SLOT(findSelectedText()));
+ searchMenu->addAction(a);
+
if (!searchMenu->menu()->isEmpty())
{
menu.addAction(searchMenu);
@@ -247,7 +243,8 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
menu.addSeparator();
- menu.addAction(inspectAction);
+ if (ReKonfig::showDeveloperTools())
+ menu.addAction(inspectAction);
// TODO Add translate, show translation
}
@@ -273,7 +270,8 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
menu.addAction(pageAction(KWebPage::CopyLinkToClipboard));
menu.addSeparator();
- menu.addAction(inspectAction);
+ if (ReKonfig::showDeveloperTools())
+ menu.addAction(inspectAction);
}
// Open url text in new tab/window
@@ -332,7 +330,9 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
{
menu.addSeparator();
- menu.addAction(mainwindow->actionByName("new_tab"));
+ if (!ReKonfig::alwaysShowTabBar() && mainwindow->mainView()->count() == 1)
+ menu.addAction(mainwindow->actionByName("new_tab"));
+
menu.addAction(mainwindow->actionByName("new_window"));
menu.addSeparator();
@@ -362,9 +362,11 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
menu.addAction(a);
}
- menu.addAction(mainwindow->actionByName("page_source"));
-
- menu.addAction(inspectAction);
+ if (ReKonfig::showDeveloperTools())
+ {
+ menu.addAction(mainwindow->actionByName("page_source"));
+ menu.addAction(inspectAction);
+ }
a = Application::bookmarkProvider()->actionByName("rekonq_add_bookmark");
menu.addAction(a);