+
+ if(_connectionBox) {
+ layout()->removeWidget(_connectionBox);
+ _connectionBox->deleteLater();
+ _connectionBox = 0;
+ }
+
+ QVariantMap properties = _backends[backend].toMap()["ConnectionProperties"].toMap();
+ if(!properties.isEmpty()) {
+ QGroupBox *propertyBox = new QGroupBox(this);
+ propertyBox->setTitle(tr("Connection Properties"));
+ QFormLayout *formlayout = new QFormLayout;
+
+ QVariantMap::const_iterator propertyIter = properties.constBegin();
+ while(propertyIter != properties.constEnd()) {
+ QWidget *widget = 0;
+ switch(propertyIter.value().type()) {
+ case QVariant::Int:
+ {
+ QSpinBox *spinbox = new QSpinBox(propertyBox);
+ spinbox->setMaximum(64000);
+ spinbox->setValue(propertyIter.value().toInt());
+ widget = spinbox;
+ }
+ break;
+ default:
+ widget = new QLineEdit(propertyIter.value().toString(), propertyBox);
+ }
+ widget->setObjectName(propertyIter.key());
+ formlayout->addRow(propertyIter.key() + ":", widget);
+ propertyIter++;
+ }
+ propertyBox->setLayout(formlayout);
+ static_cast<QVBoxLayout *>(layout())->insertWidget(layout()->indexOf(ui.descriptionBox) + 1, propertyBox);
+ _connectionBox = propertyBox;
+ }