X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=57e9c51f8d51b647e8ea6164d61834c1d832d11a;hb=ae2d1bc5b5aba9fcdd7fef42ef1bc9069267d6f7;hp=f72d1b7056041bd5cb34c563f68c7aed3523917e;hpb=945745012eb57cefa1ef457daf48cfffa99f9ec2;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index f72d1b7..57e9c51 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -25,6 +25,9 @@ #include #include +#include +#include + #include #include #include @@ -39,7 +42,7 @@ #include "mainwindow.h" #include "devicemanager.h" -#include "device/devinst.h" +#include "device/device.h" #include "dialogs/about.h" #include "dialogs/connect.h" #include "dialogs/storeprogress.h" @@ -289,8 +292,10 @@ void MainWindow::update_device_list( { assert(_sampling_bar); - const list< shared_ptr > &devices = - _device_manager.devices(); + list< shared_ptr > devices; + std::copy(_device_manager.devices().begin(), + _device_manager.devices().end(), std::back_inserter(devices)); + _sampling_bar->set_device_list(devices); if (!selected_device && !devices.empty()) { @@ -306,8 +311,9 @@ void MainWindow::update_device_list( } if (selected_device) { + // Setting the selected device in the sampling bar, generates + // an event which updates the selected device in the SigSession. _sampling_bar->set_selected_device(selected_device); - _session.set_device(selected_device); } } @@ -316,9 +322,15 @@ void MainWindow::load_file(QString file_name) const QString errorMessage( QString("Failed to load file %1").arg(file_name)); const QString infoMessage; - _session.load_file(file_name.toStdString(), - boost::bind(&MainWindow::session_error, this, - errorMessage, infoMessage)); + + try { + _session.set_file(file_name.toStdString()); + } catch(QString e) { + show_session_error(tr("Failed to load ") + file_name, e); + } + + _session.start_capture(boost::bind(&MainWindow::session_error, this, + errorMessage, infoMessage)); } void MainWindow::show_session_error(