From a9e580987c4ae9ea338bb20188b5577ba1b7bdfc Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Wed, 10 May 2023 14:36:51 +0800 Subject: [PATCH] Cancel the selected item when failed to active a device --- DSView/pv/toolbars/samplingbar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DSView/pv/toolbars/samplingbar.cpp b/DSView/pv/toolbars/samplingbar.cpp index 38ecf79c..c653b3be 100644 --- a/DSView/pv/toolbars/samplingbar.cpp +++ b/DSView/pv/toolbars/samplingbar.cpp @@ -1018,8 +1018,12 @@ namespace pv } } - _session->set_device(devHandle); - _last_device_index = _device_selector.currentIndex(); + if (_session->set_device(devHandle)){ + _last_device_index = _device_selector.currentIndex(); + } + else{ + update_device_list(); // Reload the list. + } } void SamplingBar::enable_toggle(bool enable)