summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-02-15 15:38:36 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-02-15 15:38:36 +0100
commit93562769c23827a1a6ddec63816ac7edbdeb98f6 (patch)
tree15d226ee3dae2da99eef768461e4e239d874be1b /src
parentBrowserApplication --> Application (diff)
parentPreliminary flash support (diff)
downloadrekonq-93562769c23827a1a6ddec63816ac7edbdeb98f6.tar.xz
Merge branch 'master' into mainwindow
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/bookmarks.cpp48
-rw-r--r--src/bookmarks.h17
-rw-r--r--src/download.cpp30
-rw-r--r--src/download.h4
-rw-r--r--src/findbar.cpp53
-rw-r--r--src/findbar.h5
-rw-r--r--src/main.cpp2
-rw-r--r--src/mainview.cpp8
-rw-r--r--src/mainview.h1
-rw-r--r--src/mainwindow.cpp125
-rw-r--r--src/mainwindow.h15
-rw-r--r--src/networkaccessmanager.cpp2
-rw-r--r--src/rekonq.kcfg2
-rw-r--r--src/rekonqui.rc25
-rw-r--r--src/settings.cpp13
-rw-r--r--src/settings_proxy.ui41
-rw-r--r--src/squeezelabel.cpp39
-rw-r--r--src/squeezelabel.h39
-rw-r--r--src/webview.cpp15
-rw-r--r--src/webview.h1
21 files changed, 247 insertions, 242 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6a7c5c2d..88224670 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
)
@@ -45,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/bookmarks.cpp b/src/bookmarks.cpp
index 3cb65e38..584b2689 100644
--- a/src/bookmarks.cpp
+++ b/src/bookmarks.cpp
@@ -26,6 +26,7 @@
// KDE Includes
#include <KMimeType>
+#include <KMenu>
OwnBookMarks::OwnBookMarks(KMainWindow *parent)
: QObject(parent)
@@ -55,17 +56,52 @@ QString OwnBookMarks::currentTitle() const
}
-//---------------------------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------------
-BookmarksMenu::BookmarksMenu(KMainWindow *parent)
- : 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( m_manager , m_owner, this, m_ac );
+void BookmarksProvider::provideBmToolbar(KToolBar* toolbar)
+{
+ toolbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
+ KBookmarkGroup toolbarGroup = m_manager->toolbar();
+ KBookmark bm = toolbarGroup.first();
+ while(!bm.isNull())
+ {
+ 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 e0e49c78..2bdfab0a 100644
--- a/src/bookmarks.h
+++ b/src/bookmarks.h
@@ -26,6 +26,7 @@
#include <KBookmarkMenu>
#include <KUrl>
+#include <KMenu>
#include <KActionCollection>
#include <KMainWindow>
@@ -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 );
@@ -50,19 +51,21 @@ private:
MainWindow *m_parent;
};
+// ------------------------------------------------------------------------------
-class BookmarksMenu : public KMenu
+class BookmarksProvider : public QObject
{
Q_OBJECT
public:
- BookmarksMenu(KMainWindow * parent);
+ BookmarksProvider(KMainWindow*);
+
+ void provideBmToolbar(KToolBar*);
+ KMenu *bookmarksMenu();
private:
- KBookmarkManager *m_manager;
+ KMainWindow *m_parent;
OwnBookMarks *m_owner;
+ KBookmarkManager *m_manager;
KActionCollection *m_ac;
- KBookmarkMenu *m_menu;
};
-
-
#endif
diff --git a/src/download.cpp b/src/download.cpp
index aedd0a63..627b11b2 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 *)));
@@ -51,32 +51,36 @@ 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
{
- 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());
+ int n = 1;
+ QString fn = destFile.fileName();
+ while( destFile.exists() )
+ {
+ destFile.setFileName( fn + "." + QString::number(n) );
+ n++;
+ }
+ 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());
+ 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;
- 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/findbar.cpp b/src/findbar.cpp
index 6ba310ca..df5b5bc7 100644
--- a/src/findbar.cpp
+++ b/src/findbar.cpp
@@ -33,33 +33,46 @@
#include <QtGui>
-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( textChanged(const QString &) ), mainwindow, SLOT( slotFind(const QString &) ) );
+ 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 +115,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 <KToolBar>
#include <KXmlGuiWindow>
-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/main.cpp b/src/main.cpp
index c3ac0c00..9a779783 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)
{
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 7a7ec427..ecd5e452 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"
@@ -48,6 +50,7 @@
#include <KActionCollection>
#include <KMessageBox>
#include <KFileDialog>
+#include <KMenu>
// Qt Includes
#include <QPlainTextEdit>
@@ -57,24 +60,35 @@
#include <QWebFrame>
#include <QWebHistory>
#include <QDebug>
+#include <QVBoxLayout>
MainWindow::MainWindow()
: KXmlGuiWindow()
, m_view( new MainView(this) )
+ , m_bookmarksProvider( new BookmarksProvider(this) )
{
// accept dnd
setAcceptDrops(true);
// updating rekonq configuration
slotUpdateConf();
-// QTimer::singleShot(0, this, SLOT( postLaunch() ) );
-
+
// 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 &) ) );
@@ -96,6 +110,12 @@ MainWindow::MainWindow()
// add a status bar
statusBar()->show();
+ // ----- BOOKMARKS MENU: this has to be done BEFORE setupGUI!!
+ KAction *a = new KActionMenu( i18n("B&ookmarks"), this );
+ actionCollection()->addAction( QLatin1String("bookmarks"), a );
+ KMenu *bmMenu = m_bookmarksProvider->bookmarksMenu();
+ a->setMenu( bmMenu );
+
// a call to KXmlGuiWindow::setupGUI() populates the GUI
// with actions, using KXMLGUI.
// It also applies the saved mainwindow settings, if any, and ask the
@@ -103,8 +123,8 @@ MainWindow::MainWindow()
// toolbar position, icon size, etc.
setupGUI();
- // setup history & bookmarks menus
- setupCustomMenu();
+ // setup history menu
+ setupHistoryMenu();
// setup Tab Bar
setupTabBar();
@@ -113,13 +133,16 @@ MainWindow::MainWindow()
KToolBar *navigationBar = toolBar( "mainToolBar" );
navigationBar->addWidget( m_view->lineEditStack() );
+ 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);
-
- // Find Bar
- m_findBar = new FindBar( this );
- connect( m_findBar, SIGNAL( searchString(const QString &) ), this, SLOT( slotFind(const QString &) ) );
}
@@ -155,7 +178,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) );
@@ -200,12 +222,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);
@@ -260,9 +276,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&)));
@@ -539,12 +554,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();
}
@@ -556,17 +567,23 @@ void MainWindow::slotViewFindBar()
void MainWindow::slotFindNext()
{
- if (!currentTab() && !m_lastSearch.isEmpty())
+ if (!currentTab() && m_lastSearch.isEmpty())
return;
- currentTab()->findText(m_lastSearch);
+ if (!currentTab()->findText(m_lastSearch, QWebPage::FindWrapsAroundDocument))
+ {
+ slotUpdateStatusbar( QString(m_lastSearch) + i18n(" not found.") );
+ }
}
void MainWindow::slotFindPrevious()
{
- if (!currentTab() && !m_lastSearch.isEmpty())
+ 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.") );
+ }
}
@@ -638,17 +655,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
@@ -709,20 +726,20 @@ void MainWindow::slotAboutToShowBackMenu()
}
-void MainWindow::slotShowWindow()
-{
- if (KAction *action = qobject_cast<KAction*>(sender()))
- {
- QVariant v = action->data();
- if (v.canConvert<int>())
- {
- int offset = qvariant_cast<int>(v);
- QList<MainWindow*> windows = BrowserApplication::instance()->mainWindows();
- windows.at(offset)->activateWindow();
- windows.at(offset)->currentTab()->setFocus();
- }
- }
-}
+// void MainWindow::slotShowWindow()
+// {
+// if (KAction *action = qobject_cast<KAction*>(sender()))
+// {
+// QVariant v = action->data();
+// if (v.canConvert<int>())
+// {
+// int offset = qvariant_cast<int>(v);
+// QList<MainWindow*> 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 8b8f1cbe..fa96eb0e 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -25,7 +25,6 @@
// Local Includes
#include "findbar.h"
#include "searchbar.h"
-#include "mainview.h"
// KDE Includes
#include <KUrl>
@@ -36,7 +35,8 @@
#include <KToggleAction>
#include <KMenu>
-
+class BookmarksProvider;
+class MainView;
class QWebFrame;
class WebView;
@@ -61,7 +61,7 @@ public:
private:
void setupActions();
- void setupCustomMenu();
+ void setupHistoryMenu();
void setupTabBar();
public slots:
@@ -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
@@ -121,6 +122,8 @@ private:
KMenu *m_historyBackMenu;
KMenu *m_windowMenu;
+ BookmarksProvider *m_bookmarksProvider;
+
QAction *m_stopReload;
QString m_lastSearch;
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 @@
<!-- Proxy Settings -->
<group name="Proxy">
- <entry name="enableProxy" type="Bool">
+ <entry name="isProxyEnabled" type="Bool">
<default>false</default>
</entry>
<entry name="proxyType" type="Int">
diff --git a/src/rekonqui.rc b/src/rekonqui.rc
index 3a9ab682..0e372e82 100644
--- a/src/rekonqui.rc
+++ b/src/rekonqui.rc
@@ -1,5 +1,5 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="rekonq" version="13">
+<kpartgui name="rekonq" version="27">
<MenuBar>
<!-- ============ FILE menu =========== -->
<Menu name="file" noMerge="1"><text>&amp;File</text>
@@ -28,8 +28,6 @@
<Action name="edit_copy" />
<Action name="edit_paste" />
<Separator/>
- <Action name="edit_select_all" />
- <Separator/>
<Action name="edit_find" />
<Action name="edit_find_next" />
<Action name="edit_find_prev" />
@@ -44,7 +42,6 @@
<Action name="smaller font" />
<Separator/>
<Action name="page source" />
- <Action name="fullscreen" />
</Menu>
<!-- ============ GO menu =========== -->
<Menu name="go" deleted="true">
@@ -57,26 +54,20 @@
<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 =========== -->
-
-<ToolBar name="mainToolBar" fullWidth="true" iconText="iconOnly" position="top" noMerge="1"><text>Main Toolbar</text>
+<ToolBar name="mainToolBar" iconText="iconOnly" newline="true" position="top" noMerge="1"><text>Main Toolbar</text>
<Action name="history back" />
<Action name="history forward" />
<Action name="stop reload" />
<Action name="go_home" />
</ToolBar>
+<!-- ============ Bookmarks ToolBar =========== -->
+<ToolBar name="bookmarksToolBar" iconSize="16" newline="true" position="top" noMerge="1" hidden="true"><text>Bookmarks Toolbar</text>
+</ToolBar>
+
</kpartgui>
diff --git a/src/settings.cpp b/src/settings.cpp
index 462874f9..7ab6e3dc 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -131,10 +131,19 @@ 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);
+ d->fontsUi.standardFontChooser->setSampleText( stdFont.family() + " " + QString::number(stdFont.pointSize()) );
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);
+ d->fontsUi.fixedFontChooser->setSampleText( fxFont.family() + " " + QString::number(fxFont.pointSize()) );
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 @@
<rect>
<x>0</x>
<y>0</y>
- <width>472</width>
- <height>221</height>
+ <width>440</width>
+ <height>223</height>
</rect>
</property>
<property name="windowTitle" >
<string>Proxy</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
<item>
- <widget class="QGroupBox" name="kcfg_enableProxy" >
+ <widget class="QCheckBox" name="kcfg_isProxyEnabled" >
+ <property name="text" >
+ <string>enable proxy</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
<property name="title" >
- <string>Enable proxy</string>
+ <string>Proxy Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_6" >
- <item row="0" column="0" >
+ <item row="1" column="0" >
<widget class="QLabel" name="label_9" >
<property name="text" >
<string>Type:</string>
@@ -29,7 +36,7 @@
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2" >
+ <item row="1" column="1" colspan="2" >
<widget class="QComboBox" name="kcfg_proxyType" >
<item>
<property name="text" >
@@ -43,7 +50,7 @@
</item>
</widget>
</item>
- <item row="1" column="0" >
+ <item row="2" column="0" >
<widget class="QLabel" name="label_10" >
<property name="text" >
<string>Host:</string>
@@ -53,10 +60,10 @@
</property>
</widget>
</item>
- <item row="1" column="1" colspan="2" >
+ <item row="2" column="1" colspan="2" >
<widget class="KLineEdit" name="kcfg_proxyHostName" />
</item>
- <item row="2" column="0" >
+ <item row="3" column="0" >
<widget class="QLabel" name="label_11" >
<property name="text" >
<string>Port:</string>
@@ -66,7 +73,7 @@
</property>
</widget>
</item>
- <item row="2" column="1" >
+ <item row="3" column="1" >
<widget class="QSpinBox" name="kcfg_proxyPort" >
<property name="maximum" >
<number>10000</number>
@@ -76,7 +83,7 @@
</property>
</widget>
</item>
- <item row="2" column="2" >
+ <item row="3" column="2" >
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
@@ -89,7 +96,7 @@
</property>
</spacer>
</item>
- <item row="3" column="0" >
+ <item row="4" column="0" >
<widget class="QLabel" name="label_12" >
<property name="text" >
<string>User Name:</string>
@@ -99,10 +106,10 @@
</property>
</widget>
</item>
- <item row="3" column="1" colspan="2" >
+ <item row="4" column="1" colspan="2" >
<widget class="KLineEdit" name="kcfg_proxyUserName" />
</item>
- <item row="4" column="0" >
+ <item row="5" column="0" >
<widget class="QLabel" name="label_13" >
<property name="text" >
<string>Password:</string>
@@ -112,10 +119,10 @@
</property>
</widget>
</item>
- <item row="4" column="1" colspan="2" >
+ <item row="5" column="1" colspan="2" >
<widget class="KLineEdit" name="kcfg_proxyPassword" />
</item>
- <item row="5" column="0" >
+ <item row="6" column="0" >
<spacer name="verticalSpacer_2" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
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 <adjam7 at gmail dot com>
- *
- *
- * 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 <adjam7 at gmail dot com>
- *
- *
- * 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 <QtGui/QLabel>
-
-class SqueezeLabel : public QLabel
-{
- Q_OBJECT
-
-public:
- SqueezeLabel(QWidget *parent = 0);
-
-protected:
- void paintEvent(QPaintEvent *event);
-
-};
-
-#endif // SQUEEZELABEL_H
-
diff --git a/src/webview.cpp b/src/webview.cpp
index 436db54e..5d317597 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -42,7 +42,8 @@
#include <QMouseEvent>
#include <QWebHitTestResult>
#include <QBuffer>
-
+// ---
+#include <QUiLoader>
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 &paramNames, const QStringList &paramValues)
+{
+ 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)
@@ -191,6 +202,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());
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 &paramNames, const QStringList &paramValues);
private slots:
void handleUnsupportedContent(QNetworkReply *reply);