diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-20 00:17:05 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-20 00:17:05 +0200 |
| commit | 07bc3475f893430a59f91f65ea50d87ba21b5854 (patch) | |
| tree | c86518df1b239ee4810c654d1049d4bfc52cb41d /src/certificatemanagementdialog.cpp | |
| parent | efab40bf8d0fc71237bb80d4a786bcd6b1752d72 (diff) | |
| download | kristall-07bc3475f893430a59f91f65ea50d87ba21b5854.tar.gz | |
Patches by @tomasino, starts to implement the auto-enable/host filter feature for client certificates.
Diffstat (limited to 'src/certificatemanagementdialog.cpp')
| -rw-r--r-- | src/certificatemanagementdialog.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/certificatemanagementdialog.cpp b/src/certificatemanagementdialog.cpp index a14a9a4..9b8b095 100644 --- a/src/certificatemanagementdialog.cpp +++ b/src/certificatemanagementdialog.cpp @@ -53,6 +53,10 @@ void CertificateManagementDialog::on_certificates_selected(QModelIndex const& in ); this->ui->cert_notes->setPlainText(cert.user_notes); + this->ui->cert_host_filter->setText(cert.host_filter); + this->ui->cert_auto_enable->setEnabled(not cert.host_filter.isEmpty()); + this->ui->cert_auto_enable->setChecked(cert.auto_enable); + this->ui->delete_cert_button->setEnabled(true); } else @@ -63,6 +67,8 @@ void CertificateManagementDialog::on_certificates_selected(QModelIndex const& in this->ui->cert_expiration_date->setDateTime(QDateTime { }); this->ui->cert_livetime->setText(""); this->ui->cert_fingerprint->setPlainText(""); + this->ui->cert_host_filter->setText(""); + this->ui->cert_auto_enable->setChecked(false); if(auto group_name = global_identities.group(index); not group_name.isEmpty()) { this->ui->delete_cert_button->setEnabled(global_identities.canDeleteGroup(group_name)); @@ -150,3 +156,21 @@ void CertificateManagementDialog::on_create_cert_button_clicked() dialog.groupName(), id); } + +void CertificateManagementDialog::on_cert_host_filter_textChanged(const QString &host_filter) +{ + if(this->selected_identity != nullptr) { + this->ui->cert_auto_enable->setEnabled(not host_filter.isEmpty()); + this->selected_identity->host_filter = host_filter; + } else { + this->ui->cert_auto_enable->setEnabled(false); + } + +} + +void CertificateManagementDialog::on_cert_auto_enable_clicked(bool checked) +{ + if(this->selected_identity != nullptr) { + this->selected_identity->auto_enable = checked; + } +} |
