From 9cbf281f4df98feec4325dac050cc633e3bbfe2f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 30 Dec 2008 16:52:23 +0100 Subject: Fixed FindBar crash && refactored to look like kate searchbar --- src/bookmarks.cpp | 2 +- src/findbar.cpp | 15 +++++++++++---- src/findbar.h | 4 ++-- src/main.cpp | 28 ++++++++++++++-------------- src/mainwindow.cpp | 7 +++---- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index 63d15f7b..3cb65e38 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -55,7 +55,7 @@ QString OwnBookMarks::currentTitle() const } -// ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------------------------- BookmarksMenu::BookmarksMenu(KMainWindow *parent) diff --git a/src/findbar.cpp b/src/findbar.cpp index 73f6c784..382f9b09 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -24,12 +24,12 @@ #include #include #include -#include #include +#include #include -FindBar::FindBar(KMainWindow *parent) +FindBar::FindBar(KXmlGuiWindow *parent) : KToolBar( "FindBar" , parent, Qt::BottomToolBarArea, true, false, false) , m_lineEdit(0) { @@ -47,8 +47,15 @@ FindBar::FindBar(KMainWindow *parent) connect( m_lineEdit, SIGNAL( textEdited(const QString &) ), parent, SLOT( slotFindNext() ) ); addWidget( m_lineEdit ); - addAction( KStandardAction::findNext(parent, SLOT( slotFindNext() ) , this ) ); - addAction( KStandardAction::findPrev(parent, SLOT( slotFindPrevious() ) , this ) ); + KPushButton *findNext = new KPushButton( KIcon("go-down"), "&Next", this ); + KPushButton *findPrev = new KPushButton( KIcon("go-up"), "&Previous", this ); + // perhaps we don't need working on style.. +// findNext->setStyle(); +// findPrev->setStyle(); + connect( findNext, SIGNAL( clicked() ), parent, SLOT( slotFindNext() ) ); + connect( findPrev, SIGNAL( clicked() ), parent, SLOT( slotFindPrevious() ) ); + addWidget( findNext ); + addWidget( findPrev ); // we start off hidden hide(); diff --git a/src/findbar.h b/src/findbar.h index f8ef183e..4c73767c 100644 --- a/src/findbar.h +++ b/src/findbar.h @@ -23,14 +23,14 @@ #include #include -#include +#include class FindBar : public KToolBar { Q_OBJECT public: - FindBar(KMainWindow *parent); + FindBar(KXmlGuiWindow *parent); ~FindBar(); KLineEdit *lineEdit(); diff --git a/src/main.cpp b/src/main.cpp index fb9bf3de..0988b367 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,21 +32,21 @@ static const char version[] = "0.0.2"; int main(int argc, char **argv) { KAboutData about( "rekonq", - 0, - ki18n("rekonq"), - version, - ki18n(description), - KAboutData::License_GPL, - ki18n("(C) 2008 Andrea Diamantini"), - KLocalizedString(), - "http://www.adjam.org", - "adjam7@gmail.com" - ); + 0, + ki18n("rekonq"), + version, + ki18n(description), + KAboutData::License_GPL, + ki18n("(C) 2008 Andrea Diamantini"), + KLocalizedString(), + "http://www.adjam.org", + "adjam7@gmail.com" + ); - about.addAuthor( ki18n("Andrea Diamantini"), - KLocalizedString(), - "adjam7@gmail.com" - ); + about.addAuthor( ki18n("Andrea Diamantini"), + KLocalizedString(), + "adjam7@gmail.com" + ); KCmdLineArgs::init(argc, argv, &about); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d3509e60..7bf44d06 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -67,10 +67,6 @@ MainWindow::MainWindow() // tell the KXmlGuiWindow that this is indeed the main widget setCentralWidget(m_tabWidget); - // Find Bar - m_findBar = new FindBar(this); - connect( m_findBar, SIGNAL( searchString(const QString &) ), this, SLOT( slotFind(const QString &) ) ); - connect(m_tabWidget, SIGNAL( loadPage(const QString &) ), this, SLOT( loadPage(const QString &) ) ); connect(m_tabWidget, SIGNAL( setCurrentTitle(const QString &)), this, SLOT( slotUpdateWindowTitle(const QString &) ) ); connect(m_tabWidget, SIGNAL( showStatusBarMessage(const QString&)), statusBar(), SLOT( showMessage(const QString&) ) ); @@ -112,6 +108,9 @@ MainWindow::MainWindow() connect(m_searchBar, SIGNAL(search(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); navigationBar->addWidget(m_searchBar); + // Find Bar + m_findBar = new FindBar(this); + connect( m_findBar, SIGNAL( searchString(const QString &) ), this, SLOT( slotFind(const QString &) ) ); } -- cgit v1.2.1