X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=0e971ce06cc7373f6da132479483101f187aa3c7;hb=98bac9636ee62a8863760a8b8381019a6a546173;hp=9873541dd5dbe4dc24aea9be777a949cc15c0e96;hpb=c8c28626464eb310255dacf542f2501cf2f74d38;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 9873541..0e971ce 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -305,14 +305,14 @@ void MainWindow::setup_add_decoders(QMenu *parent) { 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); } @@ -388,8 +388,19 @@ void MainWindow::add_decoder(QObject *action) (srd_decoder*)((QAction*)action)->data().value(); assert(dec); - dialogs::Decoder dlg(this); - dlg.exec(); + const std::vector< boost::shared_ptr > &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()