feat(GODT-2771): macOS cert install support in bridge-gui-test + placeholder QML.

This commit is contained in:
Xavier Michelon
2023-08-17 17:35:50 +02:00
parent f57a40677e
commit 69190daf3f
15 changed files with 338 additions and 45 deletions

View File

@ -285,11 +285,20 @@ void SettingsTab::setBugReport(QString const &osType, QString const &osVersion,
}
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void SettingsTab::installTLSCertificate() {
ui_.labelLastTLSCertInstall->setText(QString("Last install: %1").arg(QDateTime::currentDateTime().toString(Qt::ISODateWithMs)));
ui_.checkTLSCertIsInstalled->setChecked(this->nextTLSCertIntallResult() == TLSCertInstallResult::Success);
}
//****************************************************************************************************************************************************
/// \param[in] folderPath The folder path.
//****************************************************************************************************************************************************
void SettingsTab::exportTLSCertificates(QString const &folderPath) {
ui_.labeLastTLSCertsExport->setText(QString("%1 Export to %2")
ui_.labeLastTLSCertExport->setText(QString("%1 Export to %2")
.arg(QDateTime::currentDateTime().toString(Qt::ISODateWithMs))
.arg(folderPath));
}
@ -303,6 +312,22 @@ bool SettingsTab::nextBugReportWillSucceed() const {
}
//****************************************************************************************************************************************************
/// \return the state of the 'TLS Certificate is installed' check box.
//****************************************************************************************************************************************************
bool SettingsTab::isTLSCertificateInstalled() const {
return ui_.checkTLSCertIsInstalled->isChecked();
}
//****************************************************************************************************************************************************
/// \return The value for the 'Next TLS cert install result'.
//****************************************************************************************************************************************************
SettingsTab::TLSCertInstallResult SettingsTab::nextTLSCertIntallResult() const {
return TLSCertInstallResult(ui_.comboNextTLSCertInstallResult->currentIndex());
}
//****************************************************************************************************************************************************
/// \return true if the 'Next TLS key export will succeed' check box is checked
//****************************************************************************************************************************************************
@ -505,4 +530,11 @@ void SettingsTab::resetUI() {
ui_.comboCacheError->setCurrentIndex(0);
ui_.checkAutomaticUpdate->setChecked(true);
ui_.checkTLSCertIsInstalled->setChecked(false);
ui_.comboNextTLSCertInstallResult->setCurrentIndex(0);
ui_.checkTLSCertExportWillSucceed->setChecked(true);
ui_.checkTLSKeyExportWillSucceed->setChecked(true);
ui_.labeLastTLSCertExport->setText("Last export: never");
ui_.labelLastTLSCertInstall->setText("Last install: never");
}

View File

@ -28,6 +28,13 @@
//****************************************************************************************************************************************************
class SettingsTab : public QWidget {
Q_OBJECT
public: // data types.
enum class TLSCertInstallResult {
Success = 0,
Canceled = 1,
Failure = 2
}; ///< Enumberation for the result of a TLS certificate installation.
public: // member functions.
explicit SettingsTab(QWidget *parent = nullptr); ///< Default constructor.
SettingsTab(SettingsTab const &) = delete; ///< Disabled copy-constructor.
@ -54,6 +61,8 @@ public: // member functions.
QString dependencyLicenseLink() const; ///< Get the content of the 'Dependency License Link' edit.
QString landingPageLink() const; ///< Get the content of the 'Landing Page Link' edit.
bool nextBugReportWillSucceed() const; ///< Get the status of the 'Next Bug Report Will Fail' check box.
bool isTLSCertificateInstalled() const; ///< Get the status of the 'TLS Certificate is installed' check box.
TLSCertInstallResult nextTLSCertIntallResult() const; ///< Get the value of the 'Next TLS Certificate install result' combo box.
bool nextTLSCertExportWillSucceed() const; ///< Get the status of the 'Next TLS Cert export will succeed' check box.
bool nextTLSKeyExportWillSucceed() const; ///< Get the status of the 'Next TLS Key export will succeed' check box.
QString hostname() const; ///< Get the value of the 'Hostname' edit.
@ -79,6 +88,7 @@ public slots:
void setColorSchemeName(QString const &name); ///< Set the value for the 'Use Dark Theme' check box.
void setBugReport(QString const &osType, QString const &osVersion, QString const &emailClient, QString const &address, QString const &description,
bool includeLogs); ///< Set the content of the bug report box.
void installTLSCertificate(); ///< Install the TLS certificate.
void exportTLSCertificates(QString const &folderPath); ///< Export the TLS certificates.
void setMailServerSettings(qint32 imapPort, qint32 smtpPort, bool useSSLForIMAP, bool useSSLForSMTP); ///< Change the mail server settings.
void setIsDoHEnabled(bool enabled); ///< Set the value for the 'DoH Enabled' check box.

View File

@ -370,7 +370,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupCache_2">
<widget class="QGroupBox" name="groupCert">
<property name="minimumSize">
<size>
<width>0</width>
@ -380,34 +380,81 @@
<property name="title">
<string>TLS Certficates</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QLabel" name="labeLastTLSCertsExport">
<layout class="QGridLayout" name="gridLayout_4" columnstretch="1,1">
<item row="0" column="0">
<widget class="QCheckBox" name="checkTLSCertIsInstalled">
<property name="text">
<string>Last Export: Never</string>
<string>Certificate is installed</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkTLSCertExportWillSucceed">
<property name="text">
<string>TLS certificate export will succeed</string>
<string>Certificate export will succeed</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<item row="1" column="1">
<widget class="QCheckBox" name="checkTLSKeyExportWillSucceed">
<property name="text">
<string>TLS private key export will succeed</string>
<string>Key export will succeed</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="labeLastTLSCertExport">
<property name="text">
<string>Last Export: never</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelLastTLSCertInstall">
<property name="text">
<string>Last install: never</string>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_14" stretch="0,1">
<item>
<widget class="QLabel" name="labelNextInstall">
<property name="text">
<string>Next install will</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboNextTLSCertInstallResult">
<item>
<property name="text">
<string>Succeed</string>
</property>
</item>
<item>
<property name="text">
<string>Be Canceled</string>
</property>
</item>
<item>
<property name="text">
<string>Fail</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>