X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=ba232e25d0cb5afae12d5bb3f80a09f6b2fe3714;hp=eae106746b76b6313182ecdf9f7bdf7661b72fb5;hb=6e3f046e779b939efebdfa4d9e68fe28d9beee59;hpb=df840662d228637f84d44ec24005e8b9bed8628f diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index eae10674..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, dec); - 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()