*/
#ifdef ENABLE_SIGROKDECODE
-#include <sigrokdecode.h>
+#include <libsigrokdecode/libsigrokdecode.h>
#endif
#include <boost/bind.hpp>
const char *open_file_name,
QWidget *parent) :
QMainWindow(parent),
- _device_manager(device_manager)
+ _device_manager(device_manager),
+ _session(device_manager)
{
setup_ui();
if (open_file_name) {
QMetaObject::connectSlotsByName(this);
// Setup the toolbar
- _toolbar = new QToolBar(this);
+ _toolbar = new QToolBar(tr("Main Toolbar"), this);
_toolbar->addAction(_action_open);
_toolbar->addSeparator();
_toolbar->addAction(_action_view_zoom_in);
void MainWindow::on_actionConnect_triggered()
{
+ // Stop any currently running capture session
+ _session.stop_capture();
+
dialogs::Connect dlg(this, _device_manager);
- if (!dlg.exec())
- return;
- struct sr_dev_inst *const sdi = dlg.get_selected_device();
+ // If the user selected a device, select it in the device list. Select the
+ // current device otherwise.
+ struct sr_dev_inst *const sdi = dlg.exec() ?
+ dlg.get_selected_device() : _session.get_device();
+
update_device_list(sdi);
}