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

Method create_popup

DSView/pv/view/decodetrace.cpp:668–720  ·  view source on GitHub ↗

to show decoder's property setting dialog

Source from the content-addressed store, hash-verified

666
667//to show decoder's property setting dialog
668bool DecodeTrace::create_popup(bool isnew)
669{
670 (void)isnew;
671
672 int ret = false; //setting have changed flag
673 bool bOpenDlg = true;
674
675 while (bOpenDlg)
676 {
677 bOpenDlg = false;
678 QWidget *top = AppControl::Instance()->GetTopWindow();
679 dialogs::DecoderOptionsDlg dlg(top);
680 dlg.set_cursor_range(_decode_cursor1, _decode_cursor2);
681 dlg.load_options(this);
682
683 int dlg_ret = dlg.exec();
684
685 if (QDialog::Accepted == dlg_ret)
686 {
687 dlg.apply_setting();
688
689 for(auto dec : _decoder_stack->stack())
690 {
691 if (dec->commit() || _decoder_stack->options_changed()) {
692 _decoder_stack->set_options_changed(true);
693 _decode_start = dec->decode_start();
694 _decode_end = dec->decode_end();
695 ret = true;
696 }
697 }
698
699 dlg.get_cursor_range(_decode_cursor1, _decode_cursor2);
700
701 // Reopen the dialog to select the required probes.
702 if (ret && _decoder_stack->check_required_probes() == false)
703 {
704 QString errMsg = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DECODERSTACK_DECODE_WORK_ERROR),
705 "One or more required channels have not been specified");
706 MsgBox::Show(errMsg);
707
708 ret = false;
709 bOpenDlg = true;
710 }
711 }
712
713 if (dlg.is_reload_form()){
714 ret = false;
715 bOpenDlg = true;
716 }
717 }
718
719 return ret;
720}
721
722} // namespace view
723} // namespace pv

Callers 2

add_decoderMethod · 0.80
rst_decoderMethod · 0.80

Calls 11

ShowFunction · 0.85
GetTopWindowMethod · 0.80
load_optionsMethod · 0.80
apply_settingMethod · 0.80
options_changedMethod · 0.80
set_options_changedMethod · 0.80
decode_startMethod · 0.80
check_required_probesMethod · 0.80
execMethod · 0.45
commitMethod · 0.45
decode_endMethod · 0.45

Tested by

no test coverage detected