diff --git a/client/dialogs/SettingsDialog.cpp b/client/dialogs/SettingsDialog.cpp index 4a5e78a3..b411f7a0 100644 --- a/client/dialogs/SettingsDialog.cpp +++ b/client/dialogs/SettingsDialog.cpp @@ -67,6 +67,10 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent) w->setAttribute(Qt::WA_MacShowFocusRect, false); for(QCheckBox *w: findChildren()) w->setAttribute(Qt::WA_MacShowFocusRect, false); + for(QToolButton *b: findChildren()) + b->setCursor(Qt::PointingHandCursor); + for(QPushButton *b: findChildren()) + b->setCursor(Qt::PointingHandCursor); // pageGeneral selectLanguage(); @@ -151,7 +155,7 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent) ui->txtMIDUUID->setReadOnly(Settings::MID_UUID.isLocked()); ui->txtMIDUUID->setVisible(ui->rdMIDUUIDCustom->isChecked()); ui->txtMIDUUID->setText(Settings::MID_UUID); - connect(ui->rdMIDUUIDCustom, &QRadioButton::toggled, ui->txtMIDUUID, [=](bool checked) { + connect(ui->rdMIDUUIDCustom, &QRadioButton::toggled, ui->txtMIDUUID, [this](bool checked) { ui->txtMIDUUID->setVisible(checked); Settings::MID_UUID_CUSTOM = checked; Settings::SID_UUID_CUSTOM = checked; @@ -221,6 +225,7 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent) ui->txtCdoc2UUID->setReadOnly(disabled); ui->txtCdoc2Fetch->setReadOnly(disabled); ui->txtCdoc2Post->setReadOnly(disabled); + ui->wgtCDoc2Cert->setHidden(disabled); }; for(QJsonObject::const_iterator i = list.constBegin(); i != list.constEnd(); ++i) ui->cmbCdoc2Name->addItem(i.value().toObject().value(QLatin1String("NAME")).toString(), i.key()); @@ -234,14 +239,40 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent) }); setCDoc2Values(cdoc2Service); connect(ui->txtCdoc2UUID, &QLineEdit::textEdited, this, Settings::CDOC2_UUID); - connect(ui->txtCdoc2Fetch, &QLineEdit::textEdited, this, Settings::CDOC2_GET); - connect(ui->txtCdoc2Post, &QLineEdit::textEdited, this, Settings::CDOC2_POST); + connect(ui->txtCdoc2Fetch, &QLineEdit::textEdited, this, [this](const QString &url) { + Settings::CDOC2_GET = url; + if(url.isEmpty()) + { + Settings::CDOC2_GET_CERT.clear(); + Settings::CDOC2_POST_CERT.clear(); + updateCDoc2Cert(QSslCertificate()); + } + }); + connect(ui->txtCdoc2Post, &QLineEdit::textEdited, this, [this](const QString &url) { + Settings::CDOC2_POST = url; + if(url.isEmpty()) + { + Settings::CDOC2_GET_CERT.clear(); + Settings::CDOC2_POST_CERT.clear(); + updateCDoc2Cert(QSslCertificate()); + } + }); #else ui->cmbCdoc2Name->addItem(QStringLiteral("Default")); ui->txtCdoc2UUID->setText(QStringLiteral("00000000-0000-0000-0000-000000000000")); ui->txtCdoc2Fetch->setText(QStringLiteral(CDOC2_GET_URL)); ui->txtCdoc2Post->setText(QStringLiteral(CDOC2_POST_URL)); #endif + connect(ui->btInstallCDoc2Cert, &QPushButton::clicked, this, [this] { + QSslCertificate cert = selectCert(tr("Select encryption server certificate"), + tr("Encryption Service SSL certificate")); + if(cert.isNull()) + return; + Settings::CDOC2_GET_CERT = cert.toDer().toBase64(); + Settings::CDOC2_POST_CERT = cert.toDer().toBase64(); + updateCDoc2Cert(cert); + }); + updateCDoc2Cert(QSslCertificate(QByteArray::fromBase64(Settings::CDOC2_GET_CERT), QSsl::Der)); // pageProxy connect(this, &SettingsDialog::finished, this, &SettingsDialog::saveProxy); @@ -313,7 +344,7 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent) dlg->open(); }); #ifdef CONFIG_URL - connect(qApp->conf(), &Configuration::finished, this, [=](bool /*update*/, const QString &error){ + connect(qApp->conf(), &Configuration::finished, this, [this](bool /*update*/, const QString &error){ if(!error.isEmpty()) { WarningDialog::show(this, tr("Checking updates has failed.") + "
" + tr("Please try again."), error); return; @@ -334,10 +365,10 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent) Application::updateTSLCache({}); }); connect(ui->btnNavUseByDefault, &QPushButton::clicked, this, &SettingsDialog::useDefaultSettings); - connect(ui->btnNavSaveReport, &QPushButton::clicked, this, [=]{ + connect(ui->btnNavSaveReport, &QPushButton::clicked, this, [this]{ saveFile(QStringLiteral("diagnostics.txt"), ui->txtDiagnostics->toPlainText().toUtf8()); }); - connect(ui->btnNavSaveLibdigidocpp, &QPushButton::clicked, this, [=]{ + connect(ui->btnNavSaveLibdigidocpp, &QPushButton::clicked, this, [this]{ Settings::LIBDIGIDOCPP_DEBUG = false; QString log = QStringLiteral("%1/libdigidocpp.log").arg(QDir::tempPath()); saveFile(QStringLiteral("libdigidocpp.txt"), log); @@ -439,6 +470,11 @@ void SettingsDialog::updateCert(const QSslCertificate &c, QPushButton *btn, Cert }); } +void SettingsDialog::updateCDoc2Cert(const QSslCertificate &c) +{ + updateCert(c, ui->btShowCDoc2Cert, ui->txtCDoc2Cert); +} + void SettingsDialog::updateSiVaCert(const QSslCertificate &c) { updateCert(c, ui->btShowSiVaCert, ui->txtSiVaCert); @@ -519,7 +555,7 @@ void SettingsDialog::updateDiagnostics() QApplication::setOverrideCursor( Qt::WaitCursor ); auto *worker = new Diagnostics(); connect(worker, &Diagnostics::update, ui->txtDiagnostics, &QTextBrowser::insertHtml, Qt::QueuedConnection); - connect(worker, &Diagnostics::destroyed, this, [=]{ + connect(worker, &Diagnostics::destroyed, this, [this]{ ui->txtDiagnostics->setEnabled(true); ui->txtDiagnostics->moveCursor(QTextCursor::Start); ui->txtDiagnostics->ensureCursorVisible(); diff --git a/client/dialogs/SettingsDialog.h b/client/dialogs/SettingsDialog.h index 72beee7b..03be4eb6 100644 --- a/client/dialogs/SettingsDialog.h +++ b/client/dialogs/SettingsDialog.h @@ -71,6 +71,7 @@ class SettingsDialog final: public QDialog QSslCertificate selectCert(const QString &label, const QString &format); void selectLanguage(); void updateCert(const QSslCertificate &c, QPushButton *btn, CertLabel *lbl); + void updateCDoc2Cert(const QSslCertificate &c); void updateSiVaCert(const QSslCertificate &c); void updateTSACert(const QSslCertificate &c); void updateVersion(); diff --git a/client/dialogs/SettingsDialog.ui b/client/dialogs/SettingsDialog.ui index d11659c1..895bcaf1 100644 --- a/client/dialogs/SettingsDialog.ui +++ b/client/dialogs/SettingsDialog.ui @@ -3,7 +3,7 @@ SettingsDialog - Qt::WindowModality::WindowModal + Qt::WindowModal @@ -27,11 +27,11 @@ QWidget { -color: #000000; +color: #07142A; font-family: Roboto, Helvetica; font-size: 14px; } -#lblMenuSettings, #lblGeneralLang, #lblDefaultDirectory, #lblTimeStamp, #lblTSACert, #lblMID, #lblSiVa, #lblSiVaCert, #pageEncryptionLabel, #pageProxyLabel { +#lblMenuSettings, #lblGeneralLang, #lblDefaultDirectory, #lblTimeStamp, #lblMID, #lblSiVa, #pageEncryptionLabel, #pageProxyLabel { color: #003168; font-weight: 700; font-size: 18px; @@ -70,16 +70,15 @@ font-size: 18px; #leftPane { background-color: #ffffff; -border-right: 1px solid #E7EAEF +border-right: 1px solid #E7EAEF; } #lblMenuSettings { -padding-left: 24; +padding-left: 24px; } QRadioButton { color: #003168; border: none; -padding-left: 24; -min-height: 40px; +padding: 13px 24px; } QRadioButton::indicator { width: 0px; @@ -98,13 +97,13 @@ background-color: #E9ECF3; 0 - 2 + 0 0 - 1 + 0 0 @@ -117,8 +116,14 @@ background-color: #E9ECF3; 61 + + + 16777215 + 61 + + - Qt::FocusPolicy::TabFocus + Qt::TabFocus Settings @@ -204,7 +209,7 @@ background-color: #E9ECF3; - Qt::Orientation::Vertical + Qt::Vertical @@ -217,20 +222,164 @@ background-color: #E9ECF3; + + + + + 0 + 48 + + + + + 16777215 + 48 + + + + #navigationArea { +border-top: 1px solid #E7EAEF; +background-color: #F3F5F7; +} +QPushButton { +padding: 10px 12px; +border-radius: 4px; +color: #2F70B6; +font-size: 12px; +font-weight: 700; +} +QPushButton:hover { +background-color: #EAF1F8; +} +QPushButton:pressed { +background-color: #BFD3E8; +} +QPushButton:default { +color: #ffffff; +background-color: #2F70B6; +} +QPushButton:default:hover { +background-color: #2B66A6; +} +QPushButton:default:pressed { +background-color: #215081; +} +QPushButton:default:disabled { +background-color: #2F70B6; +} + + + + 40 + + + 24 + + + 0 + + + 40 + + + 0 + + + + + Qt::TabFocus + + + DigiDoc4 4.0.1.0, released 01.02.2024 + + + + + + + Qt::Horizontal + + + + 10 + 20 + + + + + + + + First run + + + + + + + Refresh configuration + + + + + + + Check connection + + + + + + + Save diagnostics report + + + + + + + Save log + + + + + + + Remove old certificates + + + + + + + Use default settings + + + + + + + Close + + + true + + + + + + #pageGeneral, #pageServices, #pageValidation, #pageEncryption, #pageProxy, #pageDiagnostics, #pageInfo { background-color: #ffffff; } -#lblProxyHost, #lblProxyPort, #lblProxyUsername, #lblProxyPassword { -color: #07142A; -} QLineEdit, QComboBox { padding: 10px 14px; border: 1px solid #C4CBD8; border-radius: 4px; -color: #07142A; +background-color: white; placeholder-text-color: #607496; font-size: 16px; } @@ -250,7 +399,6 @@ QComboBox QPushButton { margin: 3px; padding: 0px 12px 0px 4px; border: 0px; -color: #07142A; text-align: left; font-weight: normal; font-size: 16px; @@ -276,7 +424,6 @@ left: 1px; } QCheckBox, QRadioButton { spacing: 8px; -color: #07142A; border: none; /*Workaround for right padding*/ border: 2px solid transparent; border-radius: 4px; @@ -325,10 +472,11 @@ QRadioButton::indicator:checked:disabled { image: url(:/images/icon_radio_check_disabled.svg); } QPushButton { -padding: 9px 12px; +padding: 10px 12px; border: 1px solid #2F70B6; border-radius: 4px; color: #2F70B6; +font-size: 12px; font-weight: 700; } QPushButton:hover { @@ -365,7 +513,7 @@ max-height: 22px; - Qt::FocusPolicy::TabFocus + Qt::TabFocus Language @@ -435,7 +583,7 @@ max-height: 22px; - Qt::FocusPolicy::TabFocus + Qt::TabFocus Container default location @@ -472,9 +620,6 @@ max-height: 22px; - - PointingHandCursor - ... @@ -488,7 +633,7 @@ max-height: 22px; - Qt::Orientation::Vertical + Qt::Vertical @@ -502,7 +647,7 @@ max-height: 22px; - QFrame::Shape::NoFrame + QFrame::NoFrame true @@ -512,8 +657,8 @@ max-height: 22px; 0 0 - 791 - 577 + 467 + 573 @@ -537,7 +682,7 @@ max-height: 22px; - Qt::FocusPolicy::TabFocus + Qt::TabFocus Access to Time-Stamping service @@ -549,9 +694,6 @@ max-height: 22px; - - PointingHandCursor - Help @@ -570,7 +712,7 @@ max-height: 22px; - Qt::Orientation::Horizontal + Qt::Horizontal @@ -640,7 +782,7 @@ max-height: 22px; - Qt::FocusPolicy::TabFocus + Qt::TabFocus Time-Stamping service SSL certificate @@ -650,7 +792,7 @@ max-height: 22px; - Qt::FocusPolicy::TabFocus + Qt::TabFocus @@ -661,9 +803,6 @@ max-height: 22px; - - PointingHandCursor - Add certificate @@ -671,9 +810,6 @@ max-height: 22px; - - PointingHandCursor - Show certificate @@ -682,7 +818,7 @@ max-height: 22px; - Qt::Orientation::Horizontal + Qt::Horizontal @@ -702,7 +838,7 @@ max-height: 22px; - Qt::FocusPolicy::TabFocus + Qt::TabFocus Access to mobile-ID and Smart-ID service @@ -711,9 +847,6 @@ max-height: 22px; - - PointingHandCursor - Help @@ -732,7 +865,7 @@ max-height: 22px; - Qt::Orientation::Horizontal + Qt::Horizontal @@ -777,7 +910,7 @@ max-height: 22px; - QLineEdit::EchoMode::Password + QLineEdit::Password 00000000-0000-0000-0000-000000000000 @@ -790,7 +923,7 @@ max-height: 22px; - Qt::Orientation::Vertical + Qt::Vertical @@ -825,7 +958,7 @@ max-height: 22px; - Qt::FocusPolicy::TabFocus + Qt::TabFocus Access to Digital Signature Validation Service SiVa @@ -837,9 +970,6 @@ max-height: 22px; - - PointingHandCursor - Help @@ -858,7 +988,7 @@ max-height: 22px; - Qt::Orientation::Horizontal + Qt::Horizontal @@ -928,7 +1058,7 @@ max-height: 22px; - Qt::FocusPolicy::TabFocus + Qt::TabFocus Digital Signature Validation Service SiVa SSL certificate @@ -938,7 +1068,7 @@ max-height: 22px; - Qt::FocusPolicy::TabFocus + Qt::TabFocus @@ -949,9 +1079,6 @@ max-height: 22px; - - PointingHandCursor - Add certificate @@ -959,9 +1086,6 @@ max-height: 22px; - - PointingHandCursor - Show certificate @@ -970,7 +1094,7 @@ max-height: 22px; - Qt::Orientation::Horizontal + Qt::Horizontal @@ -988,7 +1112,7 @@ max-height: 22px; - Qt::Orientation::Vertical + Qt::Vertical @@ -1000,211 +1124,299 @@ max-height: 22px; - - - - 24 - - - 32 - - - 19 - - - 32 - - - 32 + + + QFrame::NoFrame + + + true + + + + + 0 + 0 + 374 + 610 + - - - - Qt::FocusPolicy::TabFocus - - - Encryption settings - - - - - - - 15 - - - - - Use default CDOC1 solution - - - true - - - cdoc2Group - - - - - - - Use default CDOC2 solution - - - cdoc2Group - - - - - - - - - - 24 - - - 24 - - - 0 + + + 24 + + + 32 + + + 19 + + + 32 + + + 32 + + + + + Qt::TabFocus - - 0 + + Encryption settings - - 0 + + + + + + 15 - + - Use key server + Use default CDOC1 solution + + + true + + cdoc2Group + - - - - QFormLayout::FieldGrowthPolicy::AllNonFixedFieldsGrow - - - Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter - - - 24 - - - 24 - - - 0 - - - 0 - - - 0 - - - - - - 140 - 0 - - - - Name - - - cmbCdoc2Name - - - - - - - - - - UUID - - - txtCdoc2UUID - - - - - - - true - - - true - - - - - - - Fetch URL - - - txtCdoc2Fetch - - - - - - - true - - - true - - - - - - - Post URL - - - txtCdoc2Post - - - - - - - true - - - true - - - - + + + Use default CDOC2 solution + + + cdoc2Group + - - - - - - Qt::Orientation::Vertical - - - - 20 - 40 - - - - - + + + + + + 24 + + + 24 + + + 0 + + + 0 + + + 0 + + + + + Use key server + + + + + + + + QFormLayout::AllNonFixedFieldsGrow + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 24 + + + 24 + + + 0 + + + 0 + + + 0 + + + + + + 140 + 0 + + + + Name + + + cmbCdoc2Name + + + + + + + + + + UUID + + + txtCdoc2UUID + + + + + + + true + + + true + + + + + + + Fetch URL + + + txtCdoc2Fetch + + + + + + + true + + + true + + + + + + + Post URL + + + txtCdoc2Post + + + + + + + true + + + true + + + + + + + + 24 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::TabFocus + + + Encryption Service SSL certificate + + + + + + + Qt::TabFocus + + + + + + + 16 + + + + + Add certificate + + + + + + + Show certificate + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + @@ -1369,7 +1581,7 @@ max-height: 22px; - QLineEdit::EchoMode::Password + QLineEdit::Password @@ -1381,7 +1593,7 @@ max-height: 22px; - Qt::Orientation::Vertical + Qt::Vertical @@ -1426,22 +1638,19 @@ QScrollBar { background: #FFFFFF; } QScrollBar::handle:vertical { - background-color: #8E969D; +background-color: #8E969D; margin: 0 0 0 0; border-radius: 2px; height: 145px; } -QScrollBar::add-line:vertical { - border: none; - background: none; -} +QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { - border: none; - background: none; +border: none; +background: none; } - QFrame::Shape::NoFrame + QFrame::NoFrame true @@ -1474,7 +1683,7 @@ QScrollBar::sub-line:vertical { 0 - + @@ -1489,7 +1698,7 @@ QScrollBar::sub-line:vertical { - Qt::FocusPolicy::TabFocus + Qt::TabFocus The project is supported by the European Regional Development Fund @@ -1499,7 +1708,7 @@ QScrollBar::sub-line:vertical { - Qt::FocusPolicy::TabFocus + Qt::TabFocus <p>Estonian ID-software is released by Information Systems's Authority<br /> @@ -1507,7 +1716,7 @@ In case of questions please contact our support via <a href="https://www Additional licenses and components - Qt::AlignmentFlag::AlignCenter + Qt::AlignCenter true @@ -1532,19 +1741,19 @@ QScrollBar { background: #FFFFFF; } QScrollBar::handle:vertical { - background-color: #8E969D; +background-color: #8E969D; margin: 0 0 0 0; border-radius: 2px; height: 145px; } QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { - border: none; - background: none; +border: none; +background: none; } - QFrame::Shape::NoFrame + QFrame::NoFrame true @@ -1568,7 +1777,7 @@ p, li { white-space: pre-wrap; margin-top:12px; margin-bottom:12px; margin-left: <p align="center"><b>Roboto: Google’s signature family of fonts</b><br />Apache Software License, Version 2.0<br /><a href="https://github.com/google/roboto/blob/master/LICENSE" style=" text-decoration: underline; color:#006eb5;">https://github.com/google/roboto/blob/master/LICENSE</a> </p></body></html> - Qt::TextInteractionFlag::TextBrowserInteraction + Qt::TextBrowserInteraction true @@ -1579,179 +1788,6 @@ p, li { white-space: pre-wrap; margin-top:12px; margin-bottom:12px; margin-left: - - - - - 0 - 48 - - - - - 16777215 - 48 - - - - #navigationArea { -border-top: 1px solid #E7EAEF; -background-color: #F3F5F7; -} -#txtNavVersion { -color: #07142A; -} -QPushButton { -padding: 9px 12px; -border-radius: 4px; -color: #2F70B6; -font-weight: 700; -} -QPushButton:hover { -background-color: #EAF1F8; -} -QPushButton:pressed { -background-color: #BFD3E8; -} -QPushButton:default { -color: #ffffff; -background-color: #2F70B6; -} -QPushButton:default:hover { -background-color: #2B66A6; -} -QPushButton:default:pressed { -background-color: #215081; -} -QPushButton:default:disabled { -background-color: #2F70B6; -} - - - - 40 - - - 24 - - - 0 - - - 40 - - - 0 - - - - - Qt::FocusPolicy::TabFocus - - - DigiDoc4 4.0.1.0, released 01.02.2024 - - - - - - - Qt::Orientation::Horizontal - - - - 10 - 20 - - - - - - - - PointingHandCursor - - - First run - - - - - - - PointingHandCursor - - - Refresh configuration - - - - - - - PointingHandCursor - - - Check connection - - - - - - - PointingHandCursor - - - Save diagnostics report - - - - - - - PointingHandCursor - - - Save log - - - - - - - PointingHandCursor - - - Remove old certificates - - - - - - - PointingHandCursor - - - Use default settings - - - - - - - PointingHandCursor - - - Close - - - true - - - - - - @@ -1777,16 +1813,18 @@ background-color: #2F70B6;
dialogs/SettingsDialog.h
- + + + - + + - - - + + diff --git a/client/translations/en.ts b/client/translations/en.ts index a6213bcb..14a2a3ce 100644 --- a/client/translations/en.ts +++ b/client/translations/en.ts @@ -2563,6 +2563,14 @@ Additional licenses and components Custom + + Encryption Service SSL certificate + + + + Select encryption server certificate + + SignatureDialog diff --git a/client/translations/et.ts b/client/translations/et.ts index 3621e5e2..40b80257 100644 --- a/client/translations/et.ts +++ b/client/translations/et.ts @@ -2563,6 +2563,14 @@ Täiendavad litsentsid ja komponendid Custom + + Encryption Service SSL certificate + + + + Select encryption server certificate + + SignatureDialog diff --git a/client/translations/ru.ts b/client/translations/ru.ts index cbf18303..a98722e4 100644 --- a/client/translations/ru.ts +++ b/client/translations/ru.ts @@ -2564,6 +2564,14 @@ Additional licenses and components Custom + + Encryption Service SSL certificate + + + + Select encryption server certificate + + SignatureDialog