diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-08-26 01:30:59 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-08-30 01:07:26 +0200 |
commit | 196470f75bba5cd86dba587f9f4f3a9905103e93 (patch) | |
tree | 7c3902c47d21d42e9b031889c7d31a9e23b8340e /src | |
parent | Typo SIGNAL --> SLOT (diff) | |
download | rekonq-196470f75bba5cd86dba587f9f4f3a9905103e93.tar.xz |
First changes to bookmarks system
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks.cpp | 2 | ||||
-rw-r--r-- | src/mainwindow.cpp | 16 | ||||
-rw-r--r-- | src/mainwindow.h | 2 |
3 files changed, 19 insertions, 1 deletions
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 <KToolBar> #include <KJobUiDelegate> #include <kdeprintdialog.h> +#include <KToggleAction> // Qt Includes #include <QtCore/QTimer> @@ -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; |