From 96bd94c88f238fe06ddf5e772bcbe084405cc252 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 27 Jan 2009 01:41:30 +0100 Subject: 1st introduction of new bookmarks line --- src/bookmarks.cpp | 8 ++++++++ src/bookmarks.h | 10 ++++++++++ src/rekonqui.rc | 7 +++++-- 3 files changed, 23 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index 3cb65e38..a83fbdab 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -69,3 +69,11 @@ BookmarksMenu::BookmarksMenu(KMainWindow *parent) m_menu = new KBookmarkMenu( m_manager , m_owner, this, m_ac ); } + + +//--------------------------------------------------------------------------------------------------------------------- + + +BookmarksLine::BookmarksLine(QObject *parent, KToolBar *toolbar) +{ +} diff --git a/src/bookmarks.h b/src/bookmarks.h index e0e49c78..490f8ee2 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -50,6 +50,7 @@ private: MainWindow *m_parent; }; +// ------------------------------------------------------------------------------ class BookmarksMenu : public KMenu { @@ -64,5 +65,14 @@ private: KBookmarkMenu *m_menu; }; +// ------------------------------------------------------------------------------ + +class BookmarksLine : public QObject +{ +Q_OBJECT +public: + BookmarksLine(QObject *parent, KToolBar *toolbar); + +}; #endif diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 3a9ab682..4e2c766e 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -1,5 +1,5 @@ - + &File @@ -71,7 +71,6 @@ - Main Toolbar @@ -79,4 +78,8 @@ + +Bookmarks Toolbar + + -- cgit v1.2.1 From feb5472021e697aa2722806a4a46ec56dfa1579f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 27 Jan 2009 12:21:11 +0100 Subject: We now have the FINAL search bar!! Yeah!!! --- src/findbar.cpp | 54 ++++++++++++++++++++++++++++++++++-------------------- src/findbar.h | 5 ++--- src/mainwindow.cpp | 25 +++++++++++++++++-------- 3 files changed, 53 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/findbar.cpp b/src/findbar.cpp index 6ba310ca..e3f4b231 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -33,33 +33,47 @@ #include -FindBar::FindBar(KXmlGuiWindow *parent) - : KToolBar( "findBar" , parent, Qt::BottomToolBarArea, true, false, false) +FindBar::FindBar(KXmlGuiWindow *mainwindow) + : QWidget() , m_lineEdit(0) { - KAction *close = new KAction(KIcon("dialog-close") , "close" , this); - connect( close , SIGNAL( triggered() ), this, SLOT( hide() ) ); - addAction( close ); + QHBoxLayout *layout = new QHBoxLayout; - QLabel *label = new QLabel("Find: "); - addWidget( label ); + // cosmetic + layout->setMargin(2); + + // hide button + QToolButton *hideButton = new QToolButton(this); + hideButton->setAutoRaise(true); + hideButton->setIcon(KIcon("dialog-close")); + connect(hideButton, SIGNAL(clicked()), this, SLOT(hide())); + layout->addWidget(hideButton); + layout->setAlignment( hideButton, Qt::AlignLeft|Qt::AlignTop ); - m_lineEdit = new KLineEdit(); - m_lineEdit->setMaximumWidth( 200 ); + // label + QLabel *label = new QLabel("Find: "); + layout->addWidget(label); - connect( m_lineEdit, SIGNAL( returnPressed() ), parent, SLOT( slotFindNext() ) ); - connect( m_lineEdit, SIGNAL( textEdited(const QString &) ), parent, SLOT( slotFindNext() ) ); - addWidget( m_lineEdit ); + // lineEdit, focusProxy + m_lineEdit = new KLineEdit(this); + setFocusProxy(m_lineEdit); + m_lineEdit->setMaximumWidth( 250 ); + connect( m_lineEdit, SIGNAL( returnPressed() ), mainwindow, SLOT( slotFindNext() ) ); + connect( m_lineEdit, SIGNAL( textEdited(const QString &) ), mainwindow, SLOT( slotFindNext() ) ); + layout->addWidget( m_lineEdit ); + // buttons 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 ); + connect( findNext, SIGNAL( clicked() ), mainwindow, SLOT( slotFindNext() ) ); + connect( findPrev, SIGNAL( clicked() ), mainwindow, SLOT( slotFindPrevious() ) ); + layout->addWidget( findNext ); + layout->addWidget( findPrev ); + + // stretching widget on the left + layout->addStretch(); + + setLayout(layout); // we start off hidden hide(); @@ -102,7 +116,7 @@ void FindBar::keyPressEvent(QKeyEvent* event) hide(); return; } - if(event->key() == Qt::Key_Return && ! ( m_lineEdit->text().isEmpty() ) ) + if(event->key() == Qt::Key_Return && !m_lineEdit->text().isEmpty() ) { emit searchString( m_lineEdit->text() ); return; diff --git a/src/findbar.h b/src/findbar.h index d70a9de1..f2c59ce9 100644 --- a/src/findbar.h +++ b/src/findbar.h @@ -25,12 +25,12 @@ #include #include -class FindBar : public KToolBar +class FindBar : public QWidget // KateViewHelpers.h { Q_OBJECT public: - FindBar(KXmlGuiWindow *parent); + FindBar(KXmlGuiWindow *mainwindow); ~FindBar(); KLineEdit *lineEdit(); @@ -46,7 +46,6 @@ signals: private: KLineEdit *m_lineEdit; - QWidget *m_centralWidget; }; #endif diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7a7ec427..10d6f8ce 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -57,6 +57,7 @@ #include #include #include +#include MainWindow::MainWindow() @@ -73,8 +74,18 @@ MainWindow::MainWindow() // creating a new tab m_view->newTab(); - // tell the KXmlGuiWindow that this is indeed the main widget - setCentralWidget(m_view); + // creating a centralWidget containing m_view and the hidden findbar + QWidget *centralWidget = new QWidget; + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(m_view); + + // Find Bar + m_findBar = new FindBar(this); + connect( m_findBar, SIGNAL( searchString(const QString &) ), this, SLOT( slotFind(const QString &) ) ); + layout->addWidget(m_findBar); + + centralWidget->setLayout(layout); + setCentralWidget(centralWidget); // connect signals and slots connect(m_view, SIGNAL( loadUrlPage(const KUrl &) ), this, SLOT( loadUrl(const KUrl &) ) ); @@ -116,10 +127,6 @@ MainWindow::MainWindow() m_searchBar = new SearchBar( this ); 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 &) ) ); } @@ -543,7 +550,9 @@ void MainWindow::slotFind(const QString & search) { m_lastSearch = search; if (!currentTab()->findText(m_lastSearch)) + { slotUpdateStatusbar( QString(m_lastSearch) + i18n(" not found.") ); + } } } @@ -556,7 +565,7 @@ void MainWindow::slotViewFindBar() void MainWindow::slotFindNext() { - if (!currentTab() && !m_lastSearch.isEmpty()) + if (!currentTab() && m_lastSearch.isEmpty()) return; currentTab()->findText(m_lastSearch); } @@ -564,7 +573,7 @@ void MainWindow::slotFindNext() void MainWindow::slotFindPrevious() { - if (!currentTab() && !m_lastSearch.isEmpty()) + if (!currentTab() && m_lastSearch.isEmpty()) return; currentTab()->findText(m_lastSearch, QWebPage::FindBackward); } -- cgit v1.2.1 From de1b2a26f7eaebd3fa1fa2eeb30f4e26afb534fe Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 27 Jan 2009 17:33:26 +0100 Subject: Fixed MenuBar. Fixed BookmarkLine in rekonqui.rc Now we need just the code to implement it.. --- src/bookmarks.cpp | 12 ++++++------ src/bookmarks.h | 8 +++++--- src/mainwindow.cpp | 24 ++++++++++++++---------- src/mainwindow.h | 5 ++++- src/rekonqui.rc | 18 ++++-------------- 5 files changed, 33 insertions(+), 34 deletions(-) (limited to 'src') 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 @@ -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 @@ - + &File @@ -44,7 +44,6 @@ - @@ -57,17 +56,8 @@ - - &Settings - - - - - - + + @@ -79,7 +69,7 @@ -Bookmarks Toolbar +Bookmarks Toolbar -- cgit v1.2.1 From 1024f77ad03ef3d30d8be6aa61542a057a100868 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 28 Jan 2009 00:59:08 +0100 Subject: Removed unuseful "Select All" action. If someone needs it, I can try to implement it one day.. --- src/mainview.cpp | 8 -------- src/mainview.h | 1 - src/mainwindow.cpp | 3 ++- src/mainwindow.h | 5 ++--- src/rekonqui.rc | 4 +--- 5 files changed, 5 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/mainview.cpp b/src/mainview.cpp index 328d3dd1..acef1998 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -171,14 +171,6 @@ void MainView::slotWebPaste() } -void MainView::slotWebSelectAll() -{ - WebView *webView = currentWebView(); - QWebPage *currentParent = webView->webPage(); - // TODO -} - - void MainView::clear() { // clear the recently closed tabs diff --git a/src/mainview.h b/src/mainview.h index 1bb0bf6e..1f443a37 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -112,7 +112,6 @@ public slots: void slotWebCut(); void slotWebCopy(); void slotWebPaste(); - void slotWebSelectAll(); private slots: void currentChanged(int index); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0d93ea60..d956642b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -34,6 +34,8 @@ #include "networkaccessmanager.h" #include "bookmarks.h" #include "webview.h" +#include "mainview.h" +#include "bookmarks.h" // UI Includes #include "ui_passworddialog.h" @@ -173,7 +175,6 @@ void MainWindow::setupActions() KStandardAction::cut( m_view, SLOT( slotWebCut() ), actionCollection() ); KStandardAction::copy( m_view, SLOT( slotWebCopy() ), actionCollection() ); KStandardAction::paste( m_view, SLOT( slotWebPaste() ), actionCollection() ); - KStandardAction::selectAll( m_view, SLOT( slotWebSelectAll() ), actionCollection() ); a = new KAction ( KIcon( "process-stop" ), i18n("&Stop"), this ); a->setShortcut( QKeySequence(Qt::CTRL | Qt::Key_Period) ); diff --git a/src/mainwindow.h b/src/mainwindow.h index 476a6fe6..d1eba1a4 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -25,8 +25,6 @@ // Local Includes #include "findbar.h" #include "searchbar.h" -#include "mainview.h" -#include "bookmarks.h" // KDE Includes #include @@ -37,7 +35,8 @@ #include #include - +class KBookmarkManager; +class MainView; class QWebFrame; class WebView; diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 256d59b2..11897e03 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -1,5 +1,5 @@ - + &File @@ -28,8 +28,6 @@ - - -- cgit v1.2.1 From dc7cc2d262903aac402b7b1841b61d111ce797e8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 28 Jan 2009 01:00:15 +0100 Subject: SOme more bits on bookmarkline.. --- src/bookmarks.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index 08ece82a..a736e378 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -62,11 +62,7 @@ BookmarksMenu::BookmarksMenu(KMainWindow *parent, KBookmarkManager *manager) : KMenu(parent) , m_owner( new OwnBookMarks(parent) ) { -// 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( manager , m_owner, this, m_ac ); } @@ -76,4 +72,11 @@ BookmarksMenu::BookmarksMenu(KMainWindow *parent, KBookmarkManager *manager) BookmarksLine::BookmarksLine(KBookmarkManager *manager, KToolBar *toolbar) { + KBookmarkGroup toolbarGroup = manager->toolbar(); + KBookmark bm = toolbarGroup.first(); + while(!bm.isNull()) + { + // TODO append bm to toolbar + bm = toolbarGroup.next(bm); + } } -- cgit v1.2.1 From d467ccf90fb3e8c851db97c44f551aeaa9fa289f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 28 Jan 2009 15:58:37 +0100 Subject: New BookmarkBar!! 1st version, Yeah!! --- src/bookmarks.cpp | 47 ++++++++++++++++++++++++++++++++++++----------- src/bookmarks.h | 25 ++++++++----------------- src/mainwindow.cpp | 14 +++++++------- src/mainwindow.h | 4 ++-- src/rekonqui.rc | 6 +++--- 5 files changed, 56 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index a736e378..584b2689 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -26,6 +26,7 @@ // KDE Includes #include +#include OwnBookMarks::OwnBookMarks(KMainWindow *parent) : QObject(parent) @@ -55,28 +56,52 @@ QString OwnBookMarks::currentTitle() const } -//--------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------------ -BookmarksMenu::BookmarksMenu(KMainWindow *parent, KBookmarkManager *manager) - : KMenu(parent) - , m_owner( new OwnBookMarks(parent) ) +BookmarksProvider::BookmarksProvider(KMainWindow* parent) + : m_parent(parent) + , m_owner(new OwnBookMarks(parent)) { + 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( manager , m_owner, this, m_ac ); } -//--------------------------------------------------------------------------------------------------------------------- - - -BookmarksLine::BookmarksLine(KBookmarkManager *manager, KToolBar *toolbar) +void BookmarksProvider::provideBmToolbar(KToolBar* toolbar) { - KBookmarkGroup toolbarGroup = manager->toolbar(); + toolbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon ); + KBookmarkGroup toolbarGroup = m_manager->toolbar(); KBookmark bm = toolbarGroup.first(); while(!bm.isNull()) { - // TODO append bm to toolbar + if(bm.isGroup()) + { + // do nothing! + } + else + { + if(bm.isSeparator()) + { + toolbar->addSeparator(); + } + else + { + KAction *a = new KBookmarkAction(bm, m_owner, m_ac); + toolbar->addAction(a); + } + } + // go ahead! bm = toolbarGroup.next(bm); } } + + +KMenu *BookmarksProvider::bookmarksMenu() +{ + KMenu *bmMenu = new KMenu(m_parent); + new KBookmarkMenu( m_manager, m_owner, bmMenu, m_ac ); + return bmMenu; +} + diff --git a/src/bookmarks.h b/src/bookmarks.h index 5aa384a1..2bdfab0a 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -35,7 +36,7 @@ class OwnBookMarks : public QObject , public KBookmarkOwner { Q_OBJECT public: - OwnBookMarks(KMainWindow * ); + OwnBookMarks(KMainWindow *); virtual void openBookmark (const KBookmark & , Qt::MouseButtons , Qt::KeyboardModifiers ); @@ -52,29 +53,19 @@ private: // ------------------------------------------------------------------------------ -class BookmarksMenu : public KMenu +class BookmarksProvider : public QObject { Q_OBJECT public: - BookmarksMenu(KMainWindow*, KBookmarkManager *); + BookmarksProvider(KMainWindow*); -private: - OwnBookMarks *m_owner; - KActionCollection *m_ac; - KBookmarkMenu *m_menu; -}; - -// ------------------------------------------------------------------------------ - -class BookmarksLine : public QObject -{ -Q_OBJECT -public: - BookmarksLine(KBookmarkManager *, KToolBar *toolbar); + void provideBmToolbar(KToolBar*); + KMenu *bookmarksMenu(); private: + KMainWindow *m_parent; OwnBookMarks *m_owner; + KBookmarkManager *m_manager; KActionCollection *m_ac; }; - #endif diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d956642b..87ae0ac0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -50,6 +50,7 @@ #include #include #include +#include // Qt Includes #include @@ -65,7 +66,7 @@ MainWindow::MainWindow() : KXmlGuiWindow() , m_view( new MainView(this) ) - , m_manager(0) + , m_bookmarksProvider( new BookmarksProvider(this) ) { // accept dnd setAcceptDrops(true); @@ -111,14 +112,10 @@ MainWindow::MainWindow() 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 ); - + KMenu *bmMenu = m_bookmarksProvider->bookmarksMenu(); + a->setMenu( bmMenu ); // a call to KXmlGuiWindow::setupGUI() populates the GUI // with actions, using KXMLGUI. @@ -137,6 +134,9 @@ MainWindow::MainWindow() KToolBar *navigationBar = toolBar( "mainToolBar" ); navigationBar->addWidget( m_view->lineEditStack() ); + KToolBar *bmToolbar = toolBar("bookmarksToolBar"); + m_bookmarksProvider->provideBmToolbar( bmToolbar ); + m_searchBar = new SearchBar( this ); connect(m_searchBar, SIGNAL(search(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); navigationBar->addWidget(m_searchBar); diff --git a/src/mainwindow.h b/src/mainwindow.h index d1eba1a4..2ec5c1bd 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -35,7 +35,7 @@ #include #include -class KBookmarkManager; +class BookmarksProvider; class MainView; class QWebFrame; class WebView; @@ -121,7 +121,7 @@ private: KMenu *m_historyBackMenu; KMenu *m_windowMenu; - KBookmarkManager *m_manager; + BookmarksProvider *m_bookmarksProvider; QAction *m_stopReload; diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 11897e03..5016192f 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -1,5 +1,5 @@ - + &File @@ -59,7 +59,7 @@ -Main Toolbar +Main Toolbar @@ -67,7 +67,7 @@ -Bookmarks Toolbar +Bookmarks Toolbar -- cgit v1.2.1 From 2649aba801efdbf57f10b55a5e6c46dbd13cdbb4 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 29 Jan 2009 10:52:28 +0100 Subject: Fixed Find bar use. --- src/findbar.cpp | 4 ++-- src/mainwindow.cpp | 20 ++++++++++---------- src/rekonqui.rc | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/findbar.cpp b/src/findbar.cpp index e3f4b231..449e24fa 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -58,8 +58,8 @@ FindBar::FindBar(KXmlGuiWindow *mainwindow) m_lineEdit = new KLineEdit(this); setFocusProxy(m_lineEdit); m_lineEdit->setMaximumWidth( 250 ); - connect( m_lineEdit, SIGNAL( returnPressed() ), mainwindow, SLOT( slotFindNext() ) ); - connect( m_lineEdit, SIGNAL( textEdited(const QString &) ), mainwindow, SLOT( slotFindNext() ) ); +// connect( m_lineEdit, SIGNAL( returnPressed() ), mainwindow, SLOT( slotFind() ) ); + connect( m_lineEdit, SIGNAL( textChanged(const QString &) ), mainwindow, SLOT( slotFind(const QString &) ) ); layout->addWidget( m_lineEdit ); // buttons diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 87ae0ac0..c7c1a47e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -551,14 +551,8 @@ void MainWindow::slotFind(const QString & search) { if (!currentTab()) return; - if (!search.isEmpty()) - { - m_lastSearch = search; - if (!currentTab()->findText(m_lastSearch)) - { - slotUpdateStatusbar( QString(m_lastSearch) + i18n(" not found.") ); - } - } + m_lastSearch = search; + slotFindNext(); } @@ -572,7 +566,10 @@ void MainWindow::slotFindNext() { if (!currentTab() && m_lastSearch.isEmpty()) return; - currentTab()->findText(m_lastSearch); + if (!currentTab()->findText(m_lastSearch, QWebPage::FindWrapsAroundDocument)) + { + slotUpdateStatusbar( QString(m_lastSearch) + i18n(" not found.") ); + } } @@ -580,7 +577,10 @@ void MainWindow::slotFindPrevious() { if (!currentTab() && m_lastSearch.isEmpty()) return; - currentTab()->findText(m_lastSearch, QWebPage::FindBackward); + if (!currentTab()->findText(m_lastSearch, QWebPage::FindBackward)) + { + slotUpdateStatusbar( QString(m_lastSearch) + i18n(" not found.") ); + } } diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 5016192f..861f8538 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -67,7 +67,7 @@ -Bookmarks Toolbar +Bookmarks Toolbar -- cgit v1.2.1 From ba12e93de03b052ade877b0ddfaef125579e15eb Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 29 Jan 2009 11:59:45 +0100 Subject: Definitely fixed FindBar (orat least, I hope so) Add some comments --- src/findbar.cpp | 1 - src/mainwindow.cpp | 50 +++++++++++++++++++++++++------------------------- src/mainwindow.h | 7 ++++--- src/webview.cpp | 2 ++ 4 files changed, 31 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/findbar.cpp b/src/findbar.cpp index 449e24fa..df5b5bc7 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -58,7 +58,6 @@ FindBar::FindBar(KXmlGuiWindow *mainwindow) m_lineEdit = new KLineEdit(this); setFocusProxy(m_lineEdit); m_lineEdit->setMaximumWidth( 250 ); -// connect( m_lineEdit, SIGNAL( returnPressed() ), mainwindow, SLOT( slotFind() ) ); connect( m_lineEdit, SIGNAL( textChanged(const QString &) ), mainwindow, SLOT( slotFind(const QString &) ) ); layout->addWidget( m_lineEdit ); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c7c1a47e..294bf589 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -652,17 +652,17 @@ void MainWindow::slotToggleInspector(bool enable) } -void MainWindow::slotSwapFocus() -{ - if ( currentTab()->hasFocus() ) - { - m_view->currentLineEdit()->setFocus(); - } - else - { - currentTab()->setFocus(); - } -} +// void MainWindow::slotSwapFocus() +// { +// if ( currentTab()->hasFocus() ) +// { +// m_view->currentLineEdit()->setFocus(); +// } +// else +// { +// currentTab()->setFocus(); +// } +// } MainView *MainWindow::tabWidget() const @@ -723,20 +723,20 @@ void MainWindow::slotAboutToShowBackMenu() } -void MainWindow::slotShowWindow() -{ - if (KAction *action = qobject_cast(sender())) - { - QVariant v = action->data(); - if (v.canConvert()) - { - int offset = qvariant_cast(v); - QList windows = BrowserApplication::instance()->mainWindows(); - windows.at(offset)->activateWindow(); - windows.at(offset)->currentTab()->setFocus(); - } - } -} +// void MainWindow::slotShowWindow() +// { +// if (KAction *action = qobject_cast(sender())) +// { +// QVariant v = action->data(); +// if (v.canConvert()) +// { +// int offset = qvariant_cast(v); +// QList windows = BrowserApplication::instance()->mainWindows(); +// windows.at(offset)->activateWindow(); +// windows.at(offset)->currentTab()->setFocus(); +// } +// } +// } void MainWindow::slotOpenActionUrl(QAction *action) diff --git a/src/mainwindow.h b/src/mainwindow.h index 2ec5c1bd..fa96eb0e 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -75,15 +75,16 @@ private slots: void slotUpdateWindowTitle(const QString &title = QString()); void slotOpenLocation(); void slotAboutToShowBackMenu(); + void geometryChangeRequested(const QRect &geometry); // history related void slotOpenActionUrl(QAction *action); void slotOpenPrevious(); void slotOpenNext(); - void slotShowWindow(); - void slotSwapFocus(); - void geometryChangeRequested(const QRect &geometry); +/* void slotShowWindow(); + void slotSwapFocus();*/ + // File Menu slots diff --git a/src/webview.cpp b/src/webview.cpp index 436db54e..a4ca8211 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -191,6 +191,8 @@ WebView::WebView(QWidget* parent) // TODO : improve and KDE-ize this menu +// 1. Add link to bookmarks +// 2. Add "save link as" action void WebView::contextMenuEvent(QContextMenuEvent *event) { QWebHitTestResult r = page()->mainFrame()->hitTestContent(event->pos()); -- cgit v1.2.1 From e095ed8b62c56745367fe79186431fe4f175d777 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 2 Feb 2009 01:14:46 +0100 Subject: Fixed download problems rewamp proxy ui fixing settings --- src/download.cpp | 19 +++++++++---------- src/download.h | 4 ---- src/networkaccessmanager.cpp | 2 +- src/rekonq.kcfg | 2 +- src/settings.cpp | 11 +++++++++-- src/settings_proxy.ui | 41 ++++++++++++++++++++++++----------------- src/webview.cpp | 10 ++++++++++ 7 files changed, 54 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/download.cpp b/src/download.cpp index aedd0a63..d1ed296a 100644 --- a/src/download.cpp +++ b/src/download.cpp @@ -33,7 +33,7 @@ Download::Download(const KUrl &srcUrl, const KUrl &destUrl) : m_srcUrl(srcUrl), m_destUrl(destUrl) { - kDebug(5001) << "DownloadFile: " << m_srcUrl.url() << " to dest: " << m_destUrl.url(); + kWarning() << "DownloadFile: " << m_srcUrl.url() << " to dest: " << m_destUrl.url(); m_copyJob = KIO::get(m_srcUrl); connect(m_copyJob, SIGNAL(data(KIO::Job*,const QByteArray &)), SLOT(slotData(KIO::Job*, const QByteArray&))); connect(m_copyJob, SIGNAL(result(KJob *)), SLOT(slotResult(KJob *))); @@ -56,27 +56,26 @@ void Download::slotResult(KJob * job) { case 0://The download has finished { - kDebug(5001) << "Downloading successfully finished" << m_destUrl.url(); - QFile torrentFile(m_destUrl.path()); - if (!torrentFile.open(QIODevice::WriteOnly | QIODevice::Text)) {} - torrentFile.write(m_data); - torrentFile.close(); - emit finishedSuccessfully(m_destUrl, m_data); + kDebug(5001) << "Downloading successfully finished: " << m_destUrl.url(); + QFile destFile(m_destUrl.path()); + if ( destFile.open(QIODevice::WriteOnly | QIODevice::Text) ) + { + destFile.write(m_data); + destFile.close(); + } m_data = 0; break; } case KIO::ERR_FILE_ALREADY_EXIST: { kDebug(5001) << "ERROR - File already exists"; - QFile file(m_destUrl.path()); - emit finishedSuccessfully(m_destUrl, file.readAll()); + // QFile file(m_destUrl.path()); m_data = 0; break; } default: kDebug(5001) << "We are sorry to say you, that there were errors while downloading :("; m_data = 0; - emit finishedWithError(); break; } } diff --git a/src/download.h b/src/download.h index 7986341d..65f36d3b 100644 --- a/src/download.h +++ b/src/download.h @@ -37,10 +37,6 @@ class Download : public QObject Download(const KUrl &srcUrl, const KUrl &destUrl); ~Download(); - Q_SIGNALS: - void finishedSuccessfully(KUrl dest, QByteArray data); - void finishedWithError(); - private slots: void slotResult(KJob * job); void slotData(KIO::Job *job, const QByteArray& data); diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 1d601440..82947c3b 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -64,7 +64,7 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent) void NetworkAccessManager::loadSettings() { QNetworkProxy proxy; - if ( ReKonfig::enableProxy() ) + if ( ReKonfig::isProxyEnabled() ) { if ( ReKonfig::proxyType() == 0 ) { diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index c20134be..a1b6ca4c 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -50,7 +50,7 @@ - + false diff --git a/src/settings.cpp b/src/settings.cpp index 462874f9..2181d0fd 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -131,10 +131,17 @@ void SettingsDialog::readConfig() connect(d->generalUi.downloadDirUrlRequester, SIGNAL(textChanged(QString)),this, SLOT(saveSettings())); // ======= Fonts - d->fontsUi.standardFontChooser->setFont(ReKonfig::standardFont(), false); + QFont stdFont = ReKonfig::standardFont(); + d->fontsUi.standardFontChooser->setFont(stdFont, false); connect(d->fontsUi.standardFontChooser, SIGNAL(fontSelected(QFont)),this, SLOT(saveSettings())); - d->fontsUi.fixedFontChooser->setFont(ReKonfig::fixedFont(), true); + QFont fxFont = ReKonfig::fixedFont(); + d->fontsUi.fixedFontChooser->setFont(fxFont, true); connect(d->fontsUi.fixedFontChooser, SIGNAL(fontSelected(QFont)),this, SLOT(saveSettings())); + + // ======= Proxy + bool proxyEnabled = ReKonfig::isProxyEnabled(); + d->proxyUi.groupBox->setEnabled(proxyEnabled); + connect(d->proxyUi.kcfg_isProxyEnabled, SIGNAL(clicked(bool)), d->proxyUi.groupBox, SLOT(setEnabled(bool))); } diff --git a/src/settings_proxy.ui b/src/settings_proxy.ui index a7dd6073..bcee0a7e 100644 --- a/src/settings_proxy.ui +++ b/src/settings_proxy.ui @@ -5,21 +5,28 @@ 0 0 - 472 - 221 + 440 + 223 Proxy - + - + + + enable proxy + + + + + - Enable proxy + Proxy Settings - + Type: @@ -29,7 +36,7 @@ - + @@ -43,7 +50,7 @@ - + Host: @@ -53,10 +60,10 @@ - + - + Port: @@ -66,7 +73,7 @@ - + 10000 @@ -76,7 +83,7 @@ - + Qt::Horizontal @@ -89,7 +96,7 @@ - + User Name: @@ -99,10 +106,10 @@ - + - + Password: @@ -112,10 +119,10 @@ - + - + Qt::Vertical diff --git a/src/webview.cpp b/src/webview.cpp index a4ca8211..95fcdf83 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -126,6 +126,11 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) { KUrl srcUrl = reply->url(); QString path = ReKonfig::downloadDir() + QString("/") + srcUrl.fileName(); + QFile file(path); + if (file.exists()) + { + path = KFileDialog::getOpenFileName(); + } KUrl destUrl = KUrl(path); BrowserApplication::instance()->downloadUrl( srcUrl, destUrl ); return; @@ -312,6 +317,11 @@ void WebView::downloadRequested(const QNetworkRequest &request) { KUrl srcUrl = request.url(); QString path = ReKonfig::downloadDir() + QString("/") + srcUrl.fileName(); + QFile file(path); + if (file.exists()) + { + path = KFileDialog::getOpenFileName(); + } KUrl destUrl = KUrl(path); BrowserApplication::instance()->downloadUrl( srcUrl, destUrl ); } -- cgit v1.2.1 From 641b34b0c2de8ccdf250bc8a8d95cfb0ea4a1f45 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 2 Feb 2009 01:56:58 +0100 Subject: rekonq 0.0.3 --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index e53eef3c..5fc3d30e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,7 +27,7 @@ static const char description[] = I18N_NOOP("KDE Browser Webkit Based"); -static const char version[] = "0.0.2"; +static const char version[] = "0.0.3"; int main(int argc, char **argv) { -- cgit v1.2.1 From 3afb0217d09a012c4a65740155b232c67fef4990 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 2 Feb 2009 01:57:19 +0100 Subject: Fixed download system about downloading files with the same name. --- src/download.cpp | 8 +++++++- src/webview.cpp | 10 ---------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/download.cpp b/src/download.cpp index d1ed296a..e4ee556d 100644 --- a/src/download.cpp +++ b/src/download.cpp @@ -58,6 +58,13 @@ void Download::slotResult(KJob * job) { kDebug(5001) << "Downloading successfully finished: " << m_destUrl.url(); QFile destFile(m_destUrl.path()); + int n = 1; + while( destFile.exists() ) + { + QString fn = QFile(m_destUrl.path()).fileName(); + destFile.setFileName( fn + "." + QString::number(n) ); + n++; + } if ( destFile.open(QIODevice::WriteOnly | QIODevice::Text) ) { destFile.write(m_data); @@ -69,7 +76,6 @@ void Download::slotResult(KJob * job) case KIO::ERR_FILE_ALREADY_EXIST: { kDebug(5001) << "ERROR - File already exists"; - // QFile file(m_destUrl.path()); m_data = 0; break; } diff --git a/src/webview.cpp b/src/webview.cpp index 95fcdf83..a4ca8211 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -126,11 +126,6 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) { KUrl srcUrl = reply->url(); QString path = ReKonfig::downloadDir() + QString("/") + srcUrl.fileName(); - QFile file(path); - if (file.exists()) - { - path = KFileDialog::getOpenFileName(); - } KUrl destUrl = KUrl(path); BrowserApplication::instance()->downloadUrl( srcUrl, destUrl ); return; @@ -317,11 +312,6 @@ void WebView::downloadRequested(const QNetworkRequest &request) { KUrl srcUrl = request.url(); QString path = ReKonfig::downloadDir() + QString("/") + srcUrl.fileName(); - QFile file(path); - if (file.exists()) - { - path = KFileDialog::getOpenFileName(); - } KUrl destUrl = KUrl(path); BrowserApplication::instance()->downloadUrl( srcUrl, destUrl ); } -- cgit v1.2.1 From 75abb0c0190b991b0766f56e4823666f9c7326c4 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 2 Feb 2009 09:34:13 +0100 Subject: Code Optimization --- src/download.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/download.cpp b/src/download.cpp index e4ee556d..627b11b2 100644 --- a/src/download.cpp +++ b/src/download.cpp @@ -51,7 +51,6 @@ void Download::slotData(KIO::Job *job, const QByteArray& data) void Download::slotResult(KJob * job) { - kDebug(5001); switch (job->error()) { case 0://The download has finished @@ -59,9 +58,9 @@ void Download::slotResult(KJob * job) kDebug(5001) << "Downloading successfully finished: " << m_destUrl.url(); QFile destFile(m_destUrl.path()); int n = 1; + QString fn = destFile.fileName(); while( destFile.exists() ) { - QString fn = QFile(m_destUrl.path()).fileName(); destFile.setFileName( fn + "." + QString::number(n) ); n++; } @@ -75,12 +74,12 @@ void Download::slotResult(KJob * job) } case KIO::ERR_FILE_ALREADY_EXIST: { - kDebug(5001) << "ERROR - File already exists"; + kWarning() << "ERROR - File already exists"; m_data = 0; break; } default: - kDebug(5001) << "We are sorry to say you, that there were errors while downloading :("; + kWarning() << "We are sorry to say you, that there were errors while downloading :("; m_data = 0; break; } -- cgit v1.2.1 From 1dacbee9f2982947664559f3f7d998a89e768b73 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 2 Feb 2009 09:50:23 +0100 Subject: Removed unuseful squeezelabel class --- src/CMakeLists.txt | 3 +-- src/squeezelabel.cpp | 39 --------------------------------------- src/squeezelabel.h | 39 --------------------------------------- 3 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 src/squeezelabel.cpp delete mode 100644 src/squeezelabel.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b18f6275..19355e7b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,8 +15,7 @@ SET( rekonq_SRCS urlbar.cpp findbar.cpp searchbar.cpp - settings.cpp - squeezelabel.cpp + settings.cpp webview.cpp main.cpp ) diff --git a/src/squeezelabel.cpp b/src/squeezelabel.cpp deleted file mode 100644 index 7aa9e177..00000000 --- a/src/squeezelabel.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* ============================================================ - * - * This file is a part of the rekonq project - * - * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved - * Copyright (C) 2008 by Andrea Diamantini - * - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; - * either version 2, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#include "squeezelabel.h" - -SqueezeLabel::SqueezeLabel(QWidget *parent) : QLabel(parent) -{ -} - -void SqueezeLabel::paintEvent(QPaintEvent *event) -{ - QFontMetrics fm = fontMetrics(); - if (fm.width(text()) > contentsRect().width()) { - QString elided = fm.elidedText(text(), Qt::ElideMiddle, width()); - QString oldText = text(); - setText(elided); - QLabel::paintEvent(event); - setText(oldText); - } else { - QLabel::paintEvent(event); - } -} diff --git a/src/squeezelabel.h b/src/squeezelabel.h deleted file mode 100644 index a7906270..00000000 --- a/src/squeezelabel.h +++ /dev/null @@ -1,39 +0,0 @@ -/* ============================================================ - * - * This file is a part of the rekonq project - * - * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved - * Copyright (C) 2008 by Andrea Diamantini - * - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; - * either version 2, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef SQUEEZELABEL_H -#define SQUEEZELABEL_H - -#include - -class SqueezeLabel : public QLabel -{ - Q_OBJECT - -public: - SqueezeLabel(QWidget *parent = 0); - -protected: - void paintEvent(QPaintEvent *event); - -}; - -#endif // SQUEEZELABEL_H - -- cgit v1.2.1 From 0ee5dac23e4b687755c18dd68bcc47625bc59532 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 8 Feb 2009 18:53:48 +0100 Subject: Ready for 0.0.3 release. Last fixes.. --- src/mainwindow.cpp | 7 +++++-- src/rekonqui.rc | 6 +++--- src/settings.cpp | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 294bf589..ecd5e452 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -73,8 +73,7 @@ MainWindow::MainWindow() // updating rekonq configuration slotUpdateConf(); -// QTimer::singleShot(0, this, SLOT( postLaunch() ) ); - + // creating a new tab m_view->newTab(); @@ -137,6 +136,10 @@ MainWindow::MainWindow() KToolBar *bmToolbar = toolBar("bookmarksToolBar"); m_bookmarksProvider->provideBmToolbar( bmToolbar ); + // setting up toolbars to NOT have context menu enabled + setContextMenuPolicy( Qt::ActionsContextMenu ); + + // search bar m_searchBar = new SearchBar( this ); connect(m_searchBar, SIGNAL(search(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); navigationBar->addWidget(m_searchBar); diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 861f8538..0e372e82 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -1,5 +1,5 @@ - + &File @@ -59,7 +59,7 @@ -Main Toolbar +Main Toolbar @@ -67,7 +67,7 @@ -Bookmarks Toolbar + diff --git a/src/settings.cpp b/src/settings.cpp index 2181d0fd..7ab6e3dc 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -133,9 +133,11 @@ void SettingsDialog::readConfig() // ======= Fonts QFont stdFont = ReKonfig::standardFont(); d->fontsUi.standardFontChooser->setFont(stdFont, false); + d->fontsUi.standardFontChooser->setSampleText( stdFont.family() + " " + QString::number(stdFont.pointSize()) ); connect(d->fontsUi.standardFontChooser, SIGNAL(fontSelected(QFont)),this, SLOT(saveSettings())); QFont fxFont = ReKonfig::fixedFont(); d->fontsUi.fixedFontChooser->setFont(fxFont, true); + d->fontsUi.fixedFontChooser->setSampleText( fxFont.family() + " " + QString::number(fxFont.pointSize()) ); connect(d->fontsUi.fixedFontChooser, SIGNAL(fontSelected(QFont)),this, SLOT(saveSettings())); // ======= Proxy -- cgit v1.2.1 From 8213829a830cabc2d9b44a43bba00f1dae77adc5 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 14 Feb 2009 12:06:54 +0100 Subject: Preliminary flash support --- src/CMakeLists.txt | 1 + src/webview.cpp | 13 ++++++++++++- src/webview.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 19355e7b..6fa9bd1c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,6 +44,7 @@ TARGET_LINK_LIBRARIES( rekonq ${QT_LIBRARIES} ${QT_QTNETWORK_LIBRARY} ${QT_QTWEBKIT_LIBRARY} + ${QT_QTUITOOLS_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ) diff --git a/src/webview.cpp b/src/webview.cpp index a4ca8211..5d317597 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -42,7 +42,8 @@ #include #include #include - +// --- +#include WebPage::WebPage(QObject *parent) : QWebPage(parent) @@ -120,6 +121,16 @@ QWebPage *WebPage::createWindow(QWebPage::WebWindowType type) } +QObject *WebPage::createPlugin(const QString &classId, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues) +{ + Q_UNUSED(url); + Q_UNUSED(paramNames); + Q_UNUSED(paramValues); + QUiLoader loader; + return loader.createWidget(classId, view()); +} + + void WebPage::handleUnsupportedContent(QNetworkReply *reply) { if (reply->error() == QNetworkReply::NoError) diff --git a/src/webview.h b/src/webview.h index 6710aac4..6892fbd4 100644 --- a/src/webview.h +++ b/src/webview.h @@ -50,6 +50,7 @@ public: protected: bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type); QWebPage *createWindow(QWebPage::WebWindowType type); + QObject *createPlugin(const QString &classId, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues); private slots: void handleUnsupportedContent(QNetworkReply *reply); -- cgit v1.2.1