summaryrefslogtreecommitdiff
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
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!
-rw-r--r--src/mainwindow.cpp30
-rw-r--r--src/mainwindow.h2
-rw-r--r--src/rekonqui.rc4
3 files changed, 30 insertions, 6 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);
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index c8ce7673..f49a0615 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -68,6 +68,8 @@ private:
void setupActions();
void setupHistoryMenu();
void setupBars();
+ void setupTools();
+
void setupSidePanel();
SidePanel *sidePanel();
diff --git a/src/rekonqui.rc b/src/rekonqui.rc
index dfb7aef7..f91daafd 100644
--- a/src/rekonqui.rc
+++ b/src/rekonqui.rc
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
-<gui name="rekonq" version="43">
+<gui name="rekonq" version="44">
<MenuBar>
@@ -89,7 +89,7 @@
<Action name="go_home" />
<Action name="url_bar" />
<Action name="bookmarksActionMenu" />
- <Action name="options_configure" />
+ <Action name="rekonq_tools" />
</ToolBar>
<!-- ============ Bookmarks ToolBar =========== -->