@@ -356,13 +356,17 @@ void SettingsDialog::initFunctionality()
356356 Settings::DEFAULT_DIR = text;
357357 });
358358#endif
359- ui->wgtCDoc2 ->hide ();
360- #if 0
361359 ui->chkCdoc2KeyServer ->setChecked (Settings::CDOC2_USE_KEYSERVER);
362- ui->cmbCdoc2Name->setEnabled(ui->chkCdoc2KeyServer->isChecked());
363- connect(ui->chkCdoc2KeyServer, &QCheckBox::toggled, this, [this](bool checked) {
364- Settings::CDOC2_USE_KEYSERVER = checked;
360+ auto setCDoc2KeyServerEnabled = [this ](bool checked) {
365361 ui->cmbCdoc2Name ->setEnabled (checked);
362+ ui->txtCdoc2UUID ->setEnabled (checked);
363+ ui->txtCdoc2Fetch ->setEnabled (checked);
364+ ui->txtCdoc2Post ->setEnabled (checked);
365+ };
366+ setCDoc2KeyServerEnabled (ui->chkCdoc2KeyServer ->isChecked ());
367+ connect (ui->chkCdoc2KeyServer , &QCheckBox::toggled, this , [this , setCDoc2KeyServerEnabled](bool checked) {
368+ Settings::CDOC2_USE_KEYSERVER = checked;
369+ setCDoc2KeyServerEnabled (checked);
366370 });
367371#ifdef CONFIG_URL
368372 QJsonObject list = Application::confValue (QLatin1String (" CDOC2-CONF" )).toObject ();
@@ -376,20 +380,19 @@ void SettingsDialog::initFunctionality()
376380 ui->cmbCdoc2Name ->addItem (i.value ().toObject ().value (QLatin1String (" NAME" )).toString (), i.key ());
377381 if (Settings::CDOC2_GET.isSet () || Settings::CDOC2_POST.isSet ())
378382 ui->cmbCdoc2Name ->addItem (QStringLiteral (" Custom" ), QStringLiteral (" custom" ));
383+ QString cdoc2Service = Settings::CDOC2_DEFAULT_KEYSERVER;
384+ ui->cmbCdoc2Name ->setCurrentIndex (ui->cmbCdoc2Name ->findData (cdoc2Service));
379385 connect (ui->cmbCdoc2Name , qOverload<int >(&QComboBox::currentIndexChanged), this , [this , setCDoc2Values] (int index) {
380386 QString key = ui->cmbCdoc2Name ->itemData (index).toString ();
381387 Settings::CDOC2_DEFAULT_KEYSERVER = key;
382388 setCDoc2Values (key);
383389 });
384- QString cdoc2Service = Settings::CDOC2_DEFAULT_KEYSERVER;
385- ui->cmbCdoc2Name->setCurrentIndex(ui->cmbCdoc2Name->findData(cdoc2Service));
386390 setCDoc2Values (cdoc2Service);
387391#else
388392 ui->cmbCdoc2Name ->addItem (QStringLiteral (" Default" ));
389393 ui->txtCdoc2UUID ->setText (QStringLiteral (" default" ));
390394 ui->txtCdoc2Fetch ->setText (QStringLiteral (CDOC2_GET_URL));
391395 ui->txtCdoc2Post ->setText (QStringLiteral (CDOC2_POST_URL));
392- #endif
393396#endif
394397
395398 // pageProxy
0 commit comments