]> sigrok.org Git - pulseview.git/commitdiff
Show the file-device in the selector when a file is loaded
authorJoel Holdsworth <redacted>
Wed, 26 Feb 2014 21:31:39 +0000 (22:31 +0100)
committerJoel Holdsworth <redacted>
Sat, 1 Mar 2014 11:15:02 +0000 (11:15 +0000)
pv/mainwindow.cpp

index 2a74d5b292a40f8ac6ecaf42ba1dbdc791eef7a5..c75b3a9e59a5e940cbb2da11168c98e577be2b7d 100644 (file)
@@ -296,6 +296,10 @@ void MainWindow::update_device_list()
        std::copy(_device_manager.devices().begin(),
                _device_manager.devices().end(), std::back_inserter(devices));
 
+       if (std::find(devices.begin(), devices.end(), selected_device) ==
+               devices.end())
+               devices.push_back(selected_device);
+
        _sampling_bar->set_device_list(devices);
 
        if (selected_device)
@@ -314,6 +318,8 @@ void MainWindow::load_file(QString file_name)
                show_session_error(tr("Failed to load ") + file_name, e);
        }
 
+       update_device_list();
+
        _session.start_capture(boost::bind(&MainWindow::session_error, this,
                errorMessage, infoMessage));
 }