@@ -241,8 +241,7 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent)
241
241
// remove certificates (having %ESTEID% text) from browsing history of Internet Explorer and/or Google Chrome, and do it for all users.
242
242
QList<TokenData> cache = qApp->signer ()->cache ();
243
243
CertStore s;
244
- const QList<QSslCertificate> certificates = s.list ();
245
- for (const QSslCertificate &c: certificates)
244
+ for (const QSslCertificate &c: s.list ())
246
245
{
247
246
if (std::any_of (cache.cbegin (), cache.cend (), [&](const TokenData &token) { return token.cert () == c; }))
248
247
continue ;
@@ -418,16 +417,21 @@ void SettingsDialog::initFunctionality()
418
417
updateProxy ();
419
418
420
419
// pageServices - TimeStamp
420
+ ui->rdTimeStampDefault ->setDisabled (Settings::TSA_URL_CUSTOM.isLocked ());
421
+ ui->rdTimeStampCustom ->setEnabled (ui->rdTimeStampDefault ->isEnabled ());
422
+ ui->rdTimeStampCustom ->setChecked (Settings::TSA_URL_CUSTOM);
423
+ ui->txtTimeStamp ->setReadOnly (Settings::TSA_URL.isLocked ());
424
+ ui->txtTimeStamp ->setEnabled (ui->rdTimeStampCustom ->isChecked ());
425
+ ui->txtTimeStamp ->setPlaceholderText (Application::confValue (Settings::TSA_URL.KEY ).toString ());
426
+ QString TSA_URL = Settings::TSA_URL.value (Application::confValue (Application::TSAUrl));
427
+ ui->txtTimeStamp ->setText (ui->txtTimeStamp ->placeholderText () == TSA_URL ? QString () : TSA_URL);
428
+ ui->wgtTSACert ->setDisabled (Settings::TSA_CERT.isLocked ());
429
+ ui->wgtTSACert ->setVisible (ui->rdTimeStampCustom ->isChecked ());
421
430
connect (ui->rdTimeStampCustom , &QRadioButton::toggled, ui->txtTimeStamp , [this ](bool checked) {
422
431
ui->txtTimeStamp ->setEnabled (checked);
423
432
ui->wgtTSACert ->setVisible (checked);
424
433
Settings::TSA_URL_CUSTOM = checked;
425
434
});
426
- ui->rdTimeStampCustom ->setChecked (Settings::TSA_URL_CUSTOM);
427
- ui->wgtTSACert ->setVisible (ui->rdTimeStampCustom ->isChecked ());
428
- ui->txtTimeStamp ->setPlaceholderText (Application::confValue (Settings::TSA_URL.KEY ).toString ());
429
- QString TSA_URL = Settings::TSA_URL.value (Application::confValue (Application::TSAUrl));
430
- ui->txtTimeStamp ->setText (ui->txtTimeStamp ->placeholderText () == TSA_URL ? QString () : TSA_URL);
431
435
connect (ui->txtTimeStamp , &QLineEdit::textChanged, this , [this ](const QString &url) {
432
436
Application::setConfValue (Application::TSAUrl, url);
433
437
if (url.isEmpty ())
@@ -450,13 +454,17 @@ void SettingsDialog::initFunctionality()
450
454
updateTSACert (QSslCertificate (QByteArray::fromBase64 (Settings::TSA_CERT), QSsl::Der));
451
455
452
456
// pageServices - MID
457
+ ui->rdMIDUUIDDefault ->setDisabled (Settings::MID_UUID_CUSTOM.isLocked ());
458
+ ui->rdMIDUUIDCustom ->setEnabled (ui->rdMIDUUIDDefault ->isEnabled ());
459
+ ui->rdMIDUUIDCustom ->setChecked (Settings::MID_UUID_CUSTOM);
460
+ ui->txtMIDUUID ->setReadOnly (Settings::MID_UUID.isLocked ());
461
+ ui->txtMIDUUID ->setEnabled (ui->rdMIDUUIDCustom ->isChecked ());
462
+ ui->txtMIDUUID ->setText (Settings::MID_UUID);
453
463
connect (ui->rdMIDUUIDCustom , &QRadioButton::toggled, ui->txtMIDUUID , [=](bool checked) {
454
464
ui->txtMIDUUID ->setEnabled (checked);
455
465
Settings::MID_UUID_CUSTOM = checked;
456
466
Settings::SID_UUID_CUSTOM = checked;
457
467
});
458
- ui->rdMIDUUIDCustom ->setChecked (Settings::MID_UUID_CUSTOM);
459
- ui->txtMIDUUID ->setText (Settings::MID_UUID);
460
468
connect (ui->txtMIDUUID , &QLineEdit::textChanged, this , [](const QString &text) {
461
469
Settings::MID_UUID = text;
462
470
Settings::SID_UUID = text;
@@ -466,16 +474,21 @@ void SettingsDialog::initFunctionality()
466
474
});
467
475
468
476
// pageValidation - SiVa
477
+ ui->rdSiVaDefault ->setDisabled (Settings::SIVA_URL_CUSTOM.isLocked ());
478
+ ui->rdSiVaCustom ->setEnabled (ui->rdSiVaDefault ->isEnabled ());
479
+ ui->rdSiVaCustom ->setChecked (Settings::SIVA_URL_CUSTOM);
480
+ ui->txtSiVa ->setReadOnly (Settings::SIVA_URL.isLocked ());
481
+ ui->txtSiVa ->setEnabled (ui->rdSiVaCustom ->isChecked ());
482
+ ui->txtSiVa ->setPlaceholderText (Application::confValue (Settings::SIVA_URL.KEY ).toString ());
483
+ QString SIVA_URL = Settings::SIVA_URL.value (Application::confValue (Application::SiVaUrl));
484
+ ui->txtSiVa ->setText (ui->txtSiVa ->placeholderText () == SIVA_URL ? QString () : SIVA_URL);
485
+ ui->wgtSiVaCert ->setDisabled (Settings::SIVA_CERT.isLocked ());
486
+ ui->wgtSiVaCert ->setVisible (ui->rdSiVaCustom ->isChecked ());
469
487
connect (ui->rdSiVaCustom , &QRadioButton::toggled, ui->txtSiVa , [this ](bool checked) {
470
488
ui->txtSiVa ->setEnabled (checked);
471
489
ui->wgtSiVaCert ->setVisible (checked);
472
490
Settings::SIVA_URL_CUSTOM = checked;
473
491
});
474
- ui->rdSiVaCustom ->setChecked (Settings::SIVA_URL_CUSTOM);
475
- ui->wgtSiVaCert ->setVisible (ui->rdSiVaCustom ->isChecked ());
476
- ui->txtSiVa ->setPlaceholderText (Application::confValue (Settings::SIVA_URL.KEY ).toString ());
477
- QString SIVA_URL = Settings::SIVA_URL.value (Application::confValue (Application::SiVaUrl));
478
- ui->txtSiVa ->setText (ui->txtSiVa ->placeholderText () == SIVA_URL ? QString () : SIVA_URL);
479
492
connect (ui->txtSiVa , &QLineEdit::textChanged, this , [this ](const QString &url) {
480
493
Application::setConfValue (Application::SiVaUrl, url);
481
494
if (url.isEmpty ())
@@ -689,9 +702,12 @@ void SettingsDialog::saveFile(const QString &name, const QString &path)
689
702
690
703
void SettingsDialog::saveFile (const QString &name, const QByteArray &content)
691
704
{
692
- QString filename = FileDialog::getSaveFileName (this , tr (" Save as" ), QStringLiteral ( " %1/%2_%3_%4" )
693
- .arg (QStandardPaths::writableLocation (QStandardPaths::DocumentsLocation), QApplication::applicationName (), QApplication::applicationVersion (), name),
694
- tr (" Text files (*.txt)" ) );
705
+ QString filename = FileDialog::getSaveFileName (this , tr (" Save as" ), QStringLiteral ( " %1/%2_%3_%4" ).arg (
706
+ QStandardPaths::writableLocation (QStandardPaths::DocumentsLocation),
707
+ QApplication::applicationName (),
708
+ QApplication::applicationVersion (),
709
+ name),
710
+ tr (" Text files (*.txt)" ));
695
711
if ( filename.isEmpty () )
696
712
return ;
697
713
if (QFile f (filename); !f.open (QIODevice::WriteOnly|QIODevice::Text) || !f.write (content))
0 commit comments