summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-08-21 01:37:43 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-08-21 01:37:43 +0200
commit5227ba5c53fd1a82fe5d369c2a29b2ad32641f5c (patch)
treeb60cce6a11e0d53c2ad65befae0005bb9747f142
parentMerge commit 'refs/merge-requests/182' of git://gitorious.org/rekonq/mainline... (diff)
parentUseless include (diff)
downloadrekonq-5227ba5c53fd1a82fe5d369c2a29b2ad32641f5c.tar.xz
Merge commit 'refs/merge-requests/183' of git://gitorious.org/rekonq/mainline into m183
Conflicts: src/mainwindow.h
-rw-r--r--src/mainwindow.cpp105
-rw-r--r--src/mainwindow.h5
2 files changed, 67 insertions, 43 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 4927ce4e..4f9d6dab 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -110,6 +110,7 @@ MainWindow::MainWindow()
, m_bookmarksBar(0)
, m_popup(new KPassivePopup(this))
, m_hidePopup(new QTimer(this))
+ , m_toolsMenu(0)
{
// creating a centralWidget containing panel, m_view and the hidden findbar
QWidget *centralWidget = new QWidget;
@@ -216,6 +217,9 @@ void MainWindow::initBookmarkBar()
}
m_bookmarksBar = new BookmarkToolBar(XMLGUIBkBar, this);
Application::bookmarkProvider()->registerBookmarkBar(m_bookmarksBar);
+
+ // To update the bookmark toolbar action
+ initToolsMenu();
}
@@ -231,6 +235,58 @@ void MainWindow::configureToolbars()
}
+void MainWindow::initToolsMenu()
+{
+ if (!m_toolsMenu)
+ return;
+
+ m_toolsMenu->menu()->clear();
+
+ m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Open)));
+ m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::SaveAs)));
+ m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Print)));
+ m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Find)));
+
+ QAction *action = actionByName(KStandardAction::name(KStandardAction::Zoom));
+ action->setCheckable(true);
+ connect (m_zoomBar, SIGNAL(visibilityChanged(bool)), action, SLOT(setChecked(bool)));
+ m_toolsMenu->addAction(action);
+
+ m_toolsMenu->addAction(actionByName(QL1S("encodings")));
+
+ m_toolsMenu->addSeparator();
+
+ m_toolsMenu->addAction(actionByName(QL1S("private_browsing")));
+ m_toolsMenu->addAction(actionByName(QL1S("clear_private_data")));
+
+ m_toolsMenu->addSeparator();
+
+ KActionMenu *webMenu = new KActionMenu(KIcon("applications-development-web"), i18n("Development"), this);
+ webMenu->addAction(actionByName(QL1S("web_inspector")));
+ webMenu->addAction(actionByName(QL1S("page_source")));
+ webMenu->addAction(actionByName(QL1S("net_analyzer")));
+ m_toolsMenu->addAction(webMenu);
+
+ m_toolsMenu->addSeparator();
+
+ action = m_bookmarksBar->toolBar()->toggleViewAction();
+ action->setText(i18n("Bookmarks Toolbar"));
+ action->setIcon(KIcon("bookmarks-bar"));
+ m_toolsMenu->addAction(action);
+
+ m_toolsMenu->addAction(actionByName(QL1S("show_history_panel")));
+ m_toolsMenu->addAction(actionByName(QL1S("show_bookmarks_panel")));
+ m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::FullScreen)));
+
+ m_toolsMenu->addSeparator();
+
+ this->setHelpMenuEnabled(true);
+ helpMenu()->setIcon(KIcon("help-browser"));
+ m_toolsMenu->addAction(helpMenu()->menuAction());
+ m_toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Preferences)));
+}
+
+
void MainWindow::postLaunch()
{
setupBookmarksAndToolsShortcuts();
@@ -464,50 +520,15 @@ void MainWindow::setupActions()
void MainWindow::setupTools()
{
kDebug() << "setup tools...";
- KActionMenu *toolsMenu = new KActionMenu(KIcon("configure"), i18n("&Tools"), this);
- toolsMenu->setDelayed(false);
- toolsMenu->setShortcutConfigurable(true);
- toolsMenu->setShortcut( KShortcut(Qt::ALT + Qt::Key_T) );
-
- toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Open)));
- toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::SaveAs)));
- toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Print)));
- toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Find)));
-
- QAction *action = actionByName(KStandardAction::name(KStandardAction::Zoom));
- action->setCheckable(true);
- connect (m_zoomBar, SIGNAL(visibilityChanged(bool)), action, SLOT(setChecked(bool)));
- toolsMenu->addAction(action);
-
- toolsMenu->addAction(actionByName(QL1S("encodings")));
-
- toolsMenu->addSeparator();
-
- toolsMenu->addAction(actionByName(QL1S("private_browsing")));
- toolsMenu->addAction(actionByName(QL1S("clear_private_data")));
-
- toolsMenu->addSeparator();
-
- KActionMenu *webMenu = new KActionMenu(KIcon("applications-development-web"), i18n("Development"), this);
- webMenu->addAction(actionByName(QL1S("web_inspector")));
- webMenu->addAction(actionByName(QL1S("page_source")));
- webMenu->addAction(actionByName(QL1S("net_analyzer")));
- toolsMenu->addAction(webMenu);
-
- toolsMenu->addSeparator();
-
- toolsMenu->addAction(actionByName(QL1S("show_history_panel")));
- toolsMenu->addAction(actionByName(QL1S("show_bookmarks_panel")));
- toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::FullScreen)));
-
- toolsMenu->addSeparator();
-
- helpMenu()->setIcon(KIcon("help-browser"));
- toolsMenu->addAction(helpMenu()->menuAction());
- toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Preferences)));
+ m_toolsMenu = new KActionMenu(KIcon("configure"), i18n("&Tools"), this);
+ m_toolsMenu->setDelayed(false);
+ m_toolsMenu->setShortcutConfigurable(true);
+ m_toolsMenu->setShortcut( KShortcut(Qt::ALT + Qt::Key_T) );
// adding rekonq_tools to rekonq actionCollection
- actionCollection()->addAction(QL1S("rekonq_tools"), toolsMenu);
+ actionCollection()->addAction(QL1S("rekonq_tools"), m_toolsMenu);
+
+ // Actions are added after the call to setupGUI() to ensure the help menu works
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index eeb58171..3aa57f5c 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -167,7 +167,8 @@ private slots:
void enableNetworkAnalysis(bool);
void initBookmarkBar();
-
+ void initToolsMenu();
+
private:
MainView *m_view;
FindBar *m_findBar;
@@ -188,6 +189,8 @@ private:
KPassivePopup *m_popup;
QTimer *m_hidePopup;
+
+ KActionMenu *m_toolsMenu;
};
#endif // MAINWINDOW_H