- QComboBox *const combo = create_channel_selector(parent, dec, pdch);
- QComboBox *const combo_initial_pin = create_channel_selector_initial_pin(parent, dec, pdch);
-
- connect(combo, SIGNAL(currentIndexChanged(int)),
- this, SLOT(on_channel_selected(int)));
- connect(combo_initial_pin, SIGNAL(currentIndexChanged(int)),
- this, SLOT(on_initial_pin_selected(int)));
-
- QHBoxLayout *const hlayout = new QHBoxLayout;
- hlayout->addWidget(combo);
- hlayout->addWidget(combo_initial_pin);
-
- if (!settings.value(GlobalSettings::Key_Dec_InitialStateConfigurable).toBool())
- combo_initial_pin->hide();
-
- decoder_form->addRow(tr("<b>%1</b> (%2) *")
- .arg(QString::fromUtf8(pdch->name),
- QString::fromUtf8(pdch->desc)), hlayout);
-
- const ChannelSelector s = {combo, combo_initial_pin, dec, pdch};
- channel_selectors_.push_back(s);
- }
+ // Add the channels
+ for (DecodeChannel ch : channels) {
+ // Ignore channels not part of the decoder we create the form for
+ if (ch.decoder_ != dec)
+ continue;