diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-12-15 16:15:38 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-12-15 16:15:38 +0100 |
commit | 387984c5373c31957dd3302a92b1052918c0f734 (patch) | |
tree | 9ff44376dc508d4a528b415ac27f25c9e43ebc32 /src/mainview.cpp | |
parent | Simpler web classes (but no more friends :) (diff) | |
parent | create walletwidget only when necessary (diff) | |
download | rekonq-387984c5373c31957dd3302a92b1052918c0f734.tar.xz |
Merge commit 'refs/merge-requests/71' of git://gitorious.org/rekonq/mainline into m71
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r-- | src/mainview.cpp | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp index 9b5c2595..cf1aa7fd 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -336,6 +336,7 @@ WebView *MainView::newWebView(bool focused, bool nearParent) QVBoxLayout* l=new QVBoxLayout(w); l->setMargin(0); + l->setSpacing(0); QWidget* messageBar=new QWidget(w); l->addWidget(messageBar); @@ -349,32 +350,13 @@ WebView *MainView::newWebView(bool focused, bool nearParent) l->addWidget(webView); webView->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); - // add kwallet bar + KWebWallet *wallet = webView->page()->wallet(); + if(wallet) { - WalletWidget *walletBar = new WalletWidget(messageBar); - messageBar->layout()->addWidget(walletBar); - walletBar->hide(); - - KWebWallet *wallet = webView->page()->wallet(); - if(wallet) - { - connect(wallet, SIGNAL(saveFormDataRequested(const QString &, const QUrl &)), - walletBar, SLOT(onSaveFormData(const QString &, const QUrl &))); - connect(walletBar, SIGNAL(saveFormDataAccepted(const QString &)), - wallet, SLOT(acceptSaveFormDataRequest(const QString &))); - connect(walletBar, SIGNAL(saveFormDataRejected(const QString &)), - wallet, SLOT(rejectSaveFormDataRequest(const QString &))); - - connect(wallet, SIGNAL(saveFormDataRequested(const QString &, const QUrl &)), - walletBar, SLOT(show())); - connect(walletBar, SIGNAL(saveFormDataAccepted(const QString &)), - walletBar, SLOT(hide())); - connect(walletBar, SIGNAL(saveFormDataRejected(const QString &)), - walletBar, SLOT(hide())); - - } + connect(wallet, SIGNAL(saveFormDataRequested(const QString &, const QUrl &)), + this, SLOT(createWalletBar(const QString &, const QUrl &))); } - + // connecting webview with mainview connect(webView, SIGNAL(loadStarted()), this, SLOT(webViewLoadStarted())); connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(webViewLoadFinished(bool))); @@ -404,6 +386,21 @@ WebView *MainView::newWebView(bool focused, bool nearParent) } +void MainView::createWalletBar(const QString &key, const QUrl &url) +{ + KWebWallet *wallet = currentWebView()->page()->wallet(); + QWidget *messageBar=this->widget(currentIndex())->layout()->itemAt(0)->widget(); + + WalletWidget *walletBar = new WalletWidget(messageBar); + walletBar->onSaveFormData(key,url); + messageBar->layout()->addWidget(walletBar); + + connect(walletBar, SIGNAL(saveFormDataAccepted(const QString &)), + wallet, SLOT(acceptSaveFormDataRequest(const QString &))); + connect(walletBar, SIGNAL(saveFormDataRejected(const QString &)), + wallet, SLOT(rejectSaveFormDataRequest(const QString &))); +} + void MainView::newTab() { WebView *w = newWebView(); |