From 050b861d8f9904d905bc74963780ec5c8f2982a8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 2 Nov 2012 09:55:20 +0100 Subject: Fix and improve rekonq tools menu - added "open" menu (A-LA firefox) with: - new tab - new windown - new incognito window ------ - open (local) file - added "bookmarks" menu with: - add bookmark ---- - show bookmarks page - show bookmarks toolbar - edit bookmarks (maybe, we'll list all bk after a separator there in the future...) - show history && downloads page Obviously checked/fixed all the relative slots finally, added in the menu quit option :D --- src/webwindow/rekonqui.rc | 27 +++++++++++++++++++++------ src/webwindow/webwindow.cpp | 42 +++++++++++++++++++++++++++++++++++------- src/webwindow/webwindow.h | 2 ++ 3 files changed, 58 insertions(+), 13 deletions(-) diff --git a/src/webwindow/rekonqui.rc b/src/webwindow/rekonqui.rc index 798f6d4e..c6d28455 100644 --- a/src/webwindow/rekonqui.rc +++ b/src/webwindow/rekonqui.rc @@ -1,14 +1,18 @@ - + - - - + + &Open + + + + + + - @@ -37,7 +41,16 @@ - + + &Bookmarks + + + + + + + + @@ -57,6 +70,8 @@ + + diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp index 697ecba7..06f0ffac 100644 --- a/src/webwindow/webwindow.cpp +++ b/src/webwindow/webwindow.cpp @@ -209,21 +209,34 @@ void WebWindow::setupActions() KStandardAction::quit(rApp, SLOT(queryQuit()), actionCollection()); // Bookmark Toolbar - a = new KAction(KIcon("bookmarks-bar"), i18n("Bookmarks Toolbar"), this); + a = new KAction(KIcon("bookmark-toolbar"), i18n("Bookmarks Toolbar"), this); a->setCheckable(true); a->setChecked(ReKonfig::showBookmarksToolbar()); 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); + // Open special pages + // Home + a = actionCollection()->addAction(KStandardAction::Home); + connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(openHomePage(Qt::MouseButtons, Qt::KeyboardModifiers))); + + // Downloads + a = new KAction(KIcon("download"), i18n("Downloads page"), 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))); + // History + a = new KAction(KIcon("view-history"), i18n("History page"), this); + a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_H)); + actionCollection()->addAction(QL1S("open_history_page"), a); + connect(a, SIGNAL(triggered(bool)), this, SLOT(openHistoryPage())); + + // Bookmarks + a = new KAction(KIcon("bookmarks"), i18n("Bookmarks page"), this); + a->setShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_B)); + actionCollection()->addAction(QL1S("open_bookmarks_page"), a); + connect(a, SIGNAL(triggered(bool)), this, SLOT(openBookmarksPage())); // find action a = KStandardAction::find(m_findBar, SLOT(show()), actionCollection()); @@ -285,6 +298,9 @@ void WebWindow::setupActions() KShortcut bkShortcut(Qt::CTRL + Qt::Key_D); a->setShortcut(bkShortcut); + // Edit bookmarks + a = KStandardAction::editBookmarks(BookmarkManager::self(), SLOT(slotEditBookmarks()), actionCollection()); + // User Agent a = new KAction(KIcon("preferences-web-browser-identification"), i18n("Browser Identification"), this); actionCollection()->addAction(QL1S("useragent"), a); @@ -924,7 +940,19 @@ void WebWindow::checkFocus() void WebWindow::openDownloadsPage() { - rApp->loadUrl( QUrl("about:downloads"), Rekonq::NewTab ); + rApp->loadUrl( QUrl("about:downloads"), Rekonq::NewFocusedTab ); +} + + +void WebWindow::openHistoryPage() +{ + rApp->loadUrl( QUrl("about:history"), Rekonq::NewFocusedTab ); +} + + +void WebWindow::openBookmarksPage() +{ + rApp->loadUrl( QUrl("about:bookmarks"), Rekonq::NewFocusedTab ); } diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h index ffd65477..c37704d5 100644 --- a/src/webwindow/webwindow.h +++ b/src/webwindow/webwindow.h @@ -128,6 +128,8 @@ private Q_SLOTS: // special pages void openDownloadsPage(); + void openHistoryPage(); + void openBookmarksPage(); void openHomePage(Qt::MouseButtons, Qt::KeyboardModifiers); // Tools Menu slots -- cgit v1.2.1