summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-07-16 01:25:25 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-07-16 01:25:25 +0200
commit01c8a8c3817548ac0c3465b6894582f269980e51 (patch)
tree10b045428596e228027d6817b5603026f717c053 /src/mainwindow.cpp
parentBookmark Action Menu (diff)
downloadrekonq-01c8a8c3817548ac0c3465b6894582f269980e51.tar.xz
New rekonq tools menu in main toolbar.
This is completely based on code and ideas from Lionel "MegaBigBug" Chauvin. Many thanks!
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 65975a3e..5958e4be 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -120,7 +120,7 @@ MainWindow::MainWindow()
// setting up toolbars && location bar: this has to be done BEFORE setupGUI!!
setupBars();
-
+
// Bookmark Menu
KActionMenu *bmMenu = Application::bookmarkProvider()->bookmarkActionMenu();
bmMenu->setIcon(KIcon("rating"));
@@ -130,6 +130,9 @@ MainWindow::MainWindow()
// Side Panel: this has to be done BEFORE setupGUI!!
setupSidePanel();
+ // setting up rekonq tools: to be done BEFORE setupGUI!
+ setupTools();
+
// a call to KXmlGuiWindow::setupGUI() populates the GUI
// with actions, using KXMLGUI.
// It also applies the saved mainwindow settings, if any, and ask the
@@ -316,10 +319,29 @@ 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()));
+}
- // ==================== Bookmarks Actions
-// QAction *ba = Application::bookmarkProvider()->actionByName("rekonq_add_bookmark");
-// actionCollection()->addAction(QLatin1String("rekonq_add_bookmark"), ba);
+
+void MainWindow::setupTools()
+{
+ KActionMenu *toolsMenu = new KActionMenu(KIcon("configure"), i18n("rekonq tools"), this);
+ toolsMenu->setDelayed(false);
+
+ toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::SaveAs)));
+ toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Print)));
+ toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Find)));
+ toolsMenu->addSeparator();
+ toolsMenu->addAction(actionByName(QLatin1String("private_browsing")));
+ toolsMenu->addAction(actionByName(QLatin1String("web_inspector")));
+ toolsMenu->addAction(actionByName(QLatin1String("page_source")));
+ toolsMenu->addSeparator();
+ toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::ShowMenubar)));
+ toolsMenu->addAction(actionByName(QLatin1String("show_history_panel")));
+ toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::FullScreen)));
+ toolsMenu->addSeparator();
+ toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Preferences)));
+
+ actionCollection()->addAction(QLatin1String("rekonq_tools"), toolsMenu);
}