diff options
Diffstat (limited to 'src/webtab.cpp')
-rw-r--r-- | src/webtab.cpp | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/src/webtab.cpp b/src/webtab.cpp index f79e53d0..31dd1ca6 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -64,10 +64,10 @@ WebTab::WebTab(QWidget* parent) , m_view( new WebView(parent) ) , m_progress(0) { - QVBoxLayout* l=new QVBoxLayout(this); + QVBoxLayout* l = new QVBoxLayout(this); l->setMargin(0); - QWidget* messageBar=new QWidget(this); + QWidget* messageBar = new QWidget(this); l->addWidget(messageBar); messageBar->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); @@ -77,34 +77,17 @@ WebTab::WebTab(QWidget* parent) l->addWidget(m_view); m_view->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); - - // add kwallet bar + + KWebWallet *wallet = page()->wallet(); + + if(wallet) { - WalletWidget *walletBar = new WalletWidget(messageBar); - messageBar->layout()->addWidget(walletBar); - walletBar->hide(); - - KWebWallet *wallet = m_view->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 &))); } - connect(m_view->page(), SIGNAL(statusBarMessage(const QString&)), this, SLOT(setStatusBarText(const QString&))); + connect(page(), SIGNAL(statusBarMessage(const QString&)), this, SLOT(setStatusBarText(const QString&))); + connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int))); connect(m_view, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool))); @@ -169,3 +152,19 @@ void WebTab::loadInNewTab(const KUrl &url) { Application::instance()->loadUrl(url, Rekonq::NewCurrentTab); } + + +void WebTab::createWalletBar(const QString &key, const QUrl &url) +{ + KWebWallet *wallet = page()->wallet(); + QWidget *messageBar = 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 &))); +} |