void ConnectionOptionsWidget::apply(OptionsNode ANode) { OptionsNode node = !ANode.isNull() ? ANode : FOptions; node.setValue(ui.lneHost->text(),"host"); node.setValue(ui.spbPort->value(),"port"); node.setValue(ui.chbUseLegacySSL->isChecked(),"use-legacy-ssl"); node.setValue(ui.cmbSslProtocol->itemData(ui.cmbSslProtocol->currentIndex()),"ssl-protocol"); node.setValue(ui.cmbCertCheckMode->itemData(ui.cmbCertCheckMode->currentIndex()),"cert-verify-mode"); if (FProxySettings) FManager->saveProxySettings(FProxySettings, node.node("proxy")); emit childApply(); }
void ConsoleWidget::saveContext(const QUuid &AContextId) { OptionsNode node = Options::node(OPV_CONSOLE_CONTEXT_ITEM, AContextId.toString()); node.setValue(ui.cmbStreamJid->currentIndex()>0 ? ui.cmbStreamJid->itemData(ui.cmbStreamJid->currentIndex()).toString() : QString::null,"streamjid"); QStringList conditions; for (int i=0; i<ui.ltwConditions->count(); i++) conditions.append(ui.ltwConditions->item(i)->text()); node.setValue(conditions,"conditions"); node.setValue(ui.chbWordWrap->isChecked(),"word-wrap"); node.setValue(ui.chbHilightXML->checkState(),"highlight-xml"); Options::setFileValue(saveGeometry(),"console.context.window-geometry",AContextId.toString()); Options::setFileValue(ui.sptHSplitter->saveState(),"console.context.hsplitter-state",AContextId.toString()); Options::setFileValue(ui.sptVSplitter->saveState(),"console.context.vsplitter-state",AContextId.toString()); }
void PositioningMethodSerialPortOptions::apply() { QString name = ui->cmbPortName->currentText(); Options::node(OPV_POSITIONING_METHOD_SERIALPORT_NAME).setValue(name); Options::node(OPV_POSITIONING_METHOD_SERIALPORT_BUFFERSIZE).setValue(ui->spbBufferSize->value()); Options::node(OPV_POSITIONING_METHOD_SERIALPORT_TIMEOUT).setValue(ui->spbTimeout->value()); Options::node(OPV_POSITIONING_METHOD_SERIALPORT_TIMETRESHOLD).setValue(ui->spbTimeTreshold->value()); Options::node(OPV_POSITIONING_METHOD_SERIALPORT_DISTANCETRESHOLD).setValue(ui->spbDistanceTreshold->value()); OptionsNode node = Options::node(OPV_POSITIONING_METHOD_SERIALPORT, name); node.setValue(ui->cmbBaudRate->itemData(ui->cmbBaudRate->currentIndex()).toLongLong(), "baud-rate"); node.setValue(ui->cmbDataBits->itemData(ui->cmbDataBits->currentIndex()).toInt(), "data-bits"); node.setValue(ui->cmbStopBits->itemData(ui->cmbStopBits->currentIndex()).toInt(), "stop-bits"); node.setValue(ui->cmbParity->itemData(ui->cmbParity->currentIndex()).toInt(), "parity"); node.setValue(ui->cmbFlowControl->itemData(ui->cmbFlowControl->currentIndex()).toInt(), "flow-control"); emit childApply(); }
void ConnectionManager::setProxy(const QUuid &AProxyId, const IConnectionProxy &AProxy) { if (!AProxyId.isNull() && AProxyId!=APPLICATION_PROXY_REF_UUID) { LOG_INFO(QString("Proxy added or updated, id=%1").arg(AProxyId.toString())); OptionsNode pnode = Options::node(OPV_PROXY_ITEM,AProxyId.toString()); pnode.setValue(AProxy.name,"name"); pnode.setValue(AProxy.proxy.type(),"type"); pnode.setValue(AProxy.proxy.hostName(),"host"); pnode.setValue(AProxy.proxy.port(),"port"); pnode.setValue(AProxy.proxy.user(),"user"); pnode.setValue(Options::encrypt(AProxy.proxy.password()),"pass"); emit proxyChanged(AProxyId, AProxy); } else { LOG_ERROR(QString("Failed to add or change proxy, id=%1: Invalid proxy Id").arg(AProxyId.toString())); } }