summaryrefslogtreecommitdiff
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
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..
-rw-r--r--src/bookmarks.cpp12
-rw-r--r--src/bookmarks.h8
-rw-r--r--src/mainwindow.cpp24
-rw-r--r--src/mainwindow.h5
-rw-r--r--src/rekonqui.rc18
5 files changed, 33 insertions, 34 deletions
diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp
index a83fbdab..08ece82a 100644
--- a/src/bookmarks.cpp
+++ b/src/bookmarks.cpp
@@ -58,22 +58,22 @@ QString OwnBookMarks::currentTitle() const
//---------------------------------------------------------------------------------------------------------------------
-BookmarksMenu::BookmarksMenu(KMainWindow *parent)
+BookmarksMenu::BookmarksMenu(KMainWindow *parent, KBookmarkManager *manager)
: KMenu(parent)
- , m_owner( new OwnBookMarks( parent ) )
+ , m_owner( new OwnBookMarks(parent) )
{
- KUrl bookfile = KUrl( "~/.kde/share/apps/konqueror/bookmarks.xml" ); // share konqueror bookmarks
- m_manager = KBookmarkManager::managerForExternalFile( bookfile.path() );
+// KUrl bookfile = KUrl( "~/.kde/share/apps/konqueror/bookmarks.xml" ); // share konqueror bookmarks
+// m_manager = KBookmarkManager::managerForExternalFile( bookfile.path() );
m_ac = new KActionCollection( this );
- m_menu = new KBookmarkMenu( m_manager , m_owner, this, m_ac );
+ m_menu = new KBookmarkMenu( manager , m_owner, this, m_ac );
}
//---------------------------------------------------------------------------------------------------------------------
-BookmarksLine::BookmarksLine(QObject *parent, KToolBar *toolbar)
+BookmarksLine::BookmarksLine(KBookmarkManager *manager, KToolBar *toolbar)
{
}
diff --git a/src/bookmarks.h b/src/bookmarks.h
index 490f8ee2..5aa384a1 100644
--- a/src/bookmarks.h
+++ b/src/bookmarks.h
@@ -56,10 +56,9 @@ class BookmarksMenu : public KMenu
{
Q_OBJECT
public:
- BookmarksMenu(KMainWindow * parent);
+ BookmarksMenu(KMainWindow*, KBookmarkManager *);
private:
- KBookmarkManager *m_manager;
OwnBookMarks *m_owner;
KActionCollection *m_ac;
KBookmarkMenu *m_menu;
@@ -71,8 +70,11 @@ class BookmarksLine : public QObject
{
Q_OBJECT
public:
- BookmarksLine(QObject *parent, KToolBar *toolbar);
+ BookmarksLine(KBookmarkManager *, KToolBar *toolbar);
+private:
+ OwnBookMarks *m_owner;
+ KActionCollection *m_ac;
};
#endif
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&)));
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 8b8f1cbe..476a6fe6 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -26,6 +26,7 @@
#include "findbar.h"
#include "searchbar.h"
#include "mainview.h"
+#include "bookmarks.h"
// KDE Includes
#include <KUrl>
@@ -61,7 +62,7 @@ public:
private:
void setupActions();
- void setupCustomMenu();
+ void setupHistoryMenu();
void setupTabBar();
public slots:
@@ -121,6 +122,8 @@ private:
KMenu *m_historyBackMenu;
KMenu *m_windowMenu;
+ KBookmarkManager *m_manager;
+
QAction *m_stopReload;
QString m_lastSearch;
diff --git a/src/rekonqui.rc b/src/rekonqui.rc
index 4e2c766e..256d59b2 100644
--- a/src/rekonqui.rc
+++ b/src/rekonqui.rc
@@ -1,5 +1,5 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="rekonq" version="16">
+<kpartgui name="rekonq" version="21">
<MenuBar>
<!-- ============ FILE menu =========== -->
<Menu name="file" noMerge="1"><text>&amp;File</text>
@@ -44,7 +44,6 @@
<Action name="smaller font" />
<Separator/>
<Action name="page source" />
- <Action name="fullscreen" />
</Menu>
<!-- ============ GO menu =========== -->
<Menu name="go" deleted="true">
@@ -57,17 +56,8 @@
<Action name="web inspector" />
</Menu>
<!-- ============ SETTINGS menu =========== -->
-<Menu name="settings" noMerge="1">
- <text>&amp;Settings</text>
- <!--
- Disable merging because we do not want the "fullscreen" action to appear
- here, since it is already in the "view" menu.
- -->
- <Action name="options_show_menubar"/>
- <Action name="options_configure_keybinding"/>
- <Action name="options_configure_toolbars"/>
- <Action name="options_configure"/>
-</Menu>
+<Menu name="settings">
+</Menu>
</MenuBar>
<!-- ============ Main ToolBar =========== -->
@@ -79,7 +69,7 @@
</ToolBar>
<!-- ============ Bookmarks ToolBar =========== -->
-<ToolBar name="bookmarksToolBar" fullWidth="true" iconText="iconOnly" position="top" noMerge="1"><text>Bookmarks Toolbar</text>
+<ToolBar name="bookmarksToolBar" fullWidth="true" iconText="icontextright" newline="true" position="top" noMerge="1"><text>Bookmarks Toolbar</text>
</ToolBar>
</kpartgui>