From 79ad6230fd3a99e13ed5ee18cba10c90cff3ee5c Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Fri, 20 Aug 2010 15:30:03 +0200 Subject: - The bookmark toolbar is now a real toolbar, not an action. It fixes the problem of the submenu if there are too much items to fit on the bar - Improve a bit the new redesign of BookmarkOwner - Reenable the bookmark menu by default (because the icon in the bar is on the left) --- src/mainwindow.cpp | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1479e477..f0cb5e61 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -106,7 +107,7 @@ MainWindow::MainWindow() , m_analyzerPanel(0) , m_historyBackMenu(0) , m_encodingMenu(new KMenu(this)) - , m_bookmarksBar(new BookmarkToolBar(QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, true)) + , m_bookmarksBar(0) , m_popup(new KPassivePopup(this)) , m_hidePopup(new QTimer(this)) { @@ -198,15 +199,35 @@ void MainWindow::setupToolbars() KToolBar *mainBar = toolBar("mainToolBar"); - // bookmarks bar - KAction *bookmarkBarAction = Application::bookmarkProvider()->bookmarkToolBarAction(m_bookmarksBar); - a = actionCollection()->addAction( QL1S("bookmarks_bar"), bookmarkBarAction); - mainBar->show(); // this just to fix reopening rekonq after fullscreen close +} + + +void MainWindow::initBookmarkBar() +{ + KToolBar *XMLGUIBkBar = toolBar("bookmarkToolBar"); + if (!XMLGUIBkBar) + return; + + if (m_bookmarksBar) + { + Application::bookmarkProvider()->removeToolBar(m_bookmarksBar); + delete m_bookmarksBar; + } + m_bookmarksBar = new BookmarkToolBar(XMLGUIBkBar, this); + Application::bookmarkProvider()->registerBookmarkBar(m_bookmarksBar); +} + - // =========== Bookmarks ToolBar ================================ - m_bookmarksBar->setAcceptDrops(true); - Application::bookmarkProvider()->setupBookmarkBar(m_bookmarksBar); +void MainWindow::configureToolbars() +{ + if (autoSaveSettings()) + saveAutoSaveSettings(); + + KEditToolBar dlg(factory(), this); + // The bookmark bar needs to be refill after the UI changes are finished + connect(&dlg, SIGNAL(newToolBarConfig()), this, SLOT(initBookmarkBar())); + dlg.exec(); } @@ -253,6 +274,9 @@ void MainWindow::postLaunch() // accept d'n'd setAcceptDrops(true); + + // Bookmark ToolBar (needs to be setup after the call to setupGUI()) + initBookmarkBar(); } -- cgit v1.2.1