X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=0089b112a721f1585a9813134328cfd30c360ccb;hb=8bd26d8b9c831b509ee3241ea4dac6f50c023622;hp=c75b3a9e59a5e940cbb2da11168c98e577be2b7d;hpb=a5ea63c219065d019195171f3c7694ee0123d5ed;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index c75b3a9e..0089b112 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -220,7 +220,7 @@ void MainWindow::setup_ui() "MainWindow", "&Decoders", 0, QApplication::UnicodeUTF8)); pv::widgets::DecoderMenu *const menu_decoders_add = - new pv::widgets::DecoderMenu(menu_decoders); + new pv::widgets::DecoderMenu(menu_decoders, true); menu_decoders_add->setTitle(QApplication::translate( "MainWindow", "&Add", 0, QApplication::UnicodeUTF8)); connect(menu_decoders_add, SIGNAL(decoder_selected(srd_decoder*)), @@ -299,11 +299,9 @@ void MainWindow::update_device_list() if (std::find(devices.begin(), devices.end(), selected_device) == devices.end()) devices.push_back(selected_device); + assert(selected_device); - _sampling_bar->set_device_list(devices); - - if (selected_device) - _sampling_bar->set_selected_device(selected_device); + _sampling_bar->set_device_list(devices, selected_device); } void MainWindow::load_file(QString file_name) @@ -316,6 +314,9 @@ void MainWindow::load_file(QString file_name) _session.set_file(file_name.toStdString()); } catch(QString e) { show_session_error(tr("Failed to load ") + file_name, e); + _session.set_default_device(); + update_device_list(); + return; } update_device_list();