@@ -362,13 +362,17 @@ void SettingsDialog::initFunctionality()
362362 Settings::DEFAULT_DIR = text;
363363 });
364364#endif
365- ui->wgtCDoc2 ->hide ();
366- #if 0
367365 ui->chkCdoc2KeyServer ->setChecked (Settings::CDOC2_USE_KEYSERVER);
368- ui->cmbCdoc2Name->setEnabled(ui->chkCdoc2KeyServer->isChecked());
369- connect(ui->chkCdoc2KeyServer, &QCheckBox::toggled, this, [this](bool checked) {
370- Settings::CDOC2_USE_KEYSERVER = checked;
366+ auto setCDoc2KeyServerEnabled = [this ](bool checked) {
371367 ui->cmbCdoc2Name ->setEnabled (checked);
368+ ui->txtCdoc2UUID ->setEnabled (checked);
369+ ui->txtCdoc2Fetch ->setEnabled (checked);
370+ ui->txtCdoc2Post ->setEnabled (checked);
371+ };
372+ setCDoc2KeyServerEnabled (ui->chkCdoc2KeyServer ->isChecked ());
373+ connect (ui->chkCdoc2KeyServer , &QCheckBox::toggled, this , [this , setCDoc2KeyServerEnabled](bool checked) {
374+ Settings::CDOC2_USE_KEYSERVER = checked;
375+ setCDoc2KeyServerEnabled (checked);
372376 });
373377#ifdef CONFIG_URL
374378 QJsonObject list = Application::confValue (QLatin1String (" CDOC2-CONF" )).toObject ();
@@ -382,20 +386,19 @@ void SettingsDialog::initFunctionality()
382386 ui->cmbCdoc2Name ->addItem (i.value ().toObject ().value (QLatin1String (" NAME" )).toString (), i.key ());
383387 if (Settings::CDOC2_GET.isSet () || Settings::CDOC2_POST.isSet ())
384388 ui->cmbCdoc2Name ->addItem (QStringLiteral (" Custom" ), QStringLiteral (" custom" ));
389+ QString cdoc2Service = Settings::CDOC2_DEFAULT_KEYSERVER;
390+ ui->cmbCdoc2Name ->setCurrentIndex (ui->cmbCdoc2Name ->findData (cdoc2Service));
385391 connect (ui->cmbCdoc2Name , qOverload<int >(&QComboBox::currentIndexChanged), this , [this , setCDoc2Values] (int index) {
386392 QString key = ui->cmbCdoc2Name ->itemData (index).toString ();
387393 Settings::CDOC2_DEFAULT_KEYSERVER = key;
388394 setCDoc2Values (key);
389395 });
390- QString cdoc2Service = Settings::CDOC2_DEFAULT_KEYSERVER;
391- ui->cmbCdoc2Name->setCurrentIndex(ui->cmbCdoc2Name->findData(cdoc2Service));
392396 setCDoc2Values (cdoc2Service);
393397#else
394398 ui->cmbCdoc2Name ->addItem (QStringLiteral (" Default" ));
395399 ui->txtCdoc2UUID ->setText (QStringLiteral (" default" ));
396400 ui->txtCdoc2Fetch ->setText (QStringLiteral (CDOC2_GET_URL));
397401 ui->txtCdoc2Post ->setText (QStringLiteral (CDOC2_POST_URL));
398- #endif
399402#endif
400403
401404 // pageProxy
0 commit comments