MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / on_device_selected

Method on_device_selected

DSView/pv/toolbars/samplingbar.cpp:956–989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954 }
955
956 void SamplingBar::on_device_selected()
957 {
958 if (_updating_device_list)
959 {
960 return;
961 }
962 if (_device_selector.currentIndex() == -1)
963 {
964 dsv_err("Have no selected device.");
965 return;
966 }
967 _session->stop_capture();
968 _session->session_save();
969
970 ds_device_handle devHandle = (ds_device_handle)_device_selector.currentData().toULongLong();
971 if (_session->have_hardware_data() && _session->is_first_store_confirm()){
972 if (MsgBox::Confirm(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SAVE_CAPDATE), "Save captured data?")))
973 {
974 _updating_device_list = true;
975 _device_selector.setCurrentIndex(_last_device_index);
976 _updating_device_list = false;
977 _next_switch_device = devHandle; // Save end, auto switch to this device.
978 sig_store_session_data();
979 return;
980 }
981 }
982
983 if (_session->set_device(devHandle)){
984 _last_device_index = _device_selector.currentIndex();
985 }
986 else{
987 update_device_list(); // Reload the list.
988 }
989 }
990
991 void SamplingBar::enable_toggle(bool enable)
992 {

Callers

nothing calls this directly

Calls 5

stop_captureMethod · 0.80
have_hardware_dataMethod · 0.80
session_saveMethod · 0.45
set_deviceMethod · 0.45

Tested by

no test coverage detected