summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-01-27 17:33:26 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-01-27 17:33:26 +0100
commitde1b2a26f7eaebd3fa1fa2eeb30f4e26afb534fe (patch)
tree386f9d8e8ed4ee6d7566ef34db20379cdb9d0073 /src/mainwindow.cpp
parentWe now have the FINAL search bar!! Yeah!!! (diff)
downloadrekonq-de1b2a26f7eaebd3fa1fa2eeb30f4e26afb534fe.tar.xz
Fixed MenuBar.
Fixed BookmarkLine in rekonqui.rc Now we need just the code to implement it..
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 10d6f8ce..0d93ea60 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -63,6 +63,7 @@
MainWindow::MainWindow()
: KXmlGuiWindow()
, m_view( new MainView(this) )
+ , m_manager(0)
{
// accept dnd
setAcceptDrops(true);
@@ -107,6 +108,16 @@ MainWindow::MainWindow()
// add a status bar
statusBar()->show();
+ // ----- BOOKMARKS MENU: this has to be done BEFORE setupGUI!!
+ KUrl bookfile = KUrl( "~/.kde/share/apps/konqueror/bookmarks.xml" ); // share konqueror bookmarks
+ m_manager = KBookmarkManager::managerForExternalFile( bookfile.path() );
+
+ KAction *a = new KActionMenu( i18n("B&ookmarks"), this );
+ actionCollection()->addAction( QLatin1String("bookmarks"), a );
+ BookmarksMenu *bookmarksMenu = new BookmarksMenu( this, m_manager );
+ a->setMenu( bookmarksMenu );
+
+
// a call to KXmlGuiWindow::setupGUI() populates the GUI
// with actions, using KXMLGUI.
// It also applies the saved mainwindow settings, if any, and ask the
@@ -114,8 +125,8 @@ MainWindow::MainWindow()
// toolbar position, icon size, etc.
setupGUI();
- // setup history & bookmarks menus
- setupCustomMenu();
+ // setup history menu
+ setupHistoryMenu();
// setup Tab Bar
setupTabBar();
@@ -207,12 +218,6 @@ void MainWindow::setupActions()
actionCollection()->addAction( QLatin1String("web inspector"), a );
connect( a, SIGNAL( triggered(bool) ), this, SLOT( slotToggleInspector(bool) ) );
- // ================== BOOKMARKS MENU
- a = new KActionMenu( i18n("B&ookmarks"), this );
- actionCollection()->addAction( QLatin1String("bookmarks"), a );
- BookmarksMenu *bookmarksMenu = new BookmarksMenu( this );
- a->setMenu( bookmarksMenu );
-
// ================ history related actions
KAction *historyBack = new KAction( KIcon("go-previous"), i18n("Back"), this);
m_historyBackMenu = new KMenu(this);
@@ -267,9 +272,8 @@ void MainWindow::setupTabBar()
}
-void MainWindow::setupCustomMenu()
+void MainWindow::setupHistoryMenu()
{
- // -------------------------------- HISTORY MENU -----------------------------------------------------------------------
HistoryMenu *historyMenu = new HistoryMenu(this);
connect(historyMenu, SIGNAL(openUrl(const KUrl&)), m_view, SLOT(loadUrlInCurrentTab(const KUrl&)));
connect(historyMenu, SIGNAL(hovered(const QString&)), this, SLOT(slotUpdateStatusbar(const QString&)));