projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pv::DeviceManager now manages opening/closing devices
[pulseview.git]
/
pv
/
mainwindow.cpp
diff --git
a/pv/mainwindow.cpp
b/pv/mainwindow.cpp
index ca514bf97a703eba3e7a8bc56dbebd23467c439a..dcbaf1812ab268765e626d69f5c280042c6ff65e 100644
(file)
--- a/
pv/mainwindow.cpp
+++ b/
pv/mainwindow.cpp
@@
-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) {
@@
-278,10
+279,12
@@
void MainWindow::on_actionOpen_triggered()
void MainWindow::on_actionConnect_triggered()
{
dialogs::Connect dlg(this, _device_manager);
void MainWindow::on_actionConnect_triggered()
{
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);
}