Only display domain name in browser access confirm dialog

* Prevents dialog from growing in width if there is a really long url requesting access.
This commit is contained in:
Jonathan White 2020-08-02 09:07:49 -04:00
parent 60317ffadd
commit 51f3014028
3 changed files with 6 additions and 4 deletions

View File

@ -37,9 +37,11 @@ BrowserAccessControlDialog::~BrowserAccessControlDialog()
{
}
void BrowserAccessControlDialog::setItems(const QList<Entry*>& items, const QString& hostname, bool httpAuth)
void BrowserAccessControlDialog::setItems(const QList<Entry*>& items, const QString& urlString, bool httpAuth)
{
m_ui->siteLabel->setText(m_ui->siteLabel->text().arg(hostname));
QUrl url(urlString);
m_ui->siteLabel->setText(m_ui->siteLabel->text().arg(
url.toDisplayString(QUrl::RemoveUserInfo | QUrl::RemovePath | QUrl::RemoveQuery | QUrl::RemoveFragment)));
m_ui->rememberDecisionCheckBox->setVisible(!httpAuth);
m_ui->rememberDecisionCheckBox->setChecked(false);

View File

@ -38,7 +38,7 @@ public:
explicit BrowserAccessControlDialog(QWidget* parent = nullptr);
~BrowserAccessControlDialog() override;
void setItems(const QList<Entry*>& items, const QString& hostname, bool httpAuth);
void setItems(const QList<Entry*>& items, const QString& urlString, bool httpAuth);
bool remember() const;
QList<QTableWidgetItem*> getSelectedEntries() const;

View File

@ -776,7 +776,7 @@ QList<Entry*> BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
config.save(entry);
});
accessControlDialog.setItems(pwEntriesToConfirm, !submitHost.isEmpty() ? submitHost : url, httpAuth);
accessControlDialog.setItems(pwEntriesToConfirm, url, httpAuth);
QList<Entry*> allowedEntries;
if (accessControlDialog.exec() == QDialog::Accepted) {