summaryrefslogtreecommitdiff
path: root/src/webwindow
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-10-25 19:39:10 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commit847153eead1f136dda86629994b1f32eeebb459c (patch)
treed30cba1d2a902bd65eb8878f160511999ed9e2ee /src/webwindow
parentFix focus handling on views (diff)
downloadrekonq-847153eead1f136dda86629994b1f32eeebb459c.tar.xz
Fix/add missing rekonq actions & shortcuts
Diffstat (limited to 'src/webwindow')
-rw-r--r--src/webwindow/rekonqui.rc12
-rw-r--r--src/webwindow/webwindow.cpp32
-rw-r--r--src/webwindow/webwindow.h4
3 files changed, 40 insertions, 8 deletions
diff --git a/src/webwindow/rekonqui.rc b/src/webwindow/rekonqui.rc
index ef6294a4..798f6d4e 100644
--- a/src/webwindow/rekonqui.rc
+++ b/src/webwindow/rekonqui.rc
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
-<gui name="rekonq" version="64">
+<gui name="rekonq" version="65">
<!--- =========== Rekonq Menu ============= -->
<Menu name="rekonqMenu" noMerge="1">
@@ -29,7 +29,6 @@
<Action name="webapp_shortcut" />
<Action name="web_inspector" />
<Action name="page_source" />
- <Action name="net_analyzer" />
<Action name="set_editable" />
<Separator/>
<Action name="useragent" />
@@ -38,9 +37,9 @@
</Menu>
<Separator/>
- <Action name="show_history_panel" />
<Action name="show_bookmarks_toolbar" />
- <Action name="show_bookmarks_panel" />
+ <Action name="open_downloads_page" />
+ <Separator/>
<Action name="fullscreen" />
<Separator/>
@@ -69,11 +68,10 @@
<Action name="open_location" />
<Separator/>
<Action name="new_tab" />
- <Action name="close_tab" />
+ <Action name="new_window" />
<Separator/>
<Action name="file_save_as" />
<Separator/>
- <Action name="file_print_preview" />
<Action name="file_print" />
<Separator/>
<Action name="file_quit" />
@@ -123,7 +121,6 @@
<Action name="private_browsing" />
<Action name="clear_private_data" />
<Action name="page_source" />
- <Action name="net_analyzer" />
<Action name="set_editable" />
<Separator/>
<Action name="useragent" />
@@ -132,7 +129,6 @@
<!-- ============ SETTINGS menu =========== -->
<Menu name="settings" noMerge="1"><text>&amp;Settings</text>
- <Action name="options_show_menubar" />
<Merge name="StandardToolBarMenuHandler" />
<Merge/>
<Separator/>
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp
index 188b4eed..5bb89dc4 100644
--- a/src/webwindow/webwindow.cpp
+++ b/src/webwindow/webwindow.cpp
@@ -160,6 +160,9 @@ WebWindow::~WebWindow()
void WebWindow::setupActions()
{
+ // this let shortcuts work..
+ actionCollection()->addAssociatedWidget(this);
+
KAction *a;
// ========================= History related actions ==============================
@@ -212,6 +215,16 @@ void WebWindow::setupActions()
actionCollection()->addAction(QL1S("show_bookmarks_toolbar"), a);
connect(a, SIGNAL(toggled(bool)), this, SLOT(toggleBookmarksToolbar(bool)));
+ // Open Downloads page
+ a = new KAction(KIcon("download"), i18n("Downloads"), this);
+ a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_J));
+ actionCollection()->addAction(QL1S("open_downloads_page"), a);
+ connect(a, SIGNAL(triggered(bool)), this, SLOT(openDownloadsPage()));
+
+ // Open Home Page
+ a = actionCollection()->addAction(KStandardAction::Home);
+ connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(openHomePage(Qt::MouseButtons, Qt::KeyboardModifiers)));
+
// find action
a = KStandardAction::find(m_findBar, SLOT(show()), actionCollection());
KShortcut findShortcut = KStandardShortcut::find();
@@ -903,3 +916,22 @@ void WebWindow::checkFocus()
else
_tab->view()->setFocus();
}
+
+
+void WebWindow::openDownloadsPage()
+{
+ rApp->loadUrl( QUrl("about:downloads"), Rekonq::NewTab );
+}
+
+
+void WebWindow::openHomePage(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
+{
+ KUrl homeUrl = ReKonfig::useNewTabPage()
+ ? KUrl(QL1S("about:home"))
+ : KUrl(ReKonfig::homePage());
+
+ if (buttons == Qt::MidButton || modifiers == Qt::ControlModifier)
+ rApp->loadUrl(homeUrl, Rekonq::NewTab);
+ else
+ load(homeUrl);
+}
diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h
index 2a729a1a..d955e814 100644
--- a/src/webwindow/webwindow.h
+++ b/src/webwindow/webwindow.h
@@ -126,6 +126,10 @@ private Q_SLOTS:
// bookmarks bar
void toggleBookmarksToolbar(bool);
+ // special pages
+ void openDownloadsPage();
+ void openHomePage(Qt::MouseButtons, Qt::KeyboardModifiers);
+
// Tools Menu slots
void viewPageSource();