summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-08-20 19:15:23 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-08-20 19:15:23 +0200
commit52bf222bf033f6bbcd15cfe2012a51a194d475d8 (patch)
treed2e839ccbdf38c930d145d4d8dd23897bbc43666 /src/mainwindow.cpp
parentKrazy fixes, first bunch (diff)
parent- The bookmark toolbar is now a real toolbar, not an action. (diff)
downloadrekonq-52bf222bf033f6bbcd15cfe2012a51a194d475d8.tar.xz
Merge commit 'refs/merge-requests/181' of git://gitorious.org/rekonq/mainline into m181
Conflicts: src/bookmarks/bookmarkstoolbar.h
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp40
1 files changed, 32 insertions, 8 deletions
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 <KShortcut>
#include <KStandardAction>
#include <KAction>
+#include <KEditToolBar>
#include <KToggleFullScreenAction>
#include <KActionCollection>
#include <KMessageBox>
@@ -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();
}