projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adapt to new <libsigrokdecode/libsigrokdecode.h> header.
[pulseview.git]
/
pv
/
mainwindow.cpp
diff --git
a/pv/mainwindow.cpp
b/pv/mainwindow.cpp
index 16147b14ff6df87f0960a7783c8c07c928efe130..7320bf1aa740a488fe014d6e10aac2ba66621aab 100644
(file)
--- a/
pv/mainwindow.cpp
+++ b/
pv/mainwindow.cpp
@@
-19,7
+19,7
@@
*/
#ifdef ENABLE_SIGROKDECODE
*/
#ifdef ENABLE_SIGROKDECODE
-#include <sigrokdecode.h>
+#include <
libsigrokdecode/lib
sigrokdecode.h>
#endif
#include <boost/bind.hpp>
#endif
#include <boost/bind.hpp>
@@
-60,7
+60,8
@@
MainWindow::MainWindow(DeviceManager &device_manager,
const char *open_file_name,
QWidget *parent) :
QMainWindow(parent),
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) {
{
setup_ui();
if (open_file_name) {
@@
-184,7
+185,7
@@
void MainWindow::setup_ui()
QMetaObject::connectSlotsByName(this);
// Setup the toolbar
QMetaObject::connectSlotsByName(this);
// Setup the toolbar
- _toolbar = new QToolBar(this);
+ _toolbar = new QToolBar(t
r("Main Toolbar"), t
his);
_toolbar->addAction(_action_open);
_toolbar->addSeparator();
_toolbar->addAction(_action_view_zoom_in);
_toolbar->addAction(_action_open);
_toolbar->addSeparator();
_toolbar->addAction(_action_view_zoom_in);
@@
-277,11
+278,16
@@
void MainWindow::on_actionOpen_triggered()
void MainWindow::on_actionConnect_triggered()
{
void MainWindow::on_actionConnect_triggered()
{
+ // Stop any currently running capture session
+ _session.stop_capture();
+
dialogs::Connect dlg(this, _device_manager);
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);
}
update_device_list(sdi);
}