GODT-1847: add option to export TLS Certificates in GUI.

This commit is contained in:
Xavier Michelon
2022-12-01 12:41:51 +01:00
parent 4375d77a98
commit 5b9c28e6f0
19 changed files with 2611 additions and 1389 deletions

View File

@ -166,6 +166,9 @@ void QMLBackend::connectGrpcEvents()
connect(client, &GRPCClient::addressChangedLogout, this, &QMLBackend::addressChangedLogout);
connect(client, &GRPCClient::apiCertIssue, this, &QMLBackend::apiCertIssue);
// generic error events
connect(client, &GRPCClient::genericError, this, &QMLBackend::onGenericError);
// user events
connect(client, &GRPCClient::userDisconnected, this, &QMLBackend::userDisconnected);
users_->connectGRPCEvents();
@ -439,6 +442,15 @@ void QMLBackend::onMailServerSettingsChanged(int imapPort, int smtpPort, bool us
}
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void QMLBackend::onGenericError(ErrorInfo const &info)
{
emit genericError(info.title, info.description);
}
//****************************************************************************************************************************************************
/// \param[in] active Should DoH be active.
//****************************************************************************************************************************************************
@ -514,3 +526,15 @@ void QMLBackend::onVersionChanged()
emit releaseNotesLinkChanged(releaseNotesLink());
emit landingPageLinkChanged(landingPageLink());
}
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void QMLBackend::exportTLSCertificates()
{
QString const folderPath = QFileDialog::getExistingDirectory(nullptr, QObject::tr("Select directory"),
QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
if (!folderPath.isEmpty())
app().grpc().exportTLSCertificates(folderPath);
}