From 196470f75bba5cd86dba587f9f4f3a9905103e93 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 26 Aug 2009 01:30:59 +0200 Subject: First changes to bookmarks system --- src/bookmarks.cpp | 2 +- src/mainwindow.cpp | 16 ++++++++++++++++ src/mainwindow.h | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index 94f93f9b..fae94b35 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -186,7 +186,7 @@ BookmarkProvider::~BookmarkProvider() void BookmarkProvider::setupToolBar() { - m_bookmarkToolBar = new KToolBar(m_parent); + m_bookmarkToolBar = new KToolBar("bmToolBar", m_parent, Qt::TopToolBarArea); m_bookmarkToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_bookmarkToolBar->setIconDimensions(16); m_bookmarkToolBar->setAcceptDrops(true); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 845cdd38..2a733c63 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -66,6 +66,7 @@ #include #include #include +#include // Qt Includes #include @@ -343,6 +344,11 @@ void MainWindow::setupActions() a = new KAction(KIcon("edit-clear"), i18n("Clear Private Data..."), this); actionCollection()->addAction(QLatin1String("clear_private_data"), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(clearPrivateData())); + + // Bookmarks ToolBar Action + a = new KToggleAction(KIcon("bookmark-toolbar"), i18n("Bookmark ToolBar"), this); + actionCollection()->addAction(QLatin1String("bm_bar"), a); + connect(a, SIGNAL(triggered(bool)), this, SLOT(showBookmarkToolBar(bool))); } @@ -375,6 +381,7 @@ void MainWindow::setupTools() toolsMenu->addSeparator(); + toolsMenu->addAction(actionByName(QLatin1String("bm_bar"))); toolsMenu->addAction(actionByName(QLatin1String("show_history_panel"))); toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::FullScreen))); @@ -1037,3 +1044,12 @@ void MainWindow::slotOpenActionUrl(QAction *action) } } } + + +void MainWindow::showBookmarkToolBar(bool show) +{ + if(show) + toolBar("bmToolBar")->show(); + else + toolBar("bmToolBar")->hide(); +} \ No newline at end of file diff --git a/src/mainwindow.h b/src/mainwindow.h index ded44790..fc0af47d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -143,6 +143,8 @@ private slots: void slotAboutToShowBackMenu(); void slotOpenActionUrl(QAction *action); + void showBookmarkToolBar(bool); + private: MainView *m_view; FindBar *m_findBar; -- cgit v1.2.1