summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2009-12-13 16:39:26 +0100
committermegabigbug <megabigbug@arrakis.(none)>2009-12-13 16:39:26 +0100
commitc0d7804c239a15451a7ca61e902c1e80c5c22378 (patch)
tree9b8e658b4aa6b8470bd6dc3c3a414931c0dd61b1 /src/webview.cpp
parentMerge commit 'refs/merge-requests/64' of git://gitorious.org/rekonq/mainline (diff)
downloadrekonq-c0d7804c239a15451a7ca61e902c1e80c5c22378.tar.xz
walletwidget on top of the webview (not over)
add close button add icons
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index fede781e..574af35a 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -55,15 +55,14 @@
#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 +76,32 @@ 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;
-}