summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainwindow.cpp61
-rw-r--r--src/mainwindow.h7
2 files changed, 27 insertions, 41 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 6d5c9c16..c9c915ca 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -94,6 +94,8 @@ MainWindow::MainWindow()
, m_findBar(new FindBar(this))
, m_sidePanel(0)
, m_historyBackMenu(0)
+ , m_bmBar( new KToolBar( QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, true) )
+ , m_mainBar( new KToolBar( QString("MainToolBar"), this, Qt::TopToolBarArea, true, false, false) )
, m_ac( new KActionCollection(this) )
{
// enable window size "auto-save"
@@ -160,34 +162,25 @@ SidePanel *MainWindow::sidePanel()
void MainWindow::setupToolbar()
{
// ============ Main ToolBar ================================
- KToolBar *mainToolBar = new KToolBar( i18n("Main ToolBar"), this, Qt::TopToolBarArea, true, false, false);
- mainToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
- mainToolBar->addAction( actionByName("history_back") );
- mainToolBar->addAction( actionByName("history_forward") );
- mainToolBar->addSeparator();
- mainToolBar->addAction( actionByName("stop_reload") );
- mainToolBar->addAction( actionByName(KStandardAction::name(KStandardAction::Home)) );
- mainToolBar->addAction( actionByName("url_bar") );
- mainToolBar->addAction( actionByName("bookmarksActionMenu") );
- mainToolBar->addAction( actionByName("rekonq_tools") );
+ m_mainBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
+ m_mainBar->addAction( actionByName("history_back") );
+ m_mainBar->addAction( actionByName("history_forward") );
+ m_mainBar->addSeparator();
+ m_mainBar->addAction( actionByName("stop_reload") );
+ m_mainBar->addAction( actionByName(KStandardAction::name(KStandardAction::Home)) );
+ m_mainBar->addAction( actionByName("url_bar") );
+ m_mainBar->addAction( actionByName("bookmarksActionMenu") );
+ m_mainBar->addAction( actionByName("rekonq_tools") );
// =========== Bookmarks ToolBar ================================
- KToolBar *bmToolBar= new KToolBar( i18n("Bookmarks ToolBar"), this, Qt::TopToolBarArea, true, false, true);
- bmToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
- bmToolBar->setIconDimensions(16);
- bmToolBar->setAcceptDrops(true);
- bmToolBar->setContentsMargins(0, 0, 0, 0);
- bmToolBar->setMinimumHeight(16);
- bmToolBar->setContextMenuPolicy(Qt::CustomContextMenu);
-
- Application::bookmarkProvider()->setupBookmarkBar(bmToolBar);
-
- // Bookmarks ToolBar Action
- QAction *a = bmToolBar->toggleViewAction();
- a->setIcon( KIcon("bookmark-toolbar") );
- actionCollection()->addAction(QLatin1String("bm_bar"), a);
-
-// connect(a, SIGNAL(triggered(bool)), this, SLOT(showBookmarkToolBar(bool)));
+ m_bmBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+ m_bmBar->setIconDimensions(16);
+ m_bmBar->setAcceptDrops(true);
+ m_bmBar->setContentsMargins(0, 0, 0, 0);
+ m_bmBar->setMinimumHeight(16);
+ m_bmBar->setContextMenuPolicy(Qt::CustomContextMenu);
+
+ Application::bookmarkProvider()->setupBookmarkBar(m_bmBar);
// KToolBar::setToolBarsEditable(false);
// KToolBar::setToolBarsLocked(true);
@@ -361,9 +354,10 @@ void MainWindow::setupActions()
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)));
+ QAction *qa = m_bmBar->toggleViewAction();
+ qa->setText( i18n("Bookmarks ToolBar") );
+ qa->setIcon( KIcon("bookmark-toolbar") );
+ actionCollection()->addAction(QLatin1String("bm_bar"), qa);
}
@@ -1059,12 +1053,3 @@ 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 fc0af47d..be51bdd2 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -143,8 +143,6 @@ private slots:
void slotAboutToShowBackMenu();
void slotOpenActionUrl(QAction *action);
- void showBookmarkToolBar(bool);
-
private:
MainView *m_view;
FindBar *m_findBar;
@@ -154,7 +152,10 @@ private:
KAction *m_historyBackAction;
KAction *m_historyForwardAction;
KMenu *m_historyBackMenu;
-
+
+ KToolBar *m_bmBar;
+ KToolBar *m_mainBar;
+
QString m_lastSearch;
QString m_homePage;