X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=97103ad514724278debbcb3588c585c8534331b5;hp=6f852ce6044e16a1fe305c2334b21b36227bc6c0;hb=51d4a9ab96a6bf64a1fcd1700e7e174498d4c118;hpb=708c552391bc942e91bc09bc808577e2564347bd diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 6f852ce6..97103ad5 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -40,7 +40,6 @@ #include "dialogs/about.h" #include "dialogs/connect.h" #include "dialogs/decoder.h" -#include "toolbars/contextbar.h" #include "toolbars/samplingbar.h" #include "view/view.h" @@ -98,8 +97,6 @@ void MainWindow::setup_ui() setCentralWidget(_central_widget); _view = new pv::view::View(_session, this); - connect(_view, SIGNAL(selection_changed()), this, - SLOT(view_selection_changed())); _vertical_layout->addWidget(_view); @@ -228,10 +225,6 @@ void MainWindow::setup_ui() SLOT(run_stop())); addToolBar(_sampling_bar); - // Setup the context bar - _context_bar = new toolbars::ContextBar(this); - addToolBar(_context_bar); - // Set the title setWindowTitle(QApplication::translate("MainWindow", "PulseView", 0, QApplication::UnicodeUTF8)); @@ -305,7 +298,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 +385,16 @@ void MainWindow::add_decoder(QObject *action) const std::vector< boost::shared_ptr > &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() @@ -419,13 +418,4 @@ void MainWindow::capture_state_changed(int state) _sampling_bar->set_capture_state((pv::SigSession::capture_state)state); } -void MainWindow::view_selection_changed() -{ - assert(_context_bar); - - const list > items( - _view->selected_items()); - _context_bar->set_selected_items(items); -} - } // namespace pv