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