summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-12-13 17:04:31 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-12-13 17:04:31 +0100
commitf126bc9416cb4769721361354265cadcc742fc8a (patch)
tree9460afb61bd12edc08cd69c8bc43871947c42343 /src/webview.cpp
parentMerge commit 'refs/merge-requests/67' of git://gitorious.org/rekonq/mainline ... (diff)
parentwalletwidget on top of the webview (not over) (diff)
downloadrekonq-f126bc9416cb4769721361354265cadcc742fc8a.tar.xz
Merge commit 'refs/merge-requests/68' of git://gitorious.org/rekonq/mainline into m68
Conflicts: src/walletwidget.cpp
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp44
1 files changed, 26 insertions, 18 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index fede781e..be46d601 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -55,15 +55,15 @@
#include <QClipboard>
#include <QKeyEvent>
#include <QAction>
+#include <QLayout>
-WebView::WebView(QWidget* parent)
+WebView::WebView(QWidget* parent, QWidget* messageWidget)
: KWebView(parent, false)
, m_page( new WebPage(this) )
- , m_walletBar( new WalletWidget(this) )
, m_progress(0)
, m_mousePos(QPoint(0,0))
-
+ , m_messageWidget(messageWidget)
{
setPage(m_page);
@@ -77,17 +77,31 @@ WebView::WebView(QWidget* parent)
connect(this, SIGNAL(linkShiftClicked(const KUrl &)), m_page, SLOT(downloadUrl(const KUrl &)));
connect(m_page, SIGNAL(downloadRequested(const QNetworkRequest &)), m_page, SLOT(downloadRequest(const QNetworkRequest &)));
- // kwallet
- KWebWallet *w = m_page->wallet();
- if(w)
+ if (messageWidget)
{
- connect (w, SIGNAL(saveFormDataRequested(const QString &, const QUrl &)),
- m_walletBar, SLOT(onSaveFormData(const QString &, const QUrl &)));
- connect(m_walletBar, SIGNAL(saveFormDataAccepted(const QString &)),
- w, SLOT(acceptSaveFormDataRequest(const QString &)));
- connect(m_walletBar, SIGNAL(saveFormDataRejected(const QString &)),
- w, SLOT(rejectSaveFormDataRequest(const QString &)));
+ WalletWidget *walletBar = new WalletWidget(messageWidget);
+ messageWidget->layout()->addWidget(walletBar);
+ // kwallet
+ KWebWallet *w = m_page->wallet();
+ if(w)
+ {
+ connect (w, SIGNAL(saveFormDataRequested(const QString &, const QUrl &)),
+ walletBar, SLOT(onSaveFormData(const QString &, const QUrl &)));
+ connect(walletBar, SIGNAL(saveFormDataAccepted(const QString &)),
+ w, SLOT(acceptSaveFormDataRequest(const QString &)));
+ connect(walletBar, SIGNAL(saveFormDataRejected(const QString &)),
+ w, SLOT(rejectSaveFormDataRequest(const QString &)));
+
+ connect (w, SIGNAL(saveFormDataRequested(const QString &, const QUrl &)),
+ messageWidget, SLOT(show()));
+ connect(walletBar, SIGNAL(saveFormDataAccepted(const QString &)),
+ messageWidget, SLOT(hide()));
+ connect(walletBar, SIGNAL(saveFormDataRejected(const QString &)),
+ messageWidget, SLOT(hide()));
+
+ }
}
+
}
@@ -449,9 +463,3 @@ void WebView::loadInNewTab(const KUrl &url)
{
Application::instance()->loadUrl(url, Rekonq::NewCurrentTab);
}
-
-
-QWidget *WebView::walletBar()
-{
- return m_walletBar;
-}