X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=ba232e25d0cb5afae12d5bb3f80a09f6b2fe3714;hp=9873541dd5dbe4dc24aea9be777a949cc15c0e96;hb=6e3f046e779b939efebdfa4d9e68fe28d9beee59;hpb=c8c28626464eb310255dacf542f2501cf2f74d38 diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 9873541d..ba232e25 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -305,7 +305,8 @@ 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)) { + for(; l; l = l->next) + { QAction *const action = parent->addAction(QString( ((srd_decoder*)l->data)->name)); action->setData(qVariantFromValue(l->data)); @@ -388,8 +389,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()