{
GSList *l = g_slist_sort(g_slist_copy(
(GSList*)srd_decoder_list()), decoder_name_cmp);
- while ((l = l->next)) {
+ do {
QAction *const action = parent->addAction(QString(
((srd_decoder*)l->data)->name));
action->setData(qVariantFromValue(l->data));
_decoders_add_mapper.setMapping(action, action);
connect(action, SIGNAL(triggered()),
&_decoders_add_mapper, SLOT(map()));
- }
+ } while ((l = l->next));
g_slist_free(l);
}
(srd_decoder*)((QAction*)action)->data().value<void*>();
assert(dec);
- dialogs::Decoder dlg(this, dec);
- dlg.exec();
+ const std::vector< boost::shared_ptr<view::Signal> > &sigs =
+ _session.get_signals();
+
+ GHashTable *const options = g_hash_table_new_full(g_str_hash,
+ g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
+
+ dialogs::Decoder dlg(this, dec, sigs, options);
+ if(dlg.exec() != QDialog::Accepted) {
+ g_hash_table_destroy(options);
+ return;
+ }
+
+ _session.add_decoder(dec, dlg.get_probes(), options);
}
void MainWindow::run_stop()