]> sigrok.org Git - pulseview.git/blobdiff - pv/mainwindow.cpp
Implemented Popup dialog widget
[pulseview.git] / pv / mainwindow.cpp
index 6f852ce6044e16a1fe305c2334b21b36227bc6c0..ba232e25d0cb5afae12d5bb3f80a09f6b2fe3714 100644 (file)
@@ -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));
@@ -391,11 +392,16 @@ void MainWindow::add_decoder(QObject *action)
        const std::vector< boost::shared_ptr<view::Signal> > &sigs =
                _session.get_signals();
 
-       dialogs::Decoder dlg(this, dec, sigs);
-       if(dlg.exec() != QDialog::Accepted)
+       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());
+       _session.add_decoder(dec, dlg.get_probes(), options);
 }
 
 void MainWindow::run_stop()