Commit 578f4414 authored by Stefano Crocco's avatar Stefano Crocco Committed by David Faure
Browse files

Fix issues with password bar details widget

There were two issues, happening when dismissing the password bar with
the details widget visible:
- the next time the bar was shown, it had a button saying "Hide details"
  instead of "Show details"
- the next time the bar was shown, the details widget was empty
parent 0b6deada
......@@ -112,7 +112,7 @@ void PasswordBar::clear()
m_url.clear();
if (m_detailsWidget) {
m_detailsWidget->clear();
m_detailsWidget->hide();
setDetailsWidgetVisibility(false);
}
}
......@@ -126,7 +126,12 @@ void PasswordBar::resizeEvent(QResizeEvent* event)
void PasswordBar::onDetailsButtonClicked()
{
m_detailsVisible = !m_detailsVisible;
setDetailsWidgetVisibility(!m_detailsVisible);
}
void PasswordBar::setDetailsWidgetVisibility(bool visible)
{
m_detailsVisible = visible;
if (m_detailsVisible) {
m_detailsAction->setText(i18nc("@action:hide details about credentials to store", "&Hide details"));
} else {
......
......@@ -63,6 +63,7 @@ protected:
private:
void clear();
void setDetailsWidgetVisibility(bool visible);
QPoint computeDetailsWidgetPosition() const;
QUrl m_url;
......
......@@ -966,7 +966,6 @@ void WebEnginePart::slotSaveFormDataRequested (const QString& key, const QUrl& u
qCWarning(WEBENGINEPART_LOG) << "No m_wallet instance found! This should never happen!";
return;
}
m_passwordBar->setForms(m_wallet->pendingSaveData(key));
connect(m_passwordBar, &PasswordBar::saveFormDataAccepted,
m_wallet, &WebEngineWallet::acceptSaveFormDataRequest);
connect(m_passwordBar, &PasswordBar::saveFormDataRejected,
......@@ -976,6 +975,7 @@ void WebEnginePart::slotSaveFormDataRequested (const QString& key, const QUrl& u
Q_ASSERT(m_passwordBar);
m_passwordBar->setForms(m_wallet->pendingSaveData(key));
m_passwordBar->setUrl(url);
m_passwordBar->setRequestKey(key);
m_passwordBar->setText(i18n("<html>Do you want %1 to remember the login "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment