Skip to content

Commit

Permalink
Make 'No' button default in Unknown Certificate dialog
Browse files Browse the repository at this point in the history
Fixes: #11531
  • Loading branch information
erikjv committed Mar 15, 2024
1 parent 3c89faf commit a5763ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/11531
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Change: Set the 'No' button as default action in the Unknown Certificate dialog

When an unknown certificate is used by the server, the safe action is to
reject this certificate. So the default action for this dialog should be
not to accept this unknown certificate.

https://github.com/owncloud/client/issues/11531
5 changes: 5 additions & 0 deletions src/gui/tlserrordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ TlsErrorDialog::TlsErrorDialog(const QList<QSslError> &sslErrors, const QString

connect(_ui->buttonBox, &QDialogButtonBox::accepted, this, &TlsErrorDialog::accept);
connect(_ui->buttonBox, &QDialogButtonBox::rejected, this, &TlsErrorDialog::reject);

// Try to set the No-button (which will also emit the reject signal when cliced) as the default
if (QPushButton *noButton = _ui->buttonBox->button(QDialogButtonBox::No)) {
noButton->setDefault(true);
}
}

TlsErrorDialog::~TlsErrorDialog()
Expand Down

0 comments on commit a5763ec

Please sign in to comment.